diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-02 04:53:11 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-02 04:53:11 +0900 |
| commit | 3b22fd4ede833b19c4113f88363021d00090d927 (patch) | |
| tree | fdb7729ee696a20afc0396a5cee1e0304009ee63 /crates/shirabe | |
| parent | a5c6eaee73e4008a51d71c925b4fd410b27578c8 (diff) | |
| download | php-shirabe-3b22fd4ede833b19c4113f88363021d00090d927.tar.gz php-shirabe-3b22fd4ede833b19c4113f88363021d00090d927.tar.zst php-shirabe-3b22fd4ede833b19c4113f88363021d00090d927.zip | |
fix(diagnose-command): pass the self-audit when installed.json is absent
A native binary never ships vendor/composer/installed.json, so
Composer's "non-standard Composer installation" warning fired on every
diagnose run and forced exit 1. The self-audit itself stays: a Composer
source snapshot is planned to be embedded together with the plugin API
implementation, which will make it functional; until then the missing
file reports success, marked with TODO(phase-c).
Also un-ignore diagnose_command_test::test_cmd_success: the other half
of its ignore reason ("requires real network access") is no blocker —
the PHP original runs its live packagist/github checks unguarded too.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe')
| -rw-r--r-- | crates/shirabe/src/command/diagnose_command.rs | 7 | ||||
| -rw-r--r-- | crates/shirabe/tests/command/diagnose_command_test.rs | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/crates/shirabe/src/command/diagnose_command.rs b/crates/shirabe/src/command/diagnose_command.rs index 3f69722a..2d00ca21 100644 --- a/crates/shirabe/src/command/diagnose_command.rs +++ b/crates/shirabe/src/command/diagnose_command.rs @@ -974,7 +974,12 @@ impl DiagnoseCommand { None, )?; if !installed_json.exists() { - return Ok(PhpMixed::String("<warning>Could not find Composer's installed.json, this must be a non-standard Composer installation.</>".to_string())); + // TODO(phase-c): the native binary never ships vendor/composer/installed.json, so + // Composer's "non-standard Composer installation" warning would fire on every run. + // A Composer source snapshot is planned to be embedded together with the plugin API + // implementation, which will make this self-audit functional; until then report + // success instead of the warning. + return Ok(PhpMixed::Bool(true)); } let local_repo = FilesystemRepository::new(installed_json, false, None, None)?; diff --git a/crates/shirabe/tests/command/diagnose_command_test.rs b/crates/shirabe/tests/command/diagnose_command_test.rs index 71f3aa07..d2102f95 100644 --- a/crates/shirabe/tests/command/diagnose_command_test.rs +++ b/crates/shirabe/tests/command/diagnose_command_test.rs @@ -46,12 +46,6 @@ Checking github.com rate limit: " #[test] #[serial] -#[ignore = "check_composer_audit locates Composer's own vendor/composer/installed.json through a \ - literal relative path standing in for PHP's __DIR__, so it is never found from the \ - temporary working directory this test runs in; diagnose then reports a warning and \ - exits non-zero. diagnose also checks live http/https connectivity to packagist and \ - the github.com rate limit (as the PHP original does), so the test additionally \ - requires real network access"] fn test_cmd_success() { let tear_down = init_temp_composer( Some(&serde_json::json!({ |
