Skip to content

feat(docs): auto-generate driftable documentation sections#739

Merged
BYK merged 3 commits intomainfrom
feat/auto-generate-docs
Apr 13, 2026
Merged

feat(docs): auto-generate driftable documentation sections#739
BYK merged 3 commits intomainfrom
feat/auto-generate-docs

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 13, 2026

Summary

Eliminates documentation drift by auto-generating content from source code. Replaces #724 with a structural fix instead of manual patching.

  • configuration.md: Env var reference now generated from src/lib/env-registry.ts using the existing fragment pattern. Adds 6 previously undocumented env vars.
  • contributing.md: Project structure tree generated from Stricli route tree via GENERATED:START/END markers (was listing 5 command dirs, now correctly shows 15+).
  • DEVELOPMENT.md & self-hosted.md: OAuth scopes generated from exported OAUTH_SCOPES array (fixes missing team:write).
  • README.md: Removed driftable commands table, replaced with pointer to docs site.

Why

PR #724 identified real documentation gaps (missing commands in README, missing team:write in OAuth scopes, 6 undocumented env vars, stale project structure). But manually fixing them leaves the same drift problem — the docs will go stale again next time someone adds a command, env var, or OAuth scope.

This PR instead makes the documentation self-updating:

Surface Source of Truth Generation
Env var reference src/lib/env-registry.ts Full-page (fragment pattern, gitignored)
Project structure Route tree introspection Marker injection in committed file
OAuth scopes OAUTH_SCOPES export from oauth.ts Marker injection in committed files
README commands Removed N/A (points to docs site)

New infrastructure

  • src/lib/env-registry.ts — Centralized env var metadata catalog (23 entries). Doc-generation data source only, no runtime changes.
  • script/generate-docs-sections.ts — Marker-based injection for committed files (GENERATED:START/END named markers). Supports --check for CI.
  • generate-command-docs.ts extended to also produce configuration.md from registry + fragment.
  • CI check:docs-sections validates markers aren't stale. Auto-commits regenerated files on non-fork PRs.

All generators run as part of bun run generate:docs (already in dev, build, typecheck, test chains).

Closes #724

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (cli) Add sentry cli defaults command for persistent settings by BYK in #721
  • (docs) Auto-generate driftable documentation sections by BYK in #739

Bug Fixes 🐛

Init

  • Treat no-op edits as passthrough instead of throwing by betegon in #731
  • Remove JSON minification that breaks edit-based codemods by betegon in #719

Resolve

  • Address review comments and add tests for fuzzy project recovery by BYK in #732
  • Fuzzy auto-recovery for project slug resolution by BYK in #728

Upgrade

  • Detect npm install method from node_modules path by BYK in #723
  • Add shell option on Windows for .cmd package managers by BYK in #722

Other

  • (dashboard) Remove overly restrictive dataset-display cross-validation by BYK in #720
  • (errors) Improve ContextError wording for auto-detect failures by BYK in #726
  • (issue) Support share issue URLs by BYK in #718
  • (issue-list) Auto-correct AND and reject OR in --query to prevent 400 by BYK in #727
  • (telemetry) Rename isClientApiError to isUserApiError and exclude 400 by BYK in #729
  • Bug fixes from Sentry error monitoring (CLI-FR, CLI-RN) + auth default by BYK in #740

Internal Changes 🔧

  • Regenerate skill files by github-actions[bot] in ca16b2ff

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

PR Preview Action v1.8.1

QR code for preview link

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

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

Codecov Results 📊

134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms

📊 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 1629 uncovered lines.
✅ Project coverage is 95.26%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    95.25%    95.26%    +0.01%
==========================================
  Files          234       234         —
  Lines        34385     34386        +1
  Branches         0         0         —
==========================================
+ Hits         32754     32757        +3
- Misses        1631      1629        -2
- Partials         0         0         —

Generated by Codecov Action

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 83c1b69. Configure here.

BYK added 3 commits April 13, 2026 21:18
Eliminate documentation drift by generating content from source code:

- configuration.md: env var reference generated from new centralized
  registry (src/lib/env-registry.ts) using the fragment pattern.
  Adds 6 previously undocumented env vars (SENTRY_FORCE_ENV_TOKEN,
  SENTRY_OUTPUT_FORMAT, SENTRY_MAX_PAGINATION_PAGES, SENTRY_INIT,
  SENTRY_CLI_NO_AUTO_REPAIR, FORCE_COLOR).

- contributing.md: project structure tree generated from Stricli
  route tree (was listing 5 command dirs, now correctly shows 15+).

- DEVELOPMENT.md & self-hosted.md: OAuth scopes generated from
  exported OAUTH_SCOPES array in oauth.ts (fixes missing team:write).

- README.md: remove driftable commands table, point to docs site.

New infrastructure:
- src/lib/env-registry.ts: centralized env var metadata catalog
- script/generate-docs-sections.ts: marker-based injection for
  committed files (GENERATED:START/END named markers)
- generate-command-docs.ts extended to produce configuration.md
- CI check:docs-sections validates markers aren't stale
Add a Persistent Defaults section and fix the resolution priority
cascade to include stored defaults as step 4 (between .sentryclirc
and DSN auto-detection), matching the actual code in resolve-target.ts.
@BYK BYK force-pushed the feat/auto-generate-docs branch from 83c1b69 to fb497e7 Compare April 13, 2026 21:18
@BYK BYK merged commit 1d4e068 into main Apr 13, 2026
26 checks passed
@BYK BYK deleted the feat/auto-generate-docs branch April 13, 2026 21:36
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