Skip to content

test(cli): pin which doc snippets may skip INI validation - #760

Merged
CybotTM merged 1 commit into
mainfrom
test/pin-doc-skip-markers
Jul 28, 2026
Merged

test(cli): pin which doc snippets may skip INI validation#760
CybotTM merged 1 commit into
mainfrom
test/pin-doc-skip-markers

Conversation

@CybotTM

@CybotTM CybotTM commented Jul 28, 2026

Copy link
Copy Markdown
Member

Follow-up to #757, which removed the allow-list from TestDocumentedINIParses
and made the gate unconditional. One bypass remained: 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
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:

File Why it cannot be valid config
docs/CONFIGURATION.md [job-TYPE "NAME"] placeholder schema, not a real section name
docs/TROUBLESHOOTING.md shows 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.

Verification

Verified by breaking each direction:

  • adding a marker to a docs/SECURITY.md block → docs/SECURITY.md:108: new "no-validate" exemption; fix the snippet, or add it to want here with the reason it cannot be valid config
  • removing the docs/TROUBLESHOOTING.md marker → docs/TROUBLESHOOTING.md no longer uses "no-validate" ... - drop the entry from want

go test ./cli/ passes and golangci-lint reports 0 issues.

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>
Copilot AI review requested due to automatic review settings July 28, 2026 17:52
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval for maintainer PR

All automated quality gates passed. See SECURITY_CONTROLS.md for compensating controls.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.69%. Comparing base (39c7130) to head (78f1569).

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     
Flag Coverage Δ
integration 87.69% <ø> (ø)
unittests 85.25% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CybotTM
CybotTM added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit 92550e0 Jul 28, 2026
27 of 28 checks passed
@CybotTM
CybotTM deleted the test/pin-doc-skip-markers branch July 28, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants