Skip to content

chore: upgrade dependencies - #109

Merged
grandizzy merged 2 commits into
mainfrom
chore/upgrade-rsc-deps
Nov 8, 2026
Merged

grandizzy merged 2 commits into
mainfrom
chore/upgrade-rsc-deps

Conversation

@kamsz

@kamsz kamsz commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Lockfile only: @vitejs/plugin-rsc 0.5.27 -> 0.5.39 (transitive via vocs), plus its own dependencies.

Routine dependency upgrade.

Checks: frozen install, pnpm check and check:types pass.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this lockfile-only bump and didn't find any bugs. It's still worth a human look: the bump also affects the app's own @ tanstack/react-start, not just the vocs dependency.

What was reviewed:

  • Lockfile consistency: every new version (plugin-rsc 0.5.39, es-module-lexer 3.0.4, magic-string 1.4.5, srvx 1.0.8, strip-literal 4.0.0, js-tokens 10.0.0, turbo-stream 3.2.1) has both a packages entry and a snapshots entry. Old versions that other packages still use (es-module-lexer 2.3.2, magic-string 0.30.21, strip-literal 3.1.0, srvx 1.0.5) are kept, and obug 3.0.0 was already in the lockfile.
  • Peer wiring: @ tanstack/react-start-rsc 0.1.63 requires @ vitejs/plugin-rsc >=0.5.30. Version 0.5.27 didn't satisfy that range and 0.5.39 does, so pnpm now links plugin-rsc as an optional peer into the app's react-start. The PR description doesn't mention this. vite.config.ts calls tanstackStart() without RSC enabled, so I expect no build change, but I couldn't confirm that by reading alone.
  • The react-start patch_hash is unchanged. The patch only edits dist/default-entry/esm/server.js, so the new peer resolution doesn't affect it. Not done here: frozen install, pnpm check/check:types, and the test suites.
Extended reasoning...

Only pnpm-lock.yaml changes. It moves @ vitejs/plugin-rsc from 0.5.27 to 0.5.39, which brings in four transitive major-version bumps and adds that package as an optional peer of the root app's patched @ tanstack/react-start and react-start-rsc. There is no application code change. The supply-chain surface is new third-party package versions, and the integrity hashes can't be checked by reading. I deferred because, besides the vocs path the description names, the bump changes peer resolution for the app's main framework package, and the claimed checks (frozen install, type checks) weren't run in this review.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This is a lockfile-only dependency bump plus a CI runner pin.

What was reviewed:

  • The pnpm-lock.yaml changes for @ vitejs/plugin-rsc 0.5.27 -> 0.5.39. They are internally consistent: every new transitive package (es-module-lexer 3.0.4, magic-string 1.4.5, srvx 1.0.8, strip-literal 4.0.0, js-tokens 10.0.0, turbo-stream 3.2.1) has both a packages entry and a snapshots entry, and obug 3.0.0 was already in the lockfile.
  • plugin-rsc now resolves as an optional peer of @ tanstack/react-start and react-start-rsc. vite.config.ts calls tanstackStart() without enabling RSC, so this only links the package and does not change how the app is configured. The react-start patch_hash is unchanged.
  • In check.yml, only the E2E job moves to ubuntu-24.04. The other jobs stay on ubuntu-latest, which matches the Playwright reason given in the new comment.
Extended reasoning...

The change touches pnpm-lock.yaml (an upgrade of @ vitejs/plugin-rsc, which comes in through vocs, and its own dependencies) and the runs-on line of the E2E job in .github/workflows/check.yml. No package.json or application source changes, and no auth, payment or data-handling code is touched. The lockfile entries are consistent, and RSC is not enabled in vite.config.ts, so the new optional-peer link to TanStack Start is inert. The repo has no CODEOWNERS file and the timeline shows no outstanding change requests.

@grandizzy
grandizzy merged commit 22bee07 into main Nov 8, 2026
9 checks passed
@grandizzy
grandizzy deleted the chore/upgrade-rsc-deps branch November 8, 2026 18:53
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

The latest Tipbot preview deployment for c1fd504

Name Status Preview Updated (UTC)
pr109 Shut Down Shut Down pr109.tip.bot Nov 8, 2026, 6:56 PM

sds added a commit that referenced this pull request Nov 21, 2026
… CLOUDFLARE_API_TOKEN (#111)

**Merge after** tempoxyz/cloudflare-deploy-policies#293 has merged and
its **Publish policies** run has succeeded. See "Merge after" below.

**Draft on purpose.** A ready pull request gets a preview: `preview.yml`
on `main` runs this branch's code with the `preview` environment's
token. `main`'s `preview_deploy.yml` does not yet replace this branch's
new `tipbot-preview-name` placeholder, so that preview would create a D1
database, Queues and a Slack app and then fail at **Run migrations**.
Mark it ready just before merging. Previews of pull requests opened
after it merges work.

## Summary

A push to `main` now deploys the `tipbot` Worker (https://tip.bot)
through the [Cloudflare Deploy
Broker](https://github.com/tempoxyz/cloudflare-deploy-broker). No job of
`production.yml` holds a Cloudflare credential any more, so the
`production` environment's `CLOUDFLARE_API_TOKEN` and
`CLOUDFLARE_ACCOUNT_ID` become unused. The Worker keeps its name, D1
database, Durable Objects, Queue, AI binding, cron, custom domain and
secrets. Previews are unchanged and still use the `preview`
environment's token; see "Previews" below.

## Why production.yml has been failing

Every Production run since 2026-11-04 (#95's merge) fails at **Run
migrations**, so nothing after #107 has deployed. `tipbot` still serves
version `54437c81`, which run 41477298036 deployed on 2026-11-02 with
this workflow (author `tom@tempo.xyz`, the owner of the API token).

- The step is `wrangler d1 migrations apply tipbot --env production
--remote`. Wrangler reads the ledger and lists
`0026_tempo_workspace_ousd.sql`, #95's one `UPDATE`, as pending. Then D1
refuses to run it: `You do not have permission to perform this
operation. [code: 7500]` (runs 41924847485 and 42512225697).
- So the token can read the database but not write it. 0026 is the first
migration since 0025 on 2026-06-05, and the 11-02 run had none to apply,
so this is the first D1 write the token has attempted in five months.
- Someone replaced `CLOUDFLARE_API_TOKEN` in both environments on
2026-11-17 22:23 UTC and re-ran 42512225697 a minute later. It failed
the same way, so the new token cannot write D1 either. It is probably a
user token whose owner's tempo-prd role lacks D1 write, or a token
without D1 Edit. I could not check which, because I can't read either.

The broker applies 0026 with its own credential, so this PR also fixes
the failure, provided the database accepts the statement.

## Before / after

| Area | Before | After |
| --- | --- | --- |
| D1 migrations | `wrangler d1 migrations apply` with the static token |
The broker applies pending migrations from the attested `db/migrations`
before it uploads, and stops before promotion if one fails |
| Build | `pnpm build` in the deploy job, with the token in the job |
The trusted `cloudflare-deploy-broker-build.yml` (gh-actions `1a535d66`)
runs `pnpm build:broker` and attests the Worker, its 48 chunks,
`dist/server/wrangler.json`, `dist/client` and the migrations. No
credential |
| Deploy | Vendored wrangler-action, `deploy --env production`, plus
`wrangler secret bulk` of 15 secrets | `cloudflare-deploy-broker` with
deployment ID `tipbot`, then a check that `https://tip.bot/api/health`
(which queries D1) returns 200 |
| Secrets | Re-uploaded from the `production` environment on every
deploy | Kept on the Worker. Change them in the broker dashboard
(https://cf.tehq.net/, Workers tab) |
| Slack app ID | `vars.SLACK_APP_ID` in the deploy job | A `Settings`
job in the `production` environment reads it and passes it to the build.
It is public: tip.bot serves it in a meta tag |
| Concurrency | None | One Production run at a time, never cancelled |
| Slack app update | After deploy | Unchanged |

## Changes needed for the broker build

- **Wrangler 4.91.0 → 4.151.0.** The builder rejects Durable Object
`migrations` and needs `exports`, which Wrangler 4.91 does not
understand. 4.151.0 is already in the lockfile through
`@cloudflare/vitest-plugin`, so the lockfile only switches the importer;
no new package is added. `@cloudflare/vite-plugin` 1.37.0 accepts it
(`^4.91.0`).
- **`src/worker-configuration.d.ts`** is regenerated by `pnpm
gen:types`. Wrangler now declares `Env` and `Cloudflare.Env` as
extensions of a generated `__BaseEnv_Env`, so `src/env.d.ts` adds its
stronger types to both.
- **The preview Worker name placeholder** is `tipbot-preview-name`
instead of `__PREVIEW_NAME__`, because Wrangler 4.151's `wrangler types`
rejects a Worker name with capitals or underscores. `preview_deploy.yml`
replaces both, so branches from before this PR still preview.
- **`scripts/broker-build.ts`** (`pnpm build:broker`) runs `pnpm build`
for production, then adjusts the generated `dist/server/wrangler.json`:
- It declares the live Durable Object classes as exports, derived from
`wrangler.jsonc`'s migrations: `TipbotChatStateDO` as SQLite (created as
`ChatStateDO`, renamed in `tipbot_chat_state_v2`) and `NonceStorage` as
`legacy-kv`. The broker never replays migrations. `wrangler.jsonc` keeps
them for previews and local development.
- It makes `migrations_dir` relative to the generated file, adds the
`ASSETS` binding the broker requires (nothing reads it), and deletes the
Vite plugin's `.assetsignore`, which the broker rejects and which lists
only files the client build does not write.
- **`wrangler.jsonc`** sets `account_id` (tempo-prd) in
`env.production`, which the builder requires.
- **`db/migrations/0020_telegram_provider.sql`** is a no-op placeholder.
Production run 26782816327 applied an earlier file of that name
(327ef06) before 954bf9b reverted it, so the production ledger still
records it. Wrangler ignores applied names it has no file for; the
broker requires every recorded name to be one of the attested manifest's
first ones, and otherwise fails with `d1_migration_history_mismatch`. On
a fresh database (local, tests, previews) the placeholder runs one
`UPDATE … WHERE 0`. It sorts before `0020_tip_ask.sql`, after 0019.

## Also: `pnpm audit`

c34b6d2 is separate from the migration. `main`'s Verify job now fails
`pnpm audit` on seven advisories published since #109: hono below
4.13.16 (GHSA-4m76-xfj5-7975, GHSA-h7mg-cq63-vhpq and five others) and
`@hono/node-server` below 2.1.6 (GHSA-qv5m-9pm6-hqp3,
GHSA-jpvv-r467-5p4w). This PR fails the same way without a fix, so it
pins hono 4.13.19 and overrides `@hono/node-server` to 2.1.9 (both older
than the one-day release-age policy). These are patch releases.

## Secrets

The broker keeps the live Worker's secrets. `wrangler secret list --name
tipbot` (names only) shows all 14 that `wrangler.jsonc` requires
(`FEE_PAYER_PRIVATE_KEY_MAINNET`, `FEE_PAYER_PRIVATE_KEY_TESTNET`,
`SECRET_KEY`, `SLACK_CLIENT_ID`, `SLACK_CLIENT_SECRET`,
`SLACK_SIGNING_SECRET`, `TEMPO_API_KEY`, and the seven `TWITTER_*`),
plus `RPC_CREDENTIALS`, which `src/lib/tempo.ts` reads, and
`TELEGRAM_BOT_TOKEN` and `TELEGRAM_WEBHOOK_SECRET_TOKEN`, which nothing
reads since the Telegram revert.

> [!IMPORTANT]
> The `production` environment's `RPC_CREDENTIALS` was updated on
2026-11-12, after the last successful deploy (11-02). Every deploy since
has failed, so the Worker still has the earlier value, and this workflow
no longer uploads secrets. If the new value should be live, set
`RPC_CREDENTIALS` in the broker dashboard. No other production secret
changed after 11-02.

## Behavior to review

- **Source maps.** `upload_source_maps` stays in `wrangler.jsonc`, but
the broker never uploads source maps, so production stack traces will
not be source-mapped.
- **New binding.** The first broker deploy adds `ASSETS`. Assets are
still served directly, before the Worker, as now.
- **The first deploy applies 0026** (sets OUSD as the default token for
Tempo's own Slack workspace), which has been pending since 11-04.
- **Changing bindings needs a policy change.** After the first deploy,
the broker's remembered grant authorizes code, vars, assets and new D1
migrations. A new binding, Durable Object class or resource ID needs a
policy entry in tempoxyz/cloudflare-deploy-policies first.
- **The `Settings` job records a deployment** to the `production`
environment before the build, because it reads that environment's
`SLACK_APP_ID`.
- **This PR's CI does not run the broker build**, which runs only on
push to `main`. I replayed it (see Validation).

## Previews

PR code runs while the `preview` environment's token is in the job.
`preview.yml` loads from `main`, but `preview_deploy.yml`'s deploy job
checks out the pull request's commit and then runs its code in the same
job as the token: its `setup-pnpm` composite action and lockfile,
`src/lib/*.ts`, `scripts/slack.ts`, its `wrangler` for `queues create`,
`d1 migrations apply` and `deploy`, `vite.config.ts` during the build,
and `scripts/preview-seed.ts` with `CLOUDFLARE_API_TOKEN` in its
environment. The token can edit every Worker and every D1 database in
tempo-prd. `preview-seed.ts` also reads the production `tipbot`
database. Both environments' tokens were replaced in the same second on
11-17, so they are probably the same token.

The broker's isolated previews cannot do this: each preview creates its
own Worker, D1 database and Queues, attaches `pr<n>.tip.bot`, and binds
secrets. Moving previews to STS safely means splitting
`preview_deploy.yml` so the pull request's code only builds, without
credentials, and code from `main` does every privileged step. That is a
larger change of the Slack and seeding steps too, and it cannot run
before it merges, so this PR leaves previews as they are. It is listed
as a decision for the owner.

## Validation

- `pnpm audit` reports no known vulnerabilities, and `pnpm check`, `pnpm
check:types` and `pnpm test --project unit` pass locally. `pnpm
db:migrate` and `pnpm db:codegen` on a fresh local database apply all 30
migrations and leave `db/types.gen.ts` and `db/schemas.gen.ts`
unchanged.
- actionlint passes. zizmor 1.30.1 (offline) reports no findings, as on
`main`.
- I replayed the pinned builder on this branch: its install, its `pnpm
build:broker` build command and every packaging step, on macOS and in a
`node:24.22.1` Linux container. Every builder check passes. It attests
`index.js` plus 48 `esm` modules (6.9 MB), 32 assets (6.3 MB, all with
known media types) and 30 migrations.
- tempoxyz/cloudflare-deploy-policies#293's policy accepts that
configuration and module manifest at the publisher's `BROKER_REF` and at
broker `main`, and rejects drifted ones (preview URLs on, another D1
database, another Worker, an extra route, a KV namespace, `NonceStorage`
as SQLite).

## Merge after

1. tempoxyz/cloudflare-deploy-policies#293 merges and **Publish
policies** succeeds. Before that, the broker refuses the existing Worker
name ("an explicit policy is required") and the current version keeps
serving.
2. Before merging, optionally confirm the ledger row: `wrangler d1
execute tipbot --remote --env production --command "SELECT name FROM
d1_migrations ORDER BY id"` should list `0020_telegram_provider.sql`. If
it does not, delete `db/migrations/0020_telegram_provider.sql` from this
PR.

## After merge

1. Confirm the merge push's **Production** run succeeds (the bootstrap
deploy), the deploy step reports a promoted version, and
https://tip.bot/api/health returns 200. The broker dashboard
(https://cf.tehq.net/) should show `tipbot` promoted.
2. Remove the bootstrap entry `policies/tempoxyz/tip.bot.yaml` from
tempoxyz/cloudflare-deploy-policies. Later deploys use the remembered
grant.
3. Set `RPC_CREDENTIALS` in the broker dashboard if the 11-12 value
should be live (see Secrets).
4. Delete the `production` environment's `CLOUDFLARE_API_TOKEN` and
`CLOUDFLARE_ACCOUNT_ID`. Nothing reads them after this PR. The
environment's Worker secrets (`FEE_PAYER_*`, `RPC_CREDENTIALS`,
`SECRET_KEY`, `SLACK_CLIENT_*`, `SLACK_SIGNING_SECRET`, `TEMPO_API_KEY`,
`TWITTER_*`, `TELEGRAM_*`) are unread too; delete them only if no one
needs them as the copy of record. Keep `vars.SLACK_APP_ID`.
5. Do not revoke the Cloudflare token yet. The `preview` environment's
`CLOUDFLARE_API_TOKEN` is probably the same token, and previews still
use it.

If the bootstrap deploy fails before promotion, the current version
keeps serving. Reverting this PR restores the Wrangler workflow, which
still fails at the D1 migration.

This branch was successfully deployed

1 active deployment
preview — c1fd5044 Deployed Nov 8, 2026 by grandizzy via Destroy #83
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