Add stale generated-pages check - #230
Merged
Merged
Conversation
archive-providers, mdo-providers, and database/tables are each generated by a pipeline outside this repo (#192), so unlike crmscript (#189/#229) there is no source file here to regenerate-and-diff -- the only available signal is a page on disk that has dropped out of its tree's nav-*.json. tools/find-stale-generated-pages.py walks each configured tree, diffs files against nav, and only ever treats a `generated: true` page as a delete candidate; anything stale-looking without that marker is reported separately for manual review, never touched. .github/workflows/stale-generated-pages.yml runs it in report-only mode on PRs touching these trees, failing the check and listing what it found; --delete is available for local cleanup and is the natural hook for a future auto-commit step once the check has proven reliable, not something wired into CI yet. Fixed one real pre-existing nav gap found while establishing a clean baseline: en/database/tables/index-by-id.mdx is generated: true and linked directly from index.mdx, but was missing from nav-database-tables.json -- added rather than ever being treated as stale.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
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.
Closes #216.
What this does
archive-providers,mdo-providers, anddatabase/tablesare each generated by a pipeline outside this repo (#192), so unlike crmscript (#189/#229) there's no source file here to regenerate-and-diff — the only available signal is a page on disk that has dropped out of its tree'snav-*.json. One mechanism, simpler than #229's since it only needs to catch one direction:tools/find-stale-generated-pages.py— walks each configured tree, diffs files on disk against the tree's nav file, and only ever treats agenerated: truepage as a delete candidate. Anything stale-looking without that marker is reported separately for manual review, never touched..github/workflows/stale-generated-pages.yml— runs the check in report-only mode on PRs touching these trees, failing the check and listing what it found.--deleteis available for local cleanup and is the natural hook for a future auto-commit step once the check has proven reliable in practice — a deliberate follow-up, not something wired into CI yet.contribute/automated-tests.mdx, and a maintainer-facing section intools/README.mdcovering the config-list extension point (add one tree = one line) and why thegenerated: trueguardrail matters.Real finding while establishing a clean baseline
en/database/tables/index-by-id.mdxisgenerated: trueand linked directly fromindex.mdx("table number"), but was missing fromconfig/nav-database-tables.json— a real, pre-existing nav omission, not stale content. Left alone, the new check would have failed on the very next unrelated PR touching that tree. Fixed by adding it to nav rather than ever letting it be a delete candidate — confirmed all three trees resolve to a clean 0-orphan baseline after the fix.Test plan
origin/maincheckout--deleteremoves it, reverted before commitgenerated: truefrontmatter → reported separately as "needs manual review,"--deletecorrectly leaves it alone, removed before commitmarkdownlint-cli2on the touched.mdxpage — 0 issuestools/verify-nav-paths.pyon all three nav files — all paths resolve (696/372/421)