Public: anyone can read this; the crew can change it.
A commit's check in the API says how many screens tall each look is and which phone look scrolls sideways #9490
Check · Review · Land · Live done — Landed and live in production.
Both check routes in the API now carry `looks: [{look, screens, sideways}]`. I ran `tsc`, `scripts/gate.ts` and the tests that cover the change and all passed. I did not run the full suite; the forge's check does that on the push.
shipped production is serving it deploy 3d07d6f
Both check routes in the API now carry looks: [{look, screens, sideways}]. I ran tsc, scripts/gate.ts and the tests that cover the change and all passed. I did not run the full suite; the forge's check does that on the push.
- Commit check:
GET …/commits/:oid/checkreads the looks of the run that answered it. That run's own vitals file wins; if it has none, the commit's filed looks are used. When no run answered (runIdis null), the looks come from the commit's filed looks alone. - Pull checks:
GET …/pulls/:number/checkscarries the samelooksbesiderun, taken from the latest run at the pull's head. - Shape:
screensis the one-decimal string, and""when the look has no recorded size.sidewaysis true only for a phone look wider than its window.[]means no file or a reader who may not read runs (mayReadRuns). - Same data as the run page: the figures come from the same
readLooksandvitalsRowsthe run page uses, through a newlooksOfCheckinsrc/actions/runs.ts. No new file is written. - Test:
test/check-looks-api.test.tswrites a vitals file with a size for a run and checks both routes. It expects"2.5"withsideways: truefor a wide phone look,"1.3"and false for one that fits, and[]for a run without a file. It fails without the source change. - Docs:
docs/features/vitals-screens.mdnames the field.
Left out: no skipped reason in the API output, since the issue asked for {look, screens, sideways} only. A skipped look appears with screens: "".
The gate failed because no commit message had a "Try:" line. I added an empty follow-up commit with one and pushed it. I couldn't amend the first commit because force pushes are refused. bun scripts/gate.ts now prints nothing locally, which I take to mean it passes. The forge's check will confirm on this push.
What changed in the pull: GET /api/v1/repos/:owner/:name/commits/:oid/check and GET …/pulls/:number/checks now carry looks: [{look, screens, sideways}]. They are built with readLooks and vitalsRows through a new looksOfCheck in src/actions/runs.ts. screens is the one-decimal string, "" without a size, and sideways is true only for a phone look wider than its window. The list is [] when there are no looks or the reader may not read runs. test/check-looks-api.test.ts covers both routes, and docs/features/vitals-screens.md names the field.
Left out: the skipped reason is not in the API output, since the issue asked for those three fields only. A skipped look appears with screens: "".
Try it: on the preview, call GET /api/v1/repos/<owner>/<name>/commits/<oid>/check or GET /api/v1/repos/<owner>/<name>/pulls/<n>/checks and read looks.
Clean, small, one concept (looksOfCheck). Gated by mayReadRuns, reuses readLooks/vitalsRows, no new write path, no new dependency, doc added in docs/features/vitals-screens.md, not README. Tests cover both routes (screens, sideways, [] without a file). Not covered by a test: the fallback to the commit filed looks, which is optional follow-up.
Both check routes in the API now carry
looks: [{look, screens, sideways}]. I rantsc,scripts/gate.tsand the tests that cover the change and all passed. I did not run the full suite; the forge's check does that on the push.GET …/commits/:oid/checkreads the looks of the run that answered it. That run's own vitals file wins; if it has none, the commit's filed looks are used. When no run answered (runIdis null), the looks come from the commit's filed looks alone.GET …/pulls/:number/checkscarries the samelooksbesiderun, taken from the latest run at the pull's head.screensis the one-decimal string, and""when the look has no recorded size.sidewaysis true only for a phone look wider than its window.[]means no file or a reader who may not read runs (mayReadRuns).readLooksandvitalsRowsthe run page uses, through a newlooksOfCheckinsrc/actions/runs.ts. No new file is written.test/check-looks-api.test.tswrites a vitals file with a size for a run and checks both routes. It expects"2.5"withsideways: truefor a wide phone look,"1.3"and false for one that fits, and[]for a run without a file. It fails without the source change.docs/features/vitals-screens.mdnames the field.Left out: no
skippedreason in the API output, since the issue asked for{look, screens, sideways}only. A skipped look appears withscreens: "".Closes #9487