feat(completeness): add --incomplete-policy to control exit behavior on incomplete scan data - #1019
Open
luojiyin1987 wants to merge 3 commits into
Open
feat(completeness): add --incomplete-policy to control exit behavior on incomplete scan data#1019luojiyin1987 wants to merge 3 commits into
luojiyin1987 wants to merge 3 commits into
Conversation
…on incomplete scan data Add `--incomplete-policy warn|error` (default: warn). When set to error, EXIT_ERROR (3) is returned on detection-impact incomplete scan data. Remediation gaps and ratchet behavior are unaffected. Closes OWASP#1018
- Arg parsing: default warn, parse warn/error, =form, invalid throws - Single-folder: detection+warn, detection+error, remediation+error, ratchet+warn - Multi-folder: detection+warn, detection+error, remediation+error, multi-folder detection, ratchet+warn - Fix action.yml: pass incomplete-policy through Apply security fixes step - Docs: add --incomplete-policy to CLI reference and workflow integration
Collaborator
Author
|
Addressed all three review items: P1 — Behavioral tests (+16 tests, 1446 → 1462):
P2 — Action fix step: Added P3 — Docs:
|
Collaborator
|
Hey @luojiyin1987, thanks for this - the completeness work you've done has been great. There's an existing PR (#941) for the same feature that has priority since it came first. I've asked that contributor to address the outstanding changes within the next 48 hours. If they don't respond we'll close #941 and come back to yours. Will keep you posted! |
Collaborator
Author
|
No worries at all — I'm not in a rush. Happy to wait and see how #941 goes. Thanks for keeping me posted! @sonukapoor |
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
Add
--incomplete-policy warn|error(default:warn) to control exit code when scan detection data is incomplete.Behavior
--fail-onerroronly targets detection-impact incomplete data. Remediation gaps are never affected by this flag.Changes
src/types.ts—IncompletePolicytype, field onParsedOptionssrc/cli/args.ts— defaultwarn, parse--incomplete-policy warn|errorsrc/cli/help.ts— help text + examplesrc/scan/completeness.ts—shouldFailForIncompleteScan()helpersrc/index.ts— single-folder exit codesrc/scan/multi-folder-scan.ts— multi-folder exit code, shared aggregated completenessaction.yml—incomplete-policyinput (empty default for old CLI compat)tests/helpers.test.ts— updated expectationsDesign decisions
--ratchetdetection gap check runs independently.incompletePolicydoes not override it.Closes #898