From d0cd98cd212bc13cbcfd0fd97fc245329b57f50f Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 19 Jul 2026 17:43:27 +0900 Subject: fix(search-command): un-ignore test_search by fixing JSON output and abandoned propagation The json format branch ignored search results entirely and always wrote null. Encode results into the same name/description/abandoned/url shape Composer's array-backed repositories produce. Also fix ComposerRepository's RepositoryInterface::search adapter, which dropped the abandoned field from raw API results even when present. --- crates/shirabe/src/repository/composer_repository.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/shirabe/src/repository') diff --git a/crates/shirabe/src/repository/composer_repository.rs b/crates/shirabe/src/repository/composer_repository.rs index 54edc39a..580667b5 100644 --- a/crates/shirabe/src/repository/composer_repository.rs +++ b/crates/shirabe/src/repository/composer_repository.rs @@ -3575,7 +3575,12 @@ impl RepositoryInterface for ComposerRepository { .get("description") .and_then(|v| v.as_string()) .map(|s| s.to_string()), - abandoned: None, + abandoned: m.get("abandoned").filter(|v| v.to_bool()).map(|v| { + match v.as_string() { + Some(s) => crate::repository::AbandonedInfo::Replacement(s.to_string()), + None => crate::repository::AbandonedInfo::Abandoned, + } + }), url: m .get("url") .and_then(|v| v.as_string()) -- cgit v1.3.1