fix: give --fix an honest, categorized summary of unapplied fixes - #976
Merged
Conversation
The --fix summary lumped every not-auto-applied fix under a single "Skipped findings" line with a "v1 skip" jargon sub-bucket, which (1) implied a safe within-range refresh needed manual review the same as a breaking major bump, (2) miscounted - the number counted deduplicated targets and skip records, not findings, so it contradicted the "Remaining findings after fix" line, and (3) meant nothing to a user staring at a report full of runnable fix commands. New categorizeUnappliedTargets splits the not-applied fixes into within-range refreshes (safe to run), parent upgrades (need review, with a breaking major-bump sub-count derived via the existing isMajorVersionBump), and no fix available. The summary renders these honestly, drops the "v1 skip"/"Skipped findings" wording, and the note explains that --fix only auto-applies safe in-range direct upgrades and points to the Suggested Fix Plan for the rest. FixResultJson gains an additive notAutoApplied block so CI can read the structured breakdown without parsing stdout; existing fields are unchanged. Behavior is unchanged - this is messaging only.
Adds categorizeUnappliedTargets unit tests (within-range vs parent upgrade vs breaking vs no-fix) and printFixModeSummary rendering tests (honest breakdown, no v1-skip jargon, breaking note only when a major bump is present). Updates the create-pr mocks to the new FixExecutionResult shape.
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.
Closes #974
The
--fixsummary lumped every not-auto-applied fix under a single "Skipped findings" line with a "v1 skip" jargon sub-bucket. On a project where nothing auto-applies (all findings transitive/breaking), a user stares at a report full of runnable fix commands, runs--fix, sees it apply zero, and gets an explanation that reads as broken.Three real problems (verified against the code, credit to @Demiserular's analysis on the issue for surfacing them):
parent-update) needed manual review the same as a breaking major bump (parent-upgrade) - they were both swept into one bucket.What changed
categorizeUnappliedTargetssplits not-applied fixes into within-range refreshes (safe to run), parent upgrades (need review, with a breaking major-bump sub-count via the existingisMajorVersionBump), and no fix available.--fixonly auto-applies safe in-range direct upgrades and points to the Suggested Fix Plan for the rest.FixResultJsongains an additivenotAutoAppliedblock so CI can read the structured breakdown without parsing stdout. Existing fields are unchanged.Behavior is unchanged - this is a messaging-only change.
Before / After
Before:
After:
Follow-up (not in this PR): within-range refreshes are marked "safe to run" but still not auto-applied - whether
--fixshould auto-apply them is a separate behavior change, tracked separately.In-house fix (fix-runner / output internals).