Skip to content

feat: API sidebar sync automation#367

Merged
steve-calvert-glean merged 4 commits intomainfrom
feature/api-sidebar-sync
Feb 27, 2026
Merged

feat: API sidebar sync automation#367
steve-calvert-glean merged 4 commits intomainfrom
feature/api-sidebar-sync

Conversation

@steve-calvert-glean
Copy link
Contributor

Summary

  • Adds scripts/sync-api-sidebar.mjs — AST-based (jscodeshift) script that validates and auto-fixes sidebars.ts against generated .api.mdx files, then runs prettier on the result
  • Adds pnpm sidebar:check (CI gate, exits 1 if any .api.mdx is missing from the sidebar) and pnpm sidebar:fix (inserts missing entries)
  • Hooks sidebar:fix into all three openapi:regenerate:* scripts so sidebar updates are atomic with API page regeneration
  • Adds a Check API sidebar completeness step to ci.yml before the build, preventing gaps from landing silently on main
  • Applies the script immediately to fix 5 entries that were already orphaned: authentication/checkdatasourceauth, governance/createfindingsexport, governance/deletefindingsexport, governance/downloadfindingsexport, governance/listfindingsexports

Test plan

  • pnpm sidebar:check exits 0 on this branch (sidebar is now complete)
  • pnpm sidebar:check exits 1 if a sidebar entry is manually removed
  • pnpm sidebar:fix re-inserts the entry with correct formatting
  • CI passes — the new Check API sidebar completeness step should be green
  • Verify the 5 newly visible pages render correctly in a local build

🤖 Generated with Claude Code

@steve-calvert-glean steve-calvert-glean requested a review from a team as a code owner February 27, 2026 18:59
@vercel
Copy link

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
glean-developer-site Ready Ready Preview, Comment Feb 27, 2026 7:23pm

Request Review

steve-calvert-glean and others added 3 commits February 27, 2026 11:09
Adds scripts/sync-api-sidebar.mjs which validates and auto-fixes
sidebars.ts against generated .api.mdx files using AST manipulation
(jscodeshift) and prettier for formatting.

- `pnpm sidebar:check` — exits 1 with a list of missing entries (CI gate)
- `pnpm sidebar:fix`   — inserts missing entries via AST, then runs prettier

Hooks sidebar:fix into all three openapi:regenerate:* scripts so that
sidebar updates are atomic with API page regeneration. Adds a
sidebar:check step to ci.yml before the build to prevent gaps from
landing silently on main.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Runs pnpm sidebar:fix to insert 5 entries that were present as
generated .api.mdx files but missing from sidebars.ts:

- api/client-api/authentication/checkdatasourceauth
- api/client-api/governance/createfindingsexport
- api/client-api/governance/deletefindingsexport
- api/client-api/governance/downloadfindingsexport
- api/client-api/governance/listfindingsexports

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@steve-calvert-glean steve-calvert-glean merged commit ee9c48f into main Feb 27, 2026
3 checks passed
@steve-calvert-glean steve-calvert-glean deleted the feature/api-sidebar-sync branch February 27, 2026 19:42
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.

2 participants