ci: fail when a changelog entry is not registered everywhere - #488
ci: fail when a changelog entry is not registered everywhere#488lee-reinhardt wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a fast, dependency-free CI guard to ensure every changelog entry file is fully registered (imported, included in rawEntries, and present in the changelog sidebar), preventing “silent success” cases where entries build but don’t appear in reader-facing navigation/feed.
Changes:
- Introduces
scripts/check-changelog-registration.shto cross-check changelog files vs.changelogEntries.jsimports/rawEntriesandsidebars-changelog.jsIDs (including orphan detection). - Runs the new check early in
scripts/checks.sh(beforenpm ci) for fast feedback. - Documents the new check in
scripts/README.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/README.md | Documents the new changelog registration check and its rationale/usage. |
| scripts/checks.sh | Executes the new changelog registration check before dependency installation. |
| scripts/check-changelog-registration.sh | New script that validates changelog entry registration across content, feed, and sidebar. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
publishing an entry means touching four places. a missing file or import breaks the build, but a missing rawEntries member or sidebar id still builds, still serves the page and still passes lint — the entry just never appears where readers look for it: src/docs-changelog/<month>/<entry>.md the content changelogEntries.js, the import nothing renders it changelogEntries.js, rawEntries absent from the /changelog feed sidebars-changelog.js unreachable from the nav rawEntries is the quietest of the four: an import with no member is an unused import, so nothing fails and the entry is simply invisible. the check runs before npm ci, needs no dependencies, and covers the reverse direction too — a registry entry with no file behind it. it fails if its own parsing matches nothing, so a later change to the file layout cannot turn it into a no-op that reports success forever. line comments are ignored; block comments are not — it is text matching, not a js parser.
559fdcf to
6f95884
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (4)
scripts/README.md:84
- This section alternates between
src/docs-changelog/anddocs-changelog/when describing whereindex.mdx/latest.mdxlive. Since the actual repo path issrc/docs-changelog/, consider using that consistently here to avoid ambiguity when someone tries to locate the files.
`index.mdx` and `latest.mdx` are exempt: they live under `docs-changelog/`
without being entries. Registrations disabled with a `/* ... */` block comment
still read as active — the guard is text matching, not a JS parser.
scripts/check-changelog-registration.sh:133
- The final error summary prints the content path as
<entry>.md, but the check also includes.mdxentries. Tweaking this message to mention.mdxtoo would make failures clearer for.mdxchangelog files.
echo " $CONTENT_DIR/<month>/<entry>.md" >&2
scripts/check-changelog-registration.sh:13
- The script supports both
.mdand.mdxentries (see thefind/sedpatterns), but this list item documents the content path as<entry>.mdonly. Consider updating it to mention.mdxas well (e.g.,.md(x)) to avoid confusion when an entry file is.mdx.
This issue also appears on line 133 of the same file.
# 1. src/docs-changelog/<month>/<entry>.md the content itself
scripts/README.md:69
- This table row documents changelog entry files as
<entry>.md, but entries can be.mdxas well (and the checker explicitly matches both). Consider updating the wording to.md/.mdx(or.md(x)) so the docs match the actual supported extensions.
This issue also appears on line 82 of the same file.
| `src/docs-changelog/<month>/<entry>.md` | the content itself |
Description
Publishing a changelog entry means registering it in four places. A missing file
or import breaks the build, but a missing
rawEntriesmember or sidebar id stillbuilds, still serves the page and still passes lint — the entry just never appears
where readers look for it.
src/docs-changelog/<month>/<entry>.mdchangelogEntries.js— theimportchangelogEntries.js—rawEntries/changelogfeedsidebars-changelog.jsrawEntriesis the quietest of the four: an import with no member is an unusedimport, which is not an error, so every check passes and the entry is simply
invisible. That silent-success mode is the whole reason for the check.
scripts/check-changelog-registration.shasserts all four, in both directions (afile missing from a registry, and a registry entry with no file behind it). It runs
from
checks.shbeforenpm ci— it needs nothing installed, so a missingregistration fails in seconds rather than after a full build.
It also fails if its own parsing matches nothing, so a later change to the file
layout cannot quietly turn it into a no-op that reports success forever. Line
comments are ignored; block comments are not, since this is text matching rather
than a JS parser.
All four registries were already consistent (50 entries), so this is purely
additive with no backlog to clean up. Every failure path was verified by mutating
a fixture and reverting: unregistered entry, import with no
rawEntriesmember,missing sidebar id, sidebar id pointing at a deleted file, an import of a deleted
file, a commented-out registration, and a sidebar layout change that defeats the
id parser.
index.mdxandlatest.mdxare exempt and are correctly not flagged.Checklist
Peridio, Inc. as described in the Contributing guidelines.
defamatory, infringing, or unlawful.
bash scripts/checks.sh) and they pass.On the last box: the new check,
npm ci, the Connect API drift check,lintandprettier --checkall pass locally.npm run buildfails on my machine, but itfails identically on an unmodified
origin/maincheckout, so it is not from thischange. The cause is the
js-yaml: 4.3.1override insrc/package.jsonbeingapplied to
gray-matter's nestedjs-yaml@^3.13.1, whosesafeLoadwas removedin v4. npm 11 collapses the two (1529 packages); the npm 10 that ships with the
pinned Node 20.19.0 keeps them separate (1530 packages), which is why CI is green.
Worth fixing separately — as it stands, the docs do not build for a contributor on
npm 11.