test(cli): pin which doc snippets may skip INI validation - #760
Merged
Conversation
TestDocumentedINIParses has no allow-list, but it does have one bypass: a `no-validate` marker in the fence info string. It bypasses silently — the block is dropped during extraction and never counted — so a key the parser rejects could be hidden by tagging its snippet instead of fixing the docs, and nothing would report it. Carry the skipped blocks through extraction instead of discarding them, and pin them to a declared list with a reason per entry. Both current exemptions are snippets that cannot be valid config by design: a [job-TYPE "NAME"] placeholder schema, and a snippet showing a misspelled key so readers recognize the typo. The list fails in both directions, so it cannot drift: an undeclared marker fails with its file and line, and an entry whose marker was removed fails asking to drop it. Verified by breaking each: adding a marker to a SECURITY.md block reports "docs/SECURITY.md:108: new "no-validate" exemption"; removing the TROUBLESHOOTING.md marker reports that the file no longer uses it. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
There was a problem hiding this comment.
Automated approval for maintainer PR
All automated quality gates passed. See SECURITY_CONTROLS.md for compensating controls.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #760 +/- ##
==========================================
- Coverage 87.70% 87.69% -0.02%
==========================================
Files 90 90
Lines 12057 12057
==========================================
- Hits 10575 10573 -2
- Misses 1193 1194 +1
- Partials 289 290 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.



Follow-up to #757, which removed the allow-list from
TestDocumentedINIParsesand made the gate unconditional. One bypass remained: a
no-validatemarker inthe fence info string.
It bypasses silently — the block is dropped during extraction and never
counted — so a key the parser rejects could be hidden by tagging its snippet
rather than fixing the docs, and no output would say so. In a gate whose whole
point is that it cannot be waived, an unbounded silent waiver is the weak spot.
This carries the skipped blocks through extraction instead of discarding them,
and pins them to a declared list with a reason per entry:
docs/CONFIGURATION.md[job-TYPE "NAME"]placeholder schema, not a real section namedocs/TROUBLESHOOTING.mdThe list fails in both directions, so it cannot drift: an undeclared marker
fails with its file and line, and an entry whose marker was removed fails
asking to drop it.
Verification
Verified by breaking each direction:
docs/SECURITY.mdblock →docs/SECURITY.md:108: new "no-validate" exemption; fix the snippet, or add it to want here with the reason it cannot be valid configdocs/TROUBLESHOOTING.mdmarker →docs/TROUBLESHOOTING.md no longer uses "no-validate" ... - drop the entry from wantgo test ./cli/passes and golangci-lint reports 0 issues.