Skip to content

ci: add Surface Tag release+purge (Step 2) + drop the stale bundle-guard - #74

Open
vighnesh-radhakrishnan wants to merge 4 commits into
mainfrom
chore/add-release-purge-remove-bundle-guard
Open

ci: add Surface Tag release+purge (Step 2) + drop the stale bundle-guard#74
vighnesh-radhakrishnan wants to merge 4 commits into
mainfrom
chore/add-release-purge-remove-bundle-guard

Conversation

@vighnesh-radhakrishnan

Copy link
Copy Markdown
Collaborator

What

Step 2 of the two-step Surface Tag publish pipeline (surface-forms now owns the tag source).

  • Add release-and-purge.yml: on a push to main that changes surface_tag.js / surface_embed_v1.js, cut the next semver release (bump PATCH of the latest, e.g. v1.1.8v1.1.9, target = the pushed commit) so jsDelivr @latest advances to exactly these bytes, then purge the jsDelivr cache for both the raw and .min.js files at @latest/@main, fail-loud if any purge fails. Uses this repo's own GITHUB_TOKEN (contents: write) — no provisioned token.
  • Remove the ci.yml "Bundle is up to date" step: surface-forms (packages/surface-scripts) now builds and pushes the two artifacts here, so rebuilding from this repo's (now non-authoritative) src/ would diff against the pushed bytes and red main. Typecheck + unit tests stay.

Why

Source of truth is moving into surface-forms; this repo becomes the public jsDelivr serving shelf. Step 1 (in surface-forms) pushes the built files; this Step 2 reacts to that push to release + cache-bust so customers get the update.

Pipeline

surface-forms edit → build → Step 1 push (GitHub App) → this repo's mainStep 2 (this PR): release + purge → jsDelivr @latest → customers.

Notes

  • Not for testing — the isolated rehearsal runs on a cdn-cutover-test branch (Step 2 is main-only, so it won't fire there; the release + pinned-URL purge are done by hand during the rehearsal). This PR is for the real main cutover.
  • Semver (not date tags) is deliberate — jsDelivr @latest = highest stable semver; date tags with leading zeros aren't valid semver.
  • The Step-2 workflow logic was reviewed via the adversarial audit on the surface-forms side (it lives there as a reference file in the feature diff); the ci.yml guard removal was reviewed manually.

Pairs with surface-forms PR #5745 (SURF-1936).

…guard

surface-forms (packages/surface-scripts) now owns the tag source and pushes the
built surface_tag.js / surface_embed_v1.js to this repo. Add the release-and-purge
workflow: on a push to main that changes those files, cut the next semver release
(so jsDelivr @latest advances) and purge the CDN (raw + .min.js) fail-loud. Remove
the ci.yml 'Bundle is up to date' step — it rebuilds from this repo's now
non-authoritative src/ and would diff against the pushed bytes and red main.
@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown

Greptile Summary

The PR makes this repository the serving shelf for Surface Tag artifacts by adding an automated release-and-purge workflow and removing the obsolete local bundle guard.

  • Creates the next patch release when either public bundle changes on main.
  • Purges jsDelivr’s @latest and @main cache entries for raw and minified bundles.
  • Retains typechecking and unit tests while removing the source-to-bundle consistency check.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (4): Last reviewed commit: "ci: reject leading-zero release-tag comp..." | Re-trigger Greptile

Comment thread .github/workflows/release-and-purge.yml Outdated
A malformed or pre-release latest tag (e.g. v1.1.9-beta, nightly) would otherwise
split into non-numeric fields and produce an invalid/duplicate tag that silently
stops @latest from advancing. Validate ^v?N.N.N and fail loud on a bad shape.
Comment thread .github/workflows/release-and-purge.yml Outdated
gh api releases/latest exits non-zero on 404 (no releases yet) AND on
auth/rate-limit/network/5xx. The old '|| echo v1.1.0' treated both the
same, so a transient API error derived v1.1.1 — which either collides
with an existing tag (hard fail after the bytes are already on main, so
@latest is stuck) or, when below the true latest, silently fails to
advance @latest while the job goes green. Only fall back to v1.1.0 on a
genuine 404; fail loud on any other error.
Comment thread .github/workflows/release-and-purge.yml Outdated
The tag validation accepted zero-padded numeric components (e.g. v1.1.008),
whose patch is then read by Bash arithmetic as octal ("008" -> value too
great for base), aborting release creation and leaving @latest stale.

Tighten the regex to reject leading zeros (no-leading-zero semver), so a
malformed latest tag fails loudly and early, and force base-10 on the
increment as defense-in-depth.
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.

1 participant