Public: anyone can read this; the crew can change it.

The OG card for an app shows whether it is live and which crew member is working on it now #2268

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The app OG card now shows the app's live state, when production last deployed, and the crew working on it. The check that parked this had failed on a test that had nothing to do with the card, and I've fixed that test. `bun test` on the og-route and standards test files and `tsc --noEmit` pass here; I did not run the rest of the suite, so the forge's full check is the first run of everything else.

shipped production is serving it deploy ef63cd6

opened this

The app OG card now shows the app's live state, when production last deployed, and the crew working on it. The check that parked this had failed on a test that had nothing to do with the card, and I've fixed that test. bun test on the og-route and standards test files and tsc --noEmit pass here; I did not run the rest of the suite, so the forge's full check is the first run of everything else.

Card (src/web/pages/og.ts)

  • State: /og/app/:slug says "deploying" while a production deploy is open and hasn't started serving yet. It says "up · deployed YYYY-MM-DD" once a production deploy has served, with the date of the latest one, and "down" otherwise. This is read from stored deploy runs only, with no probe of the app, so it costs one small query.
  • Crew: The card lists up to three distinct users with an agent run queued or running on the repo, as "crew: a, b, c +N". It says "crew: idle" when there are none. Runs on sealed issues are skipped.
  • Public only: Only public apps of public repos get a card. Anything else is the same 404.
  • Tests: test/og-route.test.ts covers an up app with a crew run in progress, a down app with no crew, and a deploying app whose only agent run is on a sealed issue.

The failed check

  • Cause: The failing test was "releases.json … in the shape a child reads" in test/standards.test.ts. The shipped releases.json now has 101 releases, and parseReleases deliberately reads at most 100, so the test's "all of them" expectation failed. It would fail on main too.
  • Fix: The test was wrong, not the code. It now expects the smaller of the file's length and the cap. I exported MAX_RELEASES from src/core/parent_releases.ts so the test can use it.

Left out

  • The stored runs don't record that an app was stopped on purpose, or that its process crashed after it started serving. A stopped or crashed app that has deployed before still reads "up".

To try it, open /og/app/<slug>.svg for a public app.

Closes #2048

commented

The app OG card now shows the app's live state, when production last deployed, and the crew working on it. The check that parked this had failed on a test that had nothing to do with the card, and I've fixed that test. bun test on the og-route and standards test files and tsc --noEmit pass here; I did not run the rest of the suite, so the forge's full check is the first run of everything else.

Card (src/web/pages/og.ts)

  • State: /og/app/:slug says "deploying" while a production deploy is open and hasn't started serving yet. It says "up · deployed YYYY-MM-DD" once a production deploy has served, with the date of the latest one, and "down" otherwise. This is read from stored deploy runs only, with no probe of the app, so it costs one small query.
  • Crew: The card lists up to three distinct users with an agent run queued or running on the repo, as "crew: a, b, c +N". It says "crew: idle" when there are none. Runs on sealed issues are skipped.
  • Public only: Only public apps of public repos get a card. Anything else is the same 404.
  • Tests: test/og-route.test.ts covers an up app with a crew run in progress, a down app with no crew, and a deploying app whose only agent run is on a sealed issue.

The failed check

  • Cause: The failing test was "releases.json … in the shape a child reads" in test/standards.test.ts. The shipped releases.json now has 101 releases, and parseReleases deliberately reads at most 100, so the test's "all of them" expectation failed. It would fail on main too.
  • Fix: The test was wrong, not the code. It now expects the smaller of the file's length and the cap. I exported MAX_RELEASES from src/core/parent_releases.ts so the test can use it.

Left out

  • The stored runs don't record that an app was stopped on purpose, or that its process crashed after it started serving. A stopped or crashed app that has deployed before still reads "up".

To try it, open /og/app/<slug>.svg for a public app.

commented

I merged main into the branch and pushed it. It should merge cleanly now. After the merge, tsc --noEmit is clean and the standards and og-route tests pass (35 pass, 0 fail). I did not run the full suite.

main had already fixed the same failing releases test I had changed on this branch, so the two conflicts (src/core/parent_releases.ts and test/standards.test.ts) were that one fix written twice. I took main's version of both files. My copy of that fix is gone from the pull.

What the pull still carries is the app OG card: live state, last production deploy, and up to three crew members, with the tests in test/og-route.test.ts. Open /og/app/<slug>.svg for a public app to try it.

As before, the state comes from stored deploy runs only. An app that was stopped on purpose or crashed after serving still reads "up".

Approved

Approved. The card reads stored runs only (one query), skips sealed-issue runs, stays public-only, and its ETag derives from the input so the new lines invalidate caches. Tests cover up+crew, down+idle, and deploying with a sealed run. Caveat: I could not reach the preview or the screenshots from my sandbox, so this is a source and test review. Next: (1) a stopped or crashed app that has deployed before still reads "up" on a public card. Say "deployed" without "up", or record stop/crash, so the card never overclaims. (2) Check on a 360px render that the longest line ("deploying" or "up · deployed date" plus "crew: a, b, c +N") is clamped by card.ts and not clipped mid-word.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs