fix(ratchet): reject incomplete detection data - #937
Open
luojiyin1987 wants to merge 7 commits into
Open
Conversation
luojiyin1987
marked this pull request as ready for review
August 5, 2026 01:06
3 tasks
This was referenced Aug 5, 2026
sonukapoor
requested changes
Aug 6, 2026
sonukapoor
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @luojiyin1987 - the core call is right: gating ratchet on detection-impact gaps (so a failed fix-version lookup does not invalidate a good baseline) is exactly the level to reason at. A few things before it goes in, plus a coordination note with #936.
- Multi-folder over-block: this blocks ratchet for every subfolder if any single one has a detection gap, but the code just below treats folders independently. In a monorepo, one folder's transient OSV failure would block the baseline for all the clean folders too. Can we scope it per-folder? And a mixed-case test (one clean folder, one incomplete) would lock the behavior in - right now both test folders share the same mock.
- The block message is a static string - a CI user cannot tell which diagnostic, package, or subfolder tripped it. #936 adds
getCompletenessImpact()/formatDiagnosticMessage()for exactly this; can we surface the real diagnostic here? Actionable output is the whole point. - Re-run guidance edge case:
OSV_DETAIL_CONFIRMED_MISSINGis permanent, not transient, so re-running will not help and there is no override - a project that hits a permanently-missing record gets locked out of --ratchet. Fine as a fast-follow (maybe under #907), but let's not tell them to re-run when it cannot fix it. - Coordination/DRY: #936 introduces the shared
getCompletenessImpact()helper and you duplicate the same detection-gap predicate here. Plan is to merge #936 first, then rebase this onto it and swap the inline.some()checks for that helper.
Collaborator
Author
|
Thanks, agreed on all points. I’ll wait for #936 to land, then rebase this PR onto I’ll also avoid the blanket re-run guidance for confirmed-missing diagnostics. |
Collaborator
Author
|
Updated after #936 landed.
CI, Self Scan, and CodeQL are passing. |
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
Reject ratchet baseline work when detection data is incomplete.
This PR does not add terminal, JSON, or HTML diagnostic output.
Part of #907.
Validation
npm run buildnpm test -- --runInBand tests/cli-integration.test.ts tests/multi-folder-scan.test.ts