Stop verifying GitHub's job; check our own URLs instead - #8
Merged
Merged
Conversation
Whether a Pages deployment worked is GitHub's problem, and deploy-pages answers it directly. Re-deriving that over HTTP is exactly how the last several publishes went wrong — polling for a sha256 and guessing a timeout, then racing CDN propagation and failing on a 403 that lasted one second. So that fetch is gone. Nothing checks the deployment. What replaces it checks something GitHub cannot: whether the host baked into our styles is the host Pages serves from. The styles carry absolute URLs, because MapLibre Native resolves relative ones inconsistently, so a mismatch means every one of ~985 tile requests takes a redirect while the deployment reports success throughout. The first publish here did exactly that — stodevx.github.io in the styles against an org Pages site that redirects to stolaf.dev — and it is the one thing the old check ever genuinely caught. It is now a string comparison: the host read back out of the built style.json, against deploy-pages' own page_url. Scheme and trailing slash are normalised because GitHub reports http://host/path/ where the styles carry https://host/path. Reading it back out of the artifact rather than from SITE_URL is deliberate — it is then the value the app will genuinely fetch, through make-style.mjs and whatever build-tiles.sh passed it, rather than a second copy of a constant that could drift. Verified both directions locally: it passes on the current configuration and fails on the stodevx.github.io value that shipped in run 5. Supersedes #7, which kept the fetch and gave it a grace period. Closed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JMoQyBFgrBcXGuxoPgSANr
hawkrives
marked this pull request as ready for review
September 7, 2026 19:43
Several comments narrated what the code used to be — "this used to be a fetch", "the old workflow polled", "all of it was being scraped and then dropped", "three things changed". That is what git history is for. In a comment it goes stale the moment someone edits around it, and it makes a reader reconstruct a timeline to understand code that is right in front of them. Rewritten to describe what the code does and why. The reasoning survives where it is load-bearing, stated as a property rather than as a change: the deploy step says polling a live URL measures a deployment time ranging from seconds to tens of minutes, rather than recounting the runs where that went wrong; the URL check says a mismatch sends every tile request through a redirect while the deployment reports success, rather than recounting the publish that did. Fixing this also turned up a comment left mangled mid-sentence by an earlier edit, in the deploy step. One "no longer" stays, in build.py: it describes an id that is absent from the scraped data at runtime, not a prior state of the code. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JMoQyBFgrBcXGuxoPgSANr
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.
Supersedes #7, now closed.
Whether a Pages deployment worked is GitHub's problem, and
deploy-pagesanswers it directly. Re-deriving that over HTTP is exactly how the last several publishes went wrong.So the fetch is gone. Nothing checks the deployment.
But one thing isn't GitHub's job
The styles carry absolute URLs — MapLibre Native resolves relative ones inconsistently, so that's deliberate. Which means if the host baked into them isn't the host Pages serves from, every one of ~985 tile requests takes a redirect, and the deployment reports success the entire time.
That's not hypothetical. The first publish here shipped
stodevx.github.ioin the styles while the org's Pages site redirects tostolaf.dev. No deployment status would ever have shown it, and it's the one thing the old check genuinely caught in five attempts:stodevx.github.ioredirectThe replacement
A string comparison, in the deploy job:
Normalised for scheme and trailing slash, because GitHub reports
http://host/path/where the styles carryhttps://host/path.Instant, nothing to race, and it catches the bug at its source rather than through a symptom.
Read back out of the artifact, not from
SITE_URL. That makes it the value the app will genuinely fetch — throughmake-style.mjsand whateverbuild-tiles.shpassed it — rather than a second copy of a constant that could drift from the thing it's meant to guard.Verified both directions
Locally, against the real
dist/style.jsonand the exactpage_urlGitHub reported on the first deployment:The second case is run 5's actual bug, so this demonstrably catches what the fetch caught.
Note
As with the last three, this PR's own CI can't exercise it — the deploy job is gated off for
pull_request. The merge run is the test, and it should be the first fully green publish: build ~35s, deploy ~6s, check ~0s.🤖 Generated with Claude Code
https://claude.ai/code/session_01JMoQyBFgrBcXGuxoPgSANr
Generated by Claude Code