docs: publish redirects to commit-check.com ahead of archiving - #14
Conversation
The site moved to commit-check.com, but this domain still serves a full copy of the old one. Archiving alone would not change that: it makes the repository read-only and stops Actions, and does not unpublish Pages — whatever was deployed last keeps being served. Archiving as the first step would freeze a duplicate of the pre-v2.13.0 documentation online permanently, competing with the real site and showing rule names the tool no longer prints. So the redirects go up first, and the archive switch is flipped afterwards. There is no second chance: Actions do not run on an archived repository. Replaces the mkdocs build with scripts/build_redirects.py, which emits one stub per URL the old site served. The map came from that site's own build output rather than from reading the config, and all but one entry is the same path — the pages, the blog and its archive, author and category indexes carried over unchanged, and the posts kept their filenames and created dates, so the slugs match exactly. /projects/ is the exception, folded into the Ecosystem section of the new landing page. GitHub Pages has no redirect table, so each stub is a rel=canonical plus a meta refresh, and the script carries the fragment across so deep links keep their place. A 404.html catches anything the map missed. tests/ checks the map against a real mkdocs build in both directions, and CI runs it before the deploy: a URL served with no redirect is a link that breaks for good, and a redirect for a URL that was never served means the map drifted. The docs/ directory stays as the historical source. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
✅ Deploy Preview for commit-check-github-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Review limit reached
Next review available in: 54 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe repository now generates static redirect stubs, validates redirect coverage against the MkDocs site, deploys the generated redirects through GitHub Actions, and documents the repository’s archived status and redirect mappings. ChangesRedirect deployment
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant RedirectTests
participant MkDocs
participant BuildRedirects
participant GitHubPages
GitHubActions->>RedirectTests: run redirect coverage tests
RedirectTests->>MkDocs: build site and collect URLs
RedirectTests->>RedirectTests: compare URLs with REDIRECTS
GitHubActions->>BuildRedirects: generate redirect stubs
BuildRedirects-->>GitHubActions: return site artifact
GitHubActions->>GitHubPages: deploy redirect artifact
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The PR that switched the GitHub Pages deploy to redirects missed that this repository is built by a Netlify project as well. That project has no config in the repository, so its build command lives in Netlify's web UI, where a change to .github/workflows/deploy.yml cannot reach it — it would have gone on building and publishing the old mkdocs site regardless. Two consequences, one of them visible right now: the deploy preview on this pull request is the old site, which makes the redirects look broken to anyone who clicks it, and any production deployment of that project is a third live copy of the old site that neither the Pages redirects nor archiving would touch. Adds a netlify.toml so the build is defined in version control. It runs the same redirect builder, and declares real 301s — Netlify can serve those, unlike Pages — with the /projects/ rule ahead of the catch-all, since Netlify takes the first match and that is the one page that did not survive as its own URL. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/build_redirects.py`:
- Around line 64-67: Remove the robots meta directive containing “noindex” from
the redirect HTML TEMPLATE, while preserving the canonical link, meta refresh,
and JavaScript location.replace redirect behavior.
In `@tests/redirects_test.py`:
- Around line 38-39: Update the MkDocs build failure handling in the redirect
deployment test to fail the test instead of calling pytest.skip when
result.returncode is nonzero. Preserve the existing stderr details in the
failure message so the deployment gate blocks when the legacy-site build cannot
complete.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2933a817-203b-4c97-8004-dff1bc6d4c68
📒 Files selected for processing (4)
.github/workflows/deploy.ymlREADME.mdscripts/build_redirects.pytests/redirects_test.py
…nical Both from CodeRabbit's review, both real. The coverage check called pytest.skip when the mkdocs build failed. A skip exits pytest 0, so the workflow would have read it as a pass and deployed redirects that had never been compared against the site they replace — on the one deploy that cannot be redone afterwards. The skip bought a quieter local run without mkdocs installed and paid for it with the entire point of the check. It fails now; verified by moving mkdocs.yml aside, which turns both tests red instead of green. The stubs also carried robots: noindex, which contradicts the rel=canonical sitting two lines above it — one asks a crawler to consolidate the page onto the new URL, the other asks it to drop the page, and the second can stop the first from being acted on or carry across to the target. The comment in this file claimed the canonical was what moved search ranking while the markup was undermining it. Removed, with a note on why it is not an oversight. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
|
Both review findings accepted and fixed in 6e891ff.
One thing this review did not cover: the rate limit hit before Generated by Claude Code |
Step 1 of retiring this repository. Merge and verify this before flipping the archive switch — see below for why the order is not interchangeable.
The problem with archiving first
Archiving makes a repository read-only and stops its Actions, but it does not unpublish its GitHub Pages site. Whatever was deployed last keeps being served indefinitely.
So archiving as the first step would leave a complete copy of the old site live at
commit-check.github.ioforever — competing with commit-check.com in search results, and serving pre-v2.13.0 content including rule names the tool no longer prints (subject_imperativerather thansubject-imperative). And because Actions do not run on an archived repository, there would be no way to fix it without unarchiving.Hence: redirects first, archive second.
What this does
Replaces the mkdocs build with
scripts/build_redirects.py, which emits one redirect stub per URL the old site served.The map was taken from that site's own build output, not from reading the config. All but one entry is the same path — the pages, the blog and its archive, author and category indexes carried over unchanged, and the posts kept their filenames and
createddates, so the generated slugs match byte for byte:/commit-check.com//getting-started/commit-check.com/getting-started//blog/,/blog/archive/2026/,/blog/author/team/,/blog/category/{announcements,updates}//projects/commit-check.com/— folded into the Ecosystem section of the new landing pageGitHub Pages has no server-side redirect table, so each stub is a
rel=canonicalplus a<meta refresh>. The canonical is what transfers search ranking; the script carrieslocation.hashacross so deep links keep their place, and useslocation.replaceso the stub does not trap a reader in the back button. A404.htmlcatches anything the map missed.The guard
tests/redirects_test.pybuilds the old mkdocs site and compares its URLs against the map in both directions:CI runs it before the deploy step. Verified by deleting one entry: the test names the missing URL and fails.
This matters more than a usual test because the deploy is one-shot. After archiving, the artifact from the last successful run is what Pages serves for good.
What is kept
docs/stays exactly as it is — this repository remains the historical source of the old site, it just no longer publishes it.mkdocsis still a CI dependency because the guard needs it to build the site it is checking against.The README now leads with the migration notice and points at commit-check/commit-check.com. Worth noting the README cannot be edited after archiving, which is why the notice ships in this PR rather than later.
After merging
/projects/and one blog post are the interesting ones).Generated by Claude Code
Summary by CodeRabbit