aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/package_discovery_trait.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-02 23:58:38 +0900
committernsfisis <nsfisis@gmail.com>2026-06-02 23:58:54 +0900
commit51843230859ef39344c0b67daa9049ead87ec49c (patch)
treef657969816da51b7f8656012e756498680ffcc23 /crates/shirabe/src/command/package_discovery_trait.rs
parent20dbcf11b86cb03c451ba1d5cd9efe17b68fa66d (diff)
downloadphp-shirabe-51843230859ef39344c0b67daa9049ead87ec49c.tar.gz
php-shirabe-51843230859ef39344c0b67daa9049ead87ec49c.tar.zst
php-shirabe-51843230859ef39344c0b67daa9049ead87ec49c.zip
feat(resolver): port SecurityAdvisoryPoolFilter::filter
Implement the security advisory pool filter end to end, plus the remaining actionable wirings it unblocked. - Unify the PartialSecurityAdvisory|SecurityAdvisory union as the PartialOrFullSecurityAdvisory enum and make the advisory types Clone, so advisories can be collected and stored; Pool.security_removed_versions now carries the union. This also unblocks PoolOptimizer's clone of the security-removed versions. - Thread the filter result through run_security_advisory_filter/build_pool as anyhow::Result. - Introduce typed PlatformRepositoryHandle and pass platform repos as handles through determine_requirements instead of &PlatformRepository. - Wire RuleSetGenerator's is_unacceptable_fixed_or_locked_package check and UpdateCommand's non-locked installed-packages branch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/package_discovery_trait.rs')
-rw-r--r--crates/shirabe/src/command/package_discovery_trait.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/shirabe/src/command/package_discovery_trait.rs b/crates/shirabe/src/command/package_discovery_trait.rs
index 7da2b9a..939982a 100644
--- a/crates/shirabe/src/command/package_discovery_trait.rs
+++ b/crates/shirabe/src/command/package_discovery_trait.rs
@@ -26,6 +26,7 @@ use crate::package::version::VersionParser;
use crate::package::version::VersionSelector;
use crate::repository::CompositeRepository;
use crate::repository::PlatformRepository;
+use crate::repository::PlatformRepositoryHandle;
use crate::repository::RepositoryFactory;
use crate::repository::RepositorySet;
use crate::repository::{RepositoryInterface, SearchResult};
@@ -147,7 +148,7 @@ pub trait PackageDiscoveryTrait {
input: &dyn InputInterface,
_output: &dyn OutputInterface,
mut requires: Vec<String>,
- platform_repo: Option<&PlatformRepository>,
+ platform_repo: Option<&PlatformRepositoryHandle>,
preferred_stability: &str,
use_best_version_constraint: bool,
fixed: bool,
@@ -488,7 +489,7 @@ pub trait PackageDiscoveryTrait {
io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
input: &dyn InputInterface,
name: &str,
- platform_repo: Option<&PlatformRepository>,
+ platform_repo: Option<&PlatformRepositoryHandle>,
preferred_stability: &str,
fixed: bool,
) -> Result<(String, String)> {
@@ -859,13 +860,14 @@ pub trait PackageDiscoveryTrait {
fn get_platform_exception_details(
&self,
candidate: PackageInterfaceHandle,
- platform_repo: Option<&PlatformRepository>,
+ platform_repo: Option<&PlatformRepositoryHandle>,
) -> String {
let mut details: Vec<String> = vec![];
let platform_repo = match platform_repo {
None => return String::new(),
Some(p) => p,
};
+ let platform_repo = platform_repo.borrow();
for link in candidate.get_requires().values() {
if !PlatformRepository::is_platform_package(link.get_target()) {