Repository navigation
[SURF-2672] fix(release): purge jsDelivr until @latest serves the new version - #77
Merged
Merged
Conversation
@latest serves the new version
lilnasy
marked this pull request as ready for review
November 11, 2026 02:01
arjunsahai
approved these changes
Nov 11, 2026
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.
Why
The v1.1.19 release run purged
@latest/surface_tag.min.jsonce. A CDN server refilled the file seven seconds later from 1.1.18, because jsDelivr had not yet picked up the new release. Customers on that server would have loaded the old Surface Tag for up to 12 hours. A manual purge fixed it.The companion PR splits the publish workflow in surface_forms so a failure like this is visible per step.
The self review ran after this PR merged. The follow-up PR holds its fixes and replaces the purge loop.
What changes
@latestfiles report the new version. It purges any stale file again on each check.How it works
Before: one purge. A CDN server that refilled right after it cached the old version.
After: purge until every file reports the new version, then purge once more.
x-jsd-versionresponse header. It does not compare file contents.Risk
QA
Exercised locally:
@latestfiles and "unavailable" for a file that does not exist.Left for the reviewer: nothing before merge. Watch the first real release after merge.
Known gaps
actionlintwas not run.Implementation details
Self review
The review ran after this PR merged. The fixes are in the follow-up PR.
@maindid nothing useful; the timeout message said 5 minutes for an ~8-minute loop; probes downloaded whole bundles instead of HEAD; checkout ran before cutting the release; the release log claimed@latestalready resolved; a comment narrated the steps. 3 declined: freshness is sampled from one CDN provider (one runner can't reach every provider; the second purge covers the rest); longer runs widen pending-run cancellation (needs three pushes within minutes, and Step 1 serializes publishes); the version probe is duplicated in surface_forms' verify (kept as an independent check from the publisher's side).Incident
@latest/surface_tag.min.jsat 23:12:11 UTC.Original file: /gh/trysurface/scripts@1.1.18/surface_tag.js.surface_embed_v1.min.jswas stale from Frankfurt.s-maxage=43200).Changes
.github/scripts/purge-jsdelivr.shpurges@latestand@mainfor each file it is given. It usescurl --retry 3and exits 1 with an::error::line on the first failed purge..github/workflows/release-and-purge.yml:FILESis workflow-levelenvand lists the four files.actions/checkout@v4so the script is on disk.id: releaseand outputsversion(the tag without thev).x-jsd-versionfor each file, prints it, and calls the script with the stale files. It writes one line to the run summary on success.Validation
js-yamlparses the workflow.bash -npasses on every step'srunbody and on the purge script.steps.release.outputs.versionresolves to the release step's output.x-jsd-versionread returned 1.1.19 for all four live@latestfiles and nothing for a missing file, which the step prints as "unavailable".