Skip to content

Give the migrate workflow the GitHub Packages token - #63

Merged
MattA-Official merged 1 commit into
mainfrom
fix/migrate-workflow-package-token
Aug 21, 2026
Merged

MattA-Official merged 1 commit into
mainfrom
fix/migrate-workflow-package-token

Conversation

@MattA-Official

Copy link
Copy Markdown
Member

Four lines, and the reason they matter is out of proportion to the diff.

bunfig.toml points the @newtheatre scope at GitHub Packages and reads $GH_PACKAGES_TOKEN. When auth-types became a published package (stage-door ADR-0025), the token and the packages: read permission were added to ci.yml and not to migrate.yml. So this workflow cannot install its dependencies, and dies before it reaches the database.

How it was found

Proscenium merged the first migration in the estate since the cutover and its migrate run failed at bun install:

error: GET https://npm.pkg.github.com/download/@newtheatre/auth-types/1.0.0/… - 401

All four repos had it. Proscenium's fix is newtheatre/proscenium#176; this is the same change.

Why it hid

The workflow only runs on a push touching server/db/migrations/**. Nothing had added a migration since the cutover, so it was never exercised. A workflow that only runs when it is needed is only tested when it is needed — which is the argument for dispatching it by hand after any change to how dependencies are installed.

The failure mode

The job dies at install, before the Time Travel bookmark and before the apply step, so nothing is half-applied and the database is safe. What it leaves behind is a deploy whose code is ahead of its schema — the shape of the estate outage on 2026-08-19 that stage-door ADR-0021 exists to prevent.

Verification

After merging I will dispatch the workflow by hand. With nothing pending it will no-op, which is exactly the proof wanted: that it can install, authenticate, take a Time Travel bookmark and read the _hub_migrations ledger. I will report the run here.

Closes #62.

bunfig.toml points the @newtheatre scope at GitHub Packages and reads
$GH_PACKAGES_TOKEN. When auth-types became a published package, the token
and the packages: read permission were added to ci.yml and not here, so
this workflow cannot install and dies before it reaches the database.

Latent rather than visible: it only runs on a push touching
server/db/migrations/**, so it is only tested when it is needed. Proscenium
found out the hard way on 2026-08-21, when the first migration since the
cutover deployed against an unmigrated database.

All four estate repos had the same gap.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
room-bookings 2c1c4fe Aug 21 2026, 11:52 AM

@MattA-Official
MattA-Official merged commit 2e016bc into main Aug 21, 2026
1 of 2 checks passed
@MattA-Official

Copy link
Copy Markdown
Member Author

Verified by hand as promised: run 32479564138 — success.

It installed, authenticated to Cloudflare, took a Time Travel bookmark, read the ledger (Nothing pending, 3 applied migrations) and no-op'd. That is the whole point of dispatching it with nothing to do: it proves the pipeline works before there is a migration riding on it.

Worth repeating after any future change to how dependencies are installed. This gap existed for two days and only surfaced because proscenium happened to ship a migration.

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