Add redirect link system and scope Pages publishing to its own job - #179
Open
flufflycthu1u wants to merge 1 commit into
Open
flufflycthu1u wants to merge 1 commit into
flufflycthu1u wants to merge 1 commit into
Conversation
Posts now link to cutepetsboston.com/r/?id=<slug> rather than straight to the shelter listing, so click-through can be attributed per pet (RFC 0001). The slug -> adoption URL mapping is append-only and lives on the gh-pages branch; docs/r/index.html resolves it client-side and falls back to the homepage when a slug is unknown or the fetch fails. Pages publishing moves into a reusable workflow, publish-pages.yml, called by both prod.yml and deploy-pages.yml: - prod.yml splits into two jobs so the job that posts pets runs with a read-only token; only the publish job holds contents/pages/id-token write. A composite action could not do this, as it inherits the calling job's token. - Both callers share the pages-publish concurrency group, so a docs push and the 4-hourly cron can no longer deploy Pages at the same time. - The mapping is merged rather than copied (jq -s '.[0] * .[1]' with gh-pages winning conflicts), so a failed fetch can no longer wipe existing redirects. - The deploy job declares environment: github-pages, which actions/deploy-pages requires and prod.yml previously lacked. Fixes in redirects.py and the interstitial: - a corrupt mapping no longer blocks posting; it logs and posts the raw URL, leaving the damaged file untouched rather than silently rebuilding it - slugs are injective, so two distinct pet ids can no longer collapse onto one slug and point a post at the wrong pet's listing - load_redirects/save_redirects resolve the default path at call time rather than binding it at import - only http(s) targets are followed or recorded, so a javascript: URL coming from the RescueGroups API cannot execute on our own origin - redirects.json is gitignored; the gh-pages commit therefore uses git add -f docs/specs/redirect-pipeline.md diagrams the pipeline as built and how the planned analytics page attaches to it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
flufflycthu1u
force-pushed
the
redirect-system-v1
branch
from
September 2, 2026 01:18
c532036 to
153bea0
Compare
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.
Posts now link to cutepetsboston.com/r/?id= rather than straight to the shelter listing, so click-through can be attributed per pet (RFC 0001). The slug -> adoption URL mapping is append-only and lives on the gh-pages branch; docs/r/index.html resolves it client-side and falls back to the homepage when a slug is unknown or the fetch fails.
Pages publishing moves into a reusable workflow, publish-pages.yml, called by both prod.yml and deploy-pages.yml:
Fixes in redirects.py and the interstitial:
docs/specs/redirect-pipeline.md diagrams the pipeline as built and how the planned analytics page attaches to it.