fix: add apply diagnostics for silent no-op failures#53
Open
Wenxin-Jiang wants to merge 1 commit intomainfrom
Open
fix: add apply diagnostics for silent no-op failures#53Wenxin-Jiang wants to merge 1 commit intomainfrom
Wenxin-Jiang wants to merge 1 commit intomainfrom
Conversation
When `apply` runs in CI and no packages match manifest patches, it previously exited 0 silently, masking configuration errors. This change: - Tracks which manifest entries actually matched installed packages - Returns exit code 1 when targeted patches exist but nothing matched - Emits per-PURL warnings for unmatched manifest entries - Adds a post-apply summary (applied/already-patched/not-found counts) - Includes `unmatchedPatches` and `unmatchedPurls` in JSON output - Changes `apply_patches_inner` signature to return unmatched PURLs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@claude review once |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--ecosystemsfiltering.Summary: X/Y targeted patches applied, Z already patched, W not found on diskso the user always sees the gap.unmatchedPatches(count) andunmatchedPurls(list) to--jsonoutput.Addresses findings CRITICAL-1 (zero packages → exit 0), CRITICAL-2 (version mismatch → silent skip), and CRITICAL-3 (no unmatched-manifest diagnostic) from the reliability audit.
Test plan
cargo check -p socket-patch-clicompilescargo test -p socket-patch-clipassescargo test -p socket-patch-corepasses (255 tests)applyin a dir with manifest but nonode_modules/— should exit 1 with warningapplyafternpm updatechanges a version — should warn about unmatched PURLapply --ecosystems npmwith pypi patches in manifest — pypi patches should NOT appear as unmatchedapply --json— verifyunmatchedPatchesandunmatchedPurlsfields🤖 Generated with Claude Code