From 632c9793927a30c4bca3c91888e66b369d732dfe Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 8 Jun 2026 04:22:49 +0900 Subject: feat(phase-c): resolve PhpMixed-conversion phase-b TODOs Implement the foundational PhpMixed conversion infrastructure (From, order-sensitive PartialEq matching PHP ===) and resolve the category-G phase-b TODOs that depend on it: - Fix VCS driver cache paths that discarded parsed JSON or diverged on null caches (svn/forgejo/gitlab/git-bitbucket/github). - Wire up real conversions previously stubbed or dropped: suggests platform config, audit ignore-severities, composer_repository search and ProviderInfo, class_loader prefix/classmap merges, locker lock diff comparison, advisory JSON serialization, SPDX license fields. - Make GenericRule take a typed ReasonData; populate RULE_ROOT_REQUIRE with the constraint and convert PhpMixed at the call sites. --- .../shirabe/src/repository/vcs/git_bitbucket_driver.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs') diff --git a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs index 3f0be13..f8cfd7a 100644 --- a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs +++ b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs @@ -239,7 +239,6 @@ impl GitBitbucketDriver { .and_then(|v| v.as_string()) .map(String::from); - // TODO(phase-b): unwrap PhpMixed::Array into the typed IndexMap stored on self self.repo_data = match repo_data { PhpMixed::Array(m) => m.into_iter().map(|(k, v)| (k, *v)).collect(), _ => IndexMap::new(), @@ -262,18 +261,9 @@ impl GitBitbucketDriver { if self.inner.should_cache(identifier) && { let res = self.inner.cache.as_mut().and_then(|c| c.read(identifier)); if let Some(res) = res { - // TODO(phase-b): wrap parsed PhpMixed::Array into the IndexMap-shaped composer slot - composer = Some( - JsonFile::parse_json(Some(&res), None)? - .as_array() - .cloned() - .map(|m| { - m.into_iter() - .map(|(k, v)| (k, *v)) - .collect::>() - }) - .unwrap_or_default(), - ); + composer = JsonFile::parse_json(Some(&res), None)? + .as_array() + .map(|m| m.iter().map(|(k, v)| (k.clone(), (**v).clone())).collect()); true } else { false -- cgit v1.3.1