Skip to content

feat(docs): auto-generate driftable doc sections (supersedes #851)#873

Merged
BYK merged 2 commits intomainfrom
feat/auto-generate-docs-v2
Apr 29, 2026
Merged

feat(docs): auto-generate driftable doc sections (supersedes #851)#873
BYK merged 2 commits intomainfrom
feat/auto-generate-docs-v2

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 29, 2026

Summary

Extend generate-docs-sections.ts with 7 new marker-based sections that eliminate documentation drift by auto-generating content from source code. Also adds missing SENTRY_RELEASE to the env var registry and hand-written examples for release delete/deploys and event list.

Supersedes #851 with structural automation instead of manual patching (same relationship as #739#724).

What's auto-generated now

Section File Source of Truth
Dev prerequisites README.md, contributing.md packageManager in package.json
Library prerequisites README.md engines.node in package.json
Dev scripts README.md Curated subset (descriptions aren't machine-readable)
Dev env var table DEVELOPMENT.md env-registry.ts entries with devGuide tag
Self-hosted env var table self-hosted.md env-registry.ts entries with selfHosted tag
Platform support getting-started.mdx Static data matching ALL_TARGETS in build.ts
(existing) Project structure contributing.md Route tree introspection
(existing) OAuth scopes DEVELOPMENT.md, self-hosted.md OAUTH_SCOPES array

What was wrong with #851

  1. SENTRY_CUSTOM_HEADERS format was documented as comma-separated key:value — the actual code (src/lib/custom-headers.ts) uses semicolon-separated Name: Value pairs. Would have shipped incorrect docs.
  2. Manual fixes to driftable content — version numbers, env var tables, and platform support will go stale again. This PR generates them from source code instead.
  3. Committed DOCUMENTATION_AUDIT.md at repo root — a 162-line audit report that becomes stale immediately.
  4. Manually edited skill files — these are auto-generated from fragments; editing them directly means the next generate:docs overwrites the manual changes.

Changes

Source-of-truth additions

  • SENTRY_RELEASE added to env-registry.ts (flows into auto-generated configuration.md)
  • selfHosted and devGuide tags added to EnvVarEntry type and relevant entries

Generator extensions (script/generate-docs-sections.ts)

  • MDX marker support ({/* GENERATED:START */} syntax for .mdx files)
  • dev-prereq: Bun version from packageManager field
  • library-prereq: Node version from engines.node
  • dev-scripts: Curated script list with descriptions
  • dev-env-vars: Table from registry entries tagged devGuide
  • self-hosted-env-vars: Table from entries tagged selfHosted, with cross-validation
  • platform-support: Platform/architecture table

Fragment additions (hand-written, as designed)

  • release.md: Examples for release delete (with --yes, --dry-run) and release deploys
  • event.md: Full "Listing Events" section with query, full, period, pagination, JSON examples

CI

  • README.md and getting-started.mdx added to check-generated git-diff and auto-commit lists

Extend generate-docs-sections.ts with 7 new marker-based sections that
eliminate documentation drift by generating content from source code:

- README.md: dev prerequisites (Bun version from packageManager),
  library prerequisites (Node version from engines.node), dev scripts
- contributing.md: dev prerequisites
- DEVELOPMENT.md: env var table (from env-registry.ts devGuide tags)
- self-hosted.md: env var table (from env-registry.ts selfHosted tags)
- getting-started.mdx: platform support table (MDX marker syntax)

Source-of-truth additions:
- Add SENTRY_RELEASE to env-registry.ts (used by propose-version
  but missing from auto-generated configuration.md)
- Add selfHosted/devGuide tags to env-registry entries for table
  generation

Content additions (hand-written fragments, the correct mechanism):
- release.md: bash examples for release delete and release deploys
- event.md: full event list examples section

CI: add README.md and getting-started.mdx to the check-generated
git-diff and auto-commit lists.

Supersedes #851 (manual fixes) with structural automation.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

PR Preview Action v1.8.1

QR code for preview link

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

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Codecov Results 📊

6289 passed | Total: 6289 | Pass Rate: 100% | Execution Time: 1ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 13051 uncovered lines.
✅ Project coverage is 75.99%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    75.94%    75.99%    +0.05%
==========================================
  Files          294       294         —
  Lines        54371     54363        -8
  Branches         0         0         —
==========================================
+ Hits         41289     41312       +23
- Misses       13082     13051       -31
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK merged commit d46f5db into main Apr 29, 2026
26 checks passed
@BYK BYK deleted the feat/auto-generate-docs-v2 branch April 29, 2026 04:28
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