Repository navigation
Conversation
Contributor
|
Heads-up: this branch is currently behind
Once updated, CI will re-run. Thanks! |
…aths The single- and multi-folder scan paths each typed out the three --fail-on gate-class labels as string literals, so the wording for one class could change on one path without any test noticing. Export GATE_CLASS_LABELS next to failingGateSummary and build both call sites' gate input from it. Each path now has a test that trips all three classes and asserts the gate line against the shared labels, and a unit test pins the wording itself. No change to gate behaviour, exit codes or printed text. Closes OWASP#1274
Souptik96
force-pushed
the
feature/issue-1274-shared-gate-labels
branch
from
October 10, 2026 06:17
da4b923 to
1c5e893
Compare
Author
|
Rebased onto current |
This branch has not been deployed
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.
What changed and why
The single- and multi-folder scan paths each typed the three
--fail-ongate-class labels as string literals. One path's wording could change without any test noticing.src/utils/severity.ts: exportGATE_CLASS_LABELSnext tofailingGateSummary.src/scan/single-scan.tsandsrc/scan/multi-folder-scan.ts: both call sites now build their gate input from it.tests/cli-integration.test.ts(single-folder) andtests/multi-folder-scan.test.ts(multi-folder) each get a test that trips all three classes. Each asserts the printed gate line againstGATE_CLASS_LABELS, not a hand-typed copy. The single-folder test needed adetectDM001module mock in that file. Its default returns[], so no existing test changes behaviour.tests/utils/failon-gate-summary.test.tspins the wording itself, once.Gate behaviour, exit codes and printed text are unchanged.
The check from the issue. I replaced each label at each call site with a literal, one at a time (6 mutations: 3 classes × 2 paths). Every mutation fails exactly one of the new tests. Changing the shared constant fails the pinning test.
Verification.
npm ci,npm run lint:tests,npm run build,node dist/index.js advisories syncandnpm testwere run on Windows (Node 22).main, the suite has 64 failures.caCertpath into the real~/.cve-lite-cli/config.json, and later e2e runs then fail on it. I can file that separately if it's useful.Closes #1274