Skip to content

ci: fail when a changelog entry is not registered everywhere - #488

Open
lee-reinhardt wants to merge 1 commit into
mainfrom
lee-des-320
Open

ci: fail when a changelog entry is not registered everywhere#488
lee-reinhardt wants to merge 1 commit into
mainfrom
lee-des-320

Conversation

@lee-reinhardt

Copy link
Copy Markdown
Member

Description

Publishing a changelog entry means registering it in 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.

Place Cost of skipping it
src/docs-changelog/<month>/<entry>.md the content itself
changelogEntries.js — the import nothing renders it
changelogEntries.jsrawEntries 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, 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.sh asserts all four, in both directions (a
file missing from a registry, and a registry entry with no file behind it). It runs
from checks.sh before npm ci — it needs nothing installed, so a missing
registration 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 rawEntries member,
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.mdx and latest.mdx are exempt and are correctly not flagged.

Checklist

  • I have read the Contributing guidelines.
  • I have the right to submit this contribution, and I agree it is licensed to
    Peridio, Inc. as described in the Contributing guidelines.
  • This contribution contains no third-party personal data and nothing
    defamatory, infringing, or unlawful.
  • I ran the project checks (bash scripts/checks.sh) and they pass.

On the last box: the new check, npm ci, the Connect API drift check, lint and
prettier --check all pass locally. npm run build fails on my machine, but it
fails identically on an unmodified origin/main checkout, so it is not from this
change. The cause is the js-yaml: 4.3.1 override in src/package.json being
applied to gray-matter's nested js-yaml@^3.13.1, whose safeLoad was removed
in 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.

Copilot AI lite review requested due to automatic review settings August 20, 2026 23:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh to cross-check changelog files vs. changelogEntries.js imports/rawEntries and sidebars-changelog.js IDs (including orphan detection).
  • Runs the new check early in scripts/checks.sh (before npm 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.

Comment thread scripts/check-changelog-registration.sh Outdated
Comment thread scripts/check-changelog-registration.sh
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.
Copilot AI review requested due to automatic review settings August 21, 2026 00:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/ and docs-changelog/ when describing where index.mdx / latest.mdx live. Since the actual repo path is src/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 .mdx entries. Tweaking this message to mention .mdx too would make failures clearer for .mdx changelog files.
  echo "  $CONTENT_DIR/<month>/<entry>.md" >&2

scripts/check-changelog-registration.sh:13

  • The script supports both .md and .mdx entries (see the find/sed patterns), but this list item documents the content path as <entry>.md only. Consider updating it to mention .mdx as 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 .mdx as 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 |

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.

2 participants