Skip to content

ci: redirect check accepts deletions whose route is still served - #825

Merged
khushalsonawat merged 1 commit into
devfrom
ci/redirect-check-live-routes
Aug 18, 2026
Merged

ci: redirect check accepts deletions whose route is still served#825
khushalsonawat merged 1 commit into
devfrom
ci/redirect-check-live-routes

Conversation

@khushalsonawat

Copy link
Copy Markdown
Contributor

What

Teaches scripts/check-deleted-pages.mjs to skip a deleted page when its URL is still served by another page file (.mdx/.astro/.md sibling or index variant). Genuinely dead routes still require a redirect and still fail the check.

Why

#822 correctly deletes admin-settings.mdx to resolve a duplicate-route collision: admin-settings/index.mdx keeps serving /docs/admin-settings, so no redirect is possible or needed. The check failed it anyway, and would fail every future dedupe deletion the same way.

What cases were covered

  • Reproduced fix: remove duplicate admin-settings route #822's scenario locally (temp commit deleting admin-settings.mdx): script passes with "still served by another page file, no redirect needed" and exit 0
  • A made-up dead route still returns false from the new check, so missing redirects keep failing
  • No-deletion branches keep their early exit

How

One routeStillServed() helper checking the six page-file variants that could own the URL, consulted before the redirect lookup.

Recording

Not applicable: CI-only change. Proof is #822 going green after Update branch once this merges.

🤖 Generated with Claude Code

check-deleted-pages demanded a redirect for every deleted .mdx, even
when the URL keeps resolving (deleting foo.mdx while foo/index.mdx
exists). Such deletions are dedupes, not dead routes; skip them with
a note instead of failing

Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
@khushalsonawat khushalsonawat self-assigned this Aug 18, 2026
@khushalsonawat
khushalsonawat merged commit 6db2540 into dev Aug 18, 2026
1 check passed
@khushalsonawat
khushalsonawat deleted the ci/redirect-check-live-routes branch August 18, 2026 04:58
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