Skip to content

ops: check-prod-versions.sh — one-line tenant version status - #2411

Merged
HongmingWang-Rabbit merged 1 commit into
stagingfrom
auto/prod-version-check-script
Apr 30, 2026
Merged

HongmingWang-Rabbit merged 1 commit into
stagingfrom
auto/prod-version-check-script

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Summary

A small ops script that answers "is hongmingwang.moleculesai.app running today's main?" without piecing together curl + git rev-parse + jq each time. Iterates tenant slugs, curls each `/buildinfo`, also hits canvas `/api/buildinfo`, prints a one-row-per-surface verdict.

Wire shape

```
$ ./scripts/ops/check-prod-versions.sh
Checking production surfaces against main=8516a8f

Surface Live Expected Status


tenant: hongmingwang 8516a8f 8516a8f ✓ current
tenant: reno-stars abc1234 8516a8f ✗ stale
canvas 8516a8f 8516a8f ✓ current

Summary: 1 stale, 0 unreachable.
```

Returns non-zero on any stale or unreachable surface, so this can be wired into a periodic alert later.

Composes with existing infra

Two failure modes (matches redeploy verifier)

Test plan

🤖 Generated with Claude Code

… latest?"

Iterates a list of tenant slugs (default canary set on production,
operator-supplied on staging), curls each tenant's /buildinfo plus
canvas's /api/buildinfo, compares to origin/main's HEAD SHA, prints a
table with one of {current, stale, unreachable} per surface. Returns
non-zero if any surface is stale, so it can be wired into a periodic
alert later.

Why this exists: every "is the fix live?" question used to be
answered with a one-off curl + git rev-parse + manual diff. This
script does that uniformly across every public surface (workspace
tenants + canvas) and is parseable. The redeploy verifier (#2398)
covers the deploy moment; this covers any-time-after.

Reads EXPECTED_SHA from `gh api repos/Molecule-AI/molecule-core/
commits/main` so it always reflects the actual upstream tip, not
local working-copy state. Falls back to local origin/main with a
WARN if `gh` isn't logged in — debugging is still useful even if
the comparison may lag.

Depends on:
- #2409 (TenantGuard /buildinfo allowlist) — without it every
  tenant looks "unreachable" because the route 404s before the
  handler. Already merged on staging; will hit production after
  the next staging→main fast-forward + redeploy.
- #2407 (canvas /api/buildinfo) — already on main + Vercel.

Usage:
  ./scripts/ops/check-prod-versions.sh                     # production canary set
  TENANT_SLUGS="a b c" ./scripts/ops/check-prod-versions.sh # custom set
  ENV=staging TENANT_SLUGS="..." ./scripts/ops/check-prod-versions.sh

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit added this pull request to the merge queue Apr 30, 2026
Merged via the queue into staging with commit be44e54 Apr 30, 2026
19 checks passed
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the auto/prod-version-check-script branch April 30, 2026 20:21
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