Repository navigation
ci: gate documentation coverage and examples - #546
Merged
Merged
Conversation
Two jobs, and a ratchet so the example one can be turned on today rather than after 359 fixes. doc-coverage runs check_doc_coverage.py and is deliberately ungated. A new keyword, attribute or subcommand added under src/ must not land undocumented just because the pull request touched no markdown, and the feature list is read from the compiler, so the job knows. doc-examples compiles every ```flow block. The examples that do not build today are recorded in docs/generated/example-status.json and grandfathered. Rows are keyed by a hash of the block's own text, so editing one produces a key the ledger has never seen and the new text has to compile. Existing debt is inherited; new and edited content is not. Debt that has since been paid off is reported, not failed. Failing an unrelated pull request because someone else fixed a doc example would teach people to regenerate the ledger without reading it, which is exactly how a ratchet stops meaning anything. Verified end to end rather than by inspection: a new broken block fails and names the file, line, stage and diagnostic; the same block tagged expect-error passes; and editing a block the ledger grandfathers makes it fail again. That last one is the property the whole scheme rests on, and it has its own test. Also fixed a bug in the failure path itself: the missing-ledger message called relative_to(ROOT), which raises when the ledger is anywhere else. Both jobs join the ci-ok aggregator. Ledger refreshed for the block #539 added: 751 examples, 359 unverified. Unit 1496 passed, ruff clean on src. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.
Fifth of the wiki series. Turns on the gates the earlier PRs built.
Two jobs
doc-coveragerunscheck_doc_coverage.pyand is deliberately ungated by paths. A new keyword, attribute or subcommand added undersrc/must not land undocumented just because the PR touched no markdown, and since the feature list is read out of the compiler, the job notices.doc-examplescompiles every```flowblock. 359 of 751 do not build today, so a hard gate would mean fixing all of them in one unreviewable change. Instead the failing set is recorded indocs/generated/example-status.jsonand grandfathered.Why the ratchet holds
Ledger rows are keyed by
path#sha256(block)[:12]. Editing a grandfathered block produces a key the ledger has never seen, so its exemption evaporates and the new text has to compile. Existing debt is inherited; new and edited content is not. That is the whole scheme, and it has its own test.Debt that has since been paid off is reported, not failed:
Failing an unrelated PR because somebody else fixed a doc example would teach people to regenerate the ledger without reading it, which is precisely how a ratchet stops meaning anything.
Verified by running it, not by inspection
A new broken block:
The same block tagged
expect-error: passes. Editing a block the ledger grandfathers: fails again, as it must.Also fixed
A bug in the failure path itself. The missing-ledger message called
LEDGER.relative_to(ROOT), which raisesValueErrorwhen the ledger is anywhere else — so the error handler crashed instead of reporting. Caught by the test written for it.Ledger refreshed for the block #539 added, and it now writes one row per distinct block, since text repeated within a page shares a key and always verifies identically.
Validation
--check-ledgerclean on maincheck_doc_coverage.pycleanruff check srccleanci.ymlparses; both jobs are in theci-okaggregator with the right required-ness