check_redirects.py: flag redirects over unlisted pages and loops through wildcard destinations
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- documentation, testing
Research direction
Start with scripts/check_redirects.py and the existing cases in scripts/test_check_redirects.py. Check with mint dev whether a wildcard redirect source takes precedence over an existing page, then cover that behavior and add tests for detecting loops through wildcard destinations. Done when redirects from unlisted on-disk pages are checked and wildcard loops are caught without flagging the intended section-rename chains.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- MDX
- Stars
- 89
- Forks
- 396
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 17
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from celo-org/docs
-
Add BlockVectra to the Celo mainnet RPC providers listPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
chore priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
celo-org/docs#2362 · 1 comment ·
Maintainers usually reply within 1 day
-
chore priority:medium
Difficulty 2/5 Half a day Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 4/5 3-5 days Newbie friendliness 20/100
Maintainers usually reply within 1 day
Similar issues
-
priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
storytold/photocraft#15350 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
docker documentation
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
VincenzoImp/openings-job-search#463 ·
Maintainers usually reply within 1 day
-
source:reader type:content-error
Difficulty 1/5 Under an hour Newbie friendliness 82/100
stephrobert/blog-roadmap#193 ·
-
Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
pandas-dev/pandas#72163 ·
Maintainers usually reply within 2 days