aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository/composer_repository.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-19 17:43:27 +0900
committernsfisis <nsfisis@gmail.com>2026-07-19 17:53:42 +0900
commitd0cd98cd212bc13cbcfd0fd97fc245329b57f50f (patch)
tree21bc56941b9f26247026893a9667450e275d5096 /crates/shirabe/src/repository/composer_repository.rs
parent7e84d9ea31584e0dc04f04d14f6905ab9d978c72 (diff)
downloadphp-shirabe-d0cd98cd212bc13cbcfd0fd97fc245329b57f50f.tar.gz
php-shirabe-d0cd98cd212bc13cbcfd0fd97fc245329b57f50f.tar.zst
php-shirabe-d0cd98cd212bc13cbcfd0fd97fc245329b57f50f.zip
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.
Diffstat (limited to 'crates/shirabe/src/repository/composer_repository.rs')
-rw-r--r--crates/shirabe/src/repository/composer_repository.rs7
1 files changed, 6 insertions, 1 deletions
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())