You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
check_redirects.py: flag redirects over unlisted pages and loops through wildcard destinations #2380
Two gaps in scripts/check_redirects.py came up in the review of #2369. Neither shows up in docs.json today.
A redirect whose source is a real page on disk is dead: Mintlify serves the page and the redirect never fires (checked with mint dev in the #2369 review). The check only catches this when the page is in navigation. A page that exists on disk but isn't in navigation, such as hidden.mdx with a redirect from /hidden, passes. The fix is to test whether the page exists for each source as well as navigation. Wildcard sources need some thought: does /a/:slug* over an existing /a/b.mdx fire, or does the page win? That needs checking against mint dev first.
The check deliberately doesn't follow chains through wildcard destinations, because section renames rely on them (/build-on-celo/:slug* → /build/:slug* → newer exact entries). As a result, /p/:slug* → /q/:slug* together with /q/:slug* → /p/:slug* loops and passes. A walk of at most five hops that fails on a repeated source would catch loops without flagging the chains we want.
Both need unit tests in scripts/test_check_redirects.py alongside the existing cases.
One more case from the latest #2369 review: a wildcard that redirects to itself, /p/:slug* to /p/:slug*, also passes the check today. It is the cheapest loop to catch, since it needs no walk at all, just a source equal to its destination. It belongs with the loop check above and needs its own unit test.
Activity
palango commentedon Oct 7, 2026
One more case from the latest #2369 review: a wildcard that redirects to itself,
/p/:slug*to/p/:slug*, also passes the check today. It is the cheapest loop to catch, since it needs no walk at all, just a source equal to its destination. It belongs with the loop check above and needs its own unit test.