Skip to content

Stop verifying GitHub's job; check our own URLs instead - #8

Merged
hawkrives merged 2 commits into
mainfrom
claude/stolaf-map-data-extraction-cfqdf2
Sep 7, 2026
Merged

hawkrives merged 2 commits into
mainfrom
claude/stolaf-map-data-extraction-cfqdf2

Conversation

@hawkrives

Copy link
Copy Markdown
Member

Supersedes #7, now closed.

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.

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.io in the styles while the org's Pages site redirects to stolaf.dev. No deployment status would ever have shown it, and it's the one thing the old check genuinely caught in five attempts:

Run Verdict
5 real — the stodevx.github.io redirect
7, 9, 11 false — polling guessed the deploy time wrong
13 false — CDN mid-swap, 403 for one second

The replacement

A string comparison, in the deploy job:

styles built for : stolaf.dev/campus-map-data     ← read out of dist/style.json
Pages serves from: stolaf.dev/campus-map-data     ← deploy-pages' page_url

Normalised for scheme and trailing slash, because GitHub reports http://host/path/ where the styles carry https://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 — through make-style.mjs and whatever build-tiles.sh passed 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.json and the exact page_url GitHub reported on the first deployment:

current config      → PASS
stodevx.github.io   → correctly FAILS

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

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
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
@hawkrives
hawkrives merged commit e115ae6 into main Sep 7, 2026
7 checks passed
@hawkrives
hawkrives deleted the claude/stolaf-map-data-extraction-cfqdf2 branch September 7, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants