Skip to content

ci: Validate redirects belong to their config's site section#1094

Merged
louis-pre merged 2 commits into
mainfrom
ci/fix-cross-section-redirects
Apr 22, 2026
Merged

ci: Validate redirects belong to their config's site section#1094
louis-pre merged 2 commits into
mainfrom
ci/fix-cross-section-redirects

Conversation

@louis-pre

Copy link
Copy Markdown
Member

Summary

  • Updates the redirect validator to check that both source and target of each redirect belong to the same site section as the .gitbook.yaml they're defined in
  • Reports one error per redirect (most actionable: section mismatch over file-not-found)
  • Currently catches 171 cross-section redirects in the root .gitbook.yaml that silently 404 on the live site

Next step: move these redirects to the correct section's .gitbook.yaml (create docs/brand-guides/.gitbook.yaml, etc.)

Test plan

  • npm run typecheck passes
  • Validator correctly flags all 171 cross-section redirects
  • CI will fail until the redirects are moved — expected

🤖 Generated with Claude Code

@louis-pre louis-pre requested review from a team as code owners April 22, 2026 19:23
@louis-pre louis-pre force-pushed the ci/fix-cross-section-redirects branch 2 times, most recently from 535c7d2 to 04dce0b Compare April 22, 2026 19:53
louis-pre and others added 2 commits April 22, 2026 12:59
The root .gitbook.yaml is rooted at docs/guides/, so redirects with
sources or targets in other sections (api/, brand-guides/) can't work
as space-level redirects. The validator now checks each redirect
belongs to its config's section and suggests using site-level
redirects in the GitBook UI for cross-section cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move 60 brand-guides redirects to docs/brand-guides/.gitbook.yaml
with URL prefixes stripped. Remove 111 cross-section redirects that
were silently 404ing — imported as site-level redirects via GitBook UI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@louis-pre louis-pre force-pushed the ci/fix-cross-section-redirects branch from 04dce0b to 14d2814 Compare April 22, 2026 20:00
@louis-pre louis-pre merged commit aec6e09 into main Apr 22, 2026
12 checks passed
@louis-pre louis-pre deleted the ci/fix-cross-section-redirects branch April 22, 2026 20:04
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