test(docs): fail when generated docs are out of date (backport of #4360 to V6.2) - #4493
Merged
Conversation
* test(docs): fail when generated docs are out of date Refactor the doc generators to render to memory (generatedDocFiles) and add a test that compares the rendered output against the committed files. This catches contributors who change a config option or CLI command but forget to run `make cli-docs`. Also regenerates server_options.rst, which had drifted from the policy.authzen.endpoint flag description. Assisted by AI * ci: run the Go test job on docs/ Go files too paths-filter excluded all of docs/ (including docs/generate_docs.go and its tests) from the "code" filter that gates the test job, so the new TestGeneratedDocsAreUpToDate added in this PR never actually runs in CI. Its some-with-excludes mode makes an exclusion final, so a blanket '!docs/**' can't be selectively re-included by a later positive pattern - the exclude has to be scoped to the non-Go subpaths instead. Assisted by AI * ci: simplify docs/ code filter to !docs/*/** The per-subpath exclude list duplicated the docs/ directory layout into the workflow config. Since all Go files live directly under docs/, a single '!docs/*/**' (excluding anything nested under a docs subdirectory) achieves the same result: it still treats a handful of rarely-changed root-level non-Go files (Dockerfile, conf.py, etc.) as code, which is an acceptable false-positive risk in exchange for not having to keep the filter in sync with docs/'s contents. Assisted by AI (cherry picked from commit dac8093)
reinkrul
requested review from
gerardsn,
stevenvegt and
woutslakhorst
as code owners
September 9, 2026 08:28
Contributor
1 new issue
|
Contributor
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (1)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
stevenvegt
approved these changes
Sep 9, 2026
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.

Backport of #4360 to V6.2.
Scope differences from #4360
.github/workflows/go-test.yamlchanges: V6.2's workflow doesn't have thechanges/paths-filter job that skips CI on docs-only changes yet (that's tracked separately, see the unmergedci/skip-checks-docs-only-v6.2branch, a backport of ci: skip test and e2e-test jobs for docs-only changes #4455). Nothing to fix here since V6.2'stestjob always runs unconditionally... table::format. The switch to.. list-table::(docs: generate server options as list-table for stable diffs #4426) was never backported to V6.2, so bringing it in here would be out of scope. Regenerating the docs on V6.2 confirms the output is unchanged.Verified:
go build ./...,go test ./docs/...(including the newTestGeneratedDocsAreUpToDate) pass on V6.2.Assisted by AI