Skip to content

scripts(changelog): single-source changelog nav rendering#74

Merged
samgutentag merged 6 commits into
mainfrom
sam-gutentag/changelog-autogen
May 26, 2026
Merged

scripts(changelog): single-source changelog nav rendering#74
samgutentag merged 6 commits into
mainfrom
sam-gutentag/changelog-autogen

Conversation

@samgutentag
Copy link
Copy Markdown
Member

Summary

How it works

The single source of truth is the frontmatter of each changelog/*.mdx entry:

---
title: "Product: Title"
description: "One-sentence summary"
date: 2026-05-26
category: Merge Queue
type: new-feature
---

The script reads every changelog/*.mdx, groups by year/month and product, and rewrites:

  1. docs.json — surgically replaces the Changelog tab's year-group pages arrays. Newest first.
  2. changelog/index.mdx — master index with the tag-filter UI. One <Update> block per entry, grouped by ## YYYY and ### Month YYYY.
  3. merge-queue/changelog.mdx — same shape, filtered to category: Merge Queue.
  4. flaky-tests/changelog.mdx — same, filtered to category: Flaky Tests.

Other categories (Code Quality, CI Autopilot, Web App) still appear in docs.json and the master index, but have no product-page index per current convention.

Usage

python3 scripts/sync-changelog.py            # apply changes in place
python3 scripts/sync-changelog.py --check    # CI mode; exit 1 on drift

Idempotent — running twice produces no changes. Run after adding or editing any changelog/*.mdx entry.

Workflow going forward

Adding a new changelog entry becomes a 2-step process instead of 4:

  1. Create changelog/YYYY-MM-DD-<slug>.mdx with the canonical frontmatter shape.
  2. Run python3 scripts/sync-changelog.py.
  3. Commit both the new entry and the 4 regenerated nav files.

Same flow works for edits — touch the entry's frontmatter, re-run the script.

Follow-ups (not in this PR)

  • CI check: a workflow that runs --check on every PR touching changelog/ and fails on drift. Catches contributors who forget to run the script.
  • Cloud-routine integration: extend daily-devrel-scanner and deploy-watcher to run the script after drafting a changelog entry, so the routine's PR ships fully-wired.

Test plan

  • Mintlify preview deploys
  • Visit /changelog, /merge-queue/changelog, /flaky-tests/changelog and confirm rendering is identical to current production
  • Sidebar (Changelog tab) shows the same 154 entries in same order modulo same-day alphabetical ordering
  • python3 scripts/sync-changelog.py --check exits 0 after merge

🤖 Generated with Claude Code

…ring

Adds `scripts/sync-changelog.py`, which regenerates the four sites the
changelog lives on from a single source of truth: the frontmatter of
each `changelog/*.mdx` entry. Removes the manual-maintenance burden
that came up in PR #36/#37/#39 review (each changelog PR previously
had to update docs.json + master index + product-page index in
addition to the entry file).

The script targets:
- docs.json — Changelog tab year-group `pages` arrays (surgical replace)
- changelog/index.mdx — master index with tag-filter UI
- merge-queue/changelog.mdx — entries where category = "Merge Queue"
- flaky-tests/changelog.mdx — entries where category = "Flaky Tests"

Other categories (Code Quality, CI Autopilot, Web App) appear in the
master index but have no product-page index per current convention.

Usage:
  python3 scripts/sync-changelog.py            apply
  python3 scripts/sync-changelog.py --check    CI mode; exits 1 on drift

Also commits a normalization pass on the 4 target files: same-day
entries are now sorted alphabetically by slug (was somewhat random),
and one stray blank line after frontmatter is dropped. No content
changes — all 154 entries preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented May 26, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
trunk 🟢 Ready View Preview May 26, 2026, 9:35 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

samgutentag and others added 2 commits May 26, 2026 15:21
- changelog-check.yml: runs `sync-changelog.py --check` on PRs touching
  changelog files. Fails if the nav files are out of sync with entries.
- changelog-sync.yml: runs on push to main. If a changelog entry landed
  without the nav files being regenerated, the action auto-commits the fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deliberately skipping `sync-changelog.py` so the changelog-check
workflow should fail, proving it catches nav drift.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
samgutentag and others added 2 commits May 26, 2026 15:36
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Explains the sync script workflow and the two CI checks
so contributors know how to add entries correctly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant