Skip to content

docs: fix stale Bun references and add systemic doc drift checks#1024

Open
BYK wants to merge 1 commit into
mainfrom
docs/fix-stale-refs-systemic-checks
Open

docs: fix stale Bun references and add systemic doc drift checks#1024
BYK wants to merge 1 commit into
mainfrom
docs/fix-stale-refs-systemic-checks

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented May 25, 2026

Summary

Fix the Bun→Node migration documentation drift with systemic improvements that prevent this class of error from recurring.

Supersedes #1022 — that PR found real issues but missed several stale references and lacked systemic prevention.

Changes

1. Fix generate-docs-sections.ts root cause

  • Replace extractBunVersion() with extractPnpmVersion() derived from packageManager field
  • Make both version extractors throw on mismatch instead of silently falling back — this is the core systemic fix that prevents the generator from ever silently producing wrong output again
  • Update all prerequisite generators to reference Node.js + pnpm
  • Remove "or Bun" from library-usage prerequisite

2. Expand generated marker coverage

Convert hand-written toolchain-dependent prose into generated sections so it can't drift:

  • DEVELOPMENT.md prerequisites → GENERATED:START/END dev-prereq markers
  • DEVELOPMENT.md build section → GENERATED:START/END build-toolchain markers
  • contributing.md build section → GENERATED:START/END build-commands markers

Also fix remaining stale refs in: library-usage.md, plugins/README.md, check-no-deps.ts

3. Add generic check:stale-refs toolchain consistency check

New script/check-stale-references.ts that derives stale patterns from package.json — not hardcoded to Bun:

  • Reads packageManager field to determine the current PM (pnpm)
  • Flags all other PMs' dev commands (bun run, yarn remove, etc.) in dev-facing docs
  • If the project ever migrates from pnpm to something else, changing packageManager automatically makes the check flag every pnpm run / pnpm add reference
  • Added to CI lint job

4. Enhance check:fragments with subcommand coverage validation

The existing check only verified fragment files exist — not that they document all subcommands. New Check 5:

  • Verifies each fragment mentions all subcommands in the route (via heading or code reference)
  • Handles default commands (sentry local = sentry local serve)
  • Strips fenced code blocks to avoid false heading matches from bash comments
  • Warns by default, --strict flag for hard errors

5. Fill subcommand coverage gaps

  • dashboard.md: add revisions, restore examples
  • cli.md: add defaults, import examples
  • issue.md: add events subcommand and @latest/@most_frequent selectors

Verification

All checks pass:

  • check:fragments — all subcommands covered
  • check:stale-refs — no stale PM references (23 files scanned)
  • check:docs-sections — all generated sections up to date
  • check:deps — error message fixed
  • typecheck — clean
  • test:unit — 314 files, 7227 tests pass

Fix the Bun→Node migration documentation drift with three systemic improvements:

1. Fix generate-docs-sections.ts root cause
   - Replace extractBunVersion() with extractPnpmVersion() derived from packageManager
   - Make both version extractors throw on mismatch instead of silent fallback
   - Update all prerequisite generators to reference Node.js + pnpm
   - Remove 'or Bun' from library-usage prerequisite

2. Expand generated marker coverage
   - Wrap DEVELOPMENT.md prerequisites in GENERATED:START/END dev-prereq markers
   - Wrap DEVELOPMENT.md build section in GENERATED:START/END build-toolchain markers
   - Wrap contributing.md build section in GENERATED:START/END build-commands markers
   - Fix remaining stale refs: library-usage.md, plugins/README.md, check-no-deps.ts

3. Add generic check:stale-refs toolchain consistency check
   - New script/check-stale-references.ts derives stale patterns from package.json
   - Reads packageManager field to determine current PM, flags all others
   - If project migrates from pnpm to yarn, check auto-flags pnpm references
   - Added to CI lint job

4. Enhance check:fragments with subcommand coverage validation
   - Check 5: verify fragments mention all subcommands in a route
   - Handles default commands (sentry local = sentry local serve)
   - Strips code blocks to avoid false heading matches
   - Warns by default, --strict flag for hard errors

5. Fill subcommand coverage gaps in fragments
   - dashboard.md: add revisions, restore examples
   - cli.md: add defaults, import examples
   - issue.md: add events subcommand and @latest/@most_frequent selectors

Supersedes PR #1022 which found real issues but missed several stale
references and lacked systemic prevention.
@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1024/

Built to branch gh-pages at 2026-05-25 22:04 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 64ea954. Configure here.

Comment thread script/check-fragments.ts

// Check 2: For default commands, `sentry <route>` (without subcommand) counts
if (isDefaultCommand && lower.includes(`sentry ${routeName}`.toLowerCase())) {
return true;
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.

Default subcommand check too broad

Low Severity

Check 5 treats the default subcommand as documented when the fragment contains any substring sentry &lt;route&gt;, including longer invocations like sentry issue events. That makes default coverage pass whenever any sibling subcommand is documented, so missing default-subcommand docs may never warn.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 64ea954. Configure 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