feat(docs): auto-generate driftable documentation sections#739
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Init
Resolve
Upgrade
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
419b5bb to
d7f783a
Compare
|
Codecov Results 📊✅ 134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1629 uncovered lines. 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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
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.
83c1b69 to
fb497e7
Compare

Summary
Eliminates documentation drift by auto-generating content from source code. Replaces #724 with a structural fix instead of manual patching.
src/lib/env-registry.tsusing the existing fragment pattern. Adds 6 previously undocumented env vars.GENERATED:START/ENDmarkers (was listing 5 command dirs, now correctly shows 15+).OAUTH_SCOPESarray (fixes missingteam:write).Why
PR #724 identified real documentation gaps (missing commands in README, missing
team:writein 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:
src/lib/env-registry.tsOAUTH_SCOPESexport fromoauth.tsNew 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/ENDnamed markers). Supports--checkfor CI.generate-command-docs.tsextended to also produceconfiguration.mdfrom registry + fragment.check:docs-sectionsvalidates markers aren't stale. Auto-commits regenerated files on non-fork PRs.All generators run as part of
bun run generate:docs(already indev,build,typecheck,testchains).Closes #724