Skip to content

Add advisory CI check for docs pages orphaned from sidebars.js - #5011

Draft
Duncanma wants to merge 1 commit into
mainfrom
duncan/check-orphan-pages
Draft

Add advisory CI check for docs pages orphaned from sidebars.js#5011
Duncanma wants to merge 1 commit into
mainfrom
duncan/check-orphan-pages

Conversation

@Duncanma

@Duncanma Duncanma commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

sidebars.js is hand-authored in this repo (no _category_.json autogeneration), so a moved or newly added docs page never gets wired into navigation automatically. This adds a check for that gap:

  • bin/check-orphan-pages.js — requires sidebars.js directly (rather than regex-scraping it) and walks every sidebar entry (documentation and tctl), then walks every .md/.mdx file under docs/ to find pages that will build and get a real URL but aren't reachable from any sidebar.
  • Automatic exemptions, no bookkeeping needed: leading-underscore partials (matches docusaurus.config.js's own docs.exclude), frontmatter draft: true (never builds in production), and frontmatter unlisted: true (Docusaurus's own mechanism for a page that renders without navigation — the right choice over draft for a page that must stay linkable from prose elsewhere).
  • bin/orphan-pages-baseline.json — tracked exceptions, same shape/convention as the existing bin/metrics-baseline.json. Regenerate with --update-baseline; stale entries (no longer orphaned) are flagged for removal.
  • Running it against the current tree found 14 real orphans, seeded into the baseline with specific notes rather than blank placeholders — including docs/cli/command-reference/cloud/project.mdx, added by the CLI-docs codegen bot in Update CLI docs for release v1.8.2 #5002 without a matching sidebar entry, and docs/develop/typescript/install-typescript-sdk.mdx, which has zero inbound links anywhere and looks like dead leftover from the 2023 SDK reorg.
  • .github/workflows/check-orphan-pages.yml — wired into CI as a warning only, not a merge gate. Posts a PR comment (marker-based create/update, same pattern as build-check.yml) plus ::warning:: file annotations. No step ever fails the job, so it can't block merging regardless of findings.
  • Replaces bin/audit-stray-pages, an old, unwired, buggy version of the same idea (it didn't combine a custom frontmatter id: with the file's directory, so it misflagged pages like cloud/rto-rpo.mdx). Updated UTILITIES.md and AGENTS.md accordingly.

Test plan

  • node --test bin/check-orphan-pages.test.js — 17 new unit tests, all passing
  • yarn test — full suite passes except one pre-existing, unrelated failure already on main (ReleaseNoteHeader featureName overrides explicit type when mapped)
  • yarn check:orphans — clean against the current tree with the seeded baseline
  • yarn build (via the pre-commit hook) — passes
  • Simulated a real finding locally (temporarily pulled a baseline entry) to confirm exit codes, JSON output, and the ::warning:: annotation format
  • Confirm the new workflow actually runs and posts/updates a PR comment on this PR
  • Triage each of the 14 baseline entries: add to sidebars.js, mark unlisted: true, or delete

Opening as a draft — parking this for a few days before moving it forward.

┆Attachments: EDU-6865 Add advisory CI check for docs pages orphaned from sidebars.js

sidebars.js is hand-authored here, so a moved or newly added page never gets
wired into navigation automatically. bin/check-orphan-pages.js walks every
sidebar entry and every docs/ file to find pages that will build and get a
real URL but aren't reachable from any sidebar, with automatic exemptions for
draft/unlisted frontmatter and a bin/orphan-pages-baseline.json for tracked
exceptions.

Running it against the current tree found 14 real orphans (seeded into the
baseline with notes), including a CLI command-reference page added by the
codegen bot in #5002 without a matching sidebar entry.

Wired into CI as a warning only (check-orphan-pages.yml): posts a PR comment
and file annotations, never fails the job. Replaces the old, unwired, buggy
bin/audit-stray-pages script that this supersedes.
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview Aug 1, 2026 12:06am

Request Review

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

This PR does not change any pages in /docs. If you make updates, links to the modified pages will appear here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant