Repository navigation
Conversation
…gated by repo variable)
…-to-patchling-app
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This redirects every page of gptdiff.255labs.xyz to the matching page under https://patchling.app/py/. It's off by default, behind a repository variable.
How gptdiff is served: GitHub Pages. The Deploy Documentation workflow runs
actions/deploy-pagesand writespublic/CNAME. GitHub Pages has no_redirectsor server-side redirects. So the deploy job now rewrites the built site into redirect stubs. No Cloudflare or DNS rule is needed.New
scripts/gptdiff_redirect_stubs.py public https://patchling.app/py/. It turns every built page into a stub with:<link rel="canonical">;<meta name="robots" content="noindex">;location.replace(target + location.search + location.hash), so#anchorssurvive.404.htmlmaps any other request in JS:index.html, go to the same path under/py/;/py/.Everything else is removed except
CNAME: assets, search index, sitemaps.documentation.yml: a new step after "Ensure CNAME is set", only ifvars.GPTDIFF_REDIRECT_TO_PATCHLING_APP == 'true'.The mkdocs source is untouched. patchling.app's build (site: serve patchling-py docs at /py/ and JS docs at /js/ on patchling.app patchling#13) clones this repo and still builds the real docs.
Merge order (don't redirect before /py is live)
bash scripts/build-site.sh, outputdist,PYTHON_VERSION=3.12), then merge. Check that https://patchling.app/py/ and https://patchling.app/py/cli/ load.255BITS/patchling-py→ Settings → Secrets and variables → Actions → Variables tab → New repository variable. NameGPTDIFF_REDIRECT_TO_PATCHLING_APP, valuetrue. Then Actions → Deploy Documentation → Run workflow onmain, or wait for the next push.#28 (deploy hook) is independent of this PR. Merge order doesn't matter between them.
Tests (local)
actionlint1.7.12 with shellcheck andyamllintondocumentation.yml: clean.pytest: 210 passed, 2 skipped, including 3 new tests intests/test_gptdiff_redirect_stubs.py:404.htmlknown list and fallback;CNAMEremain.mkdocs build --strictofmain(9555eb8) was converted to stubs pointing at a local build of patchling.app (dist/from Relevance filter: Ember review follow-ups #13). It was served by a server that behaves like GitHub Pages (404.htmlfor unknown paths,/dir→/dir/), and Chromium followed the redirects. All 10 cases landed on the right page:/→/py//cli,/cli/and/cli/index.html→/py/cli//cli/#environment-variables→/py/cli/#environment-variables/api/?q=1#smartapply→/py/api/#smartapply(mkdocs-material's search consumes?q=on arrival)/examples/basic→/py/examples/basic//quickstart/index.html#install→/py/quickstart/#install/no/such/page/→/py/Search engines see real 404s with a JS and meta redirect, and 200 stubs with
rel=canonicalplusnoindex. A true HTTP 301 would need a Cloudflare redirect rule on 255labs.xyz, if that zone is proxied; this PR changes nothing there.