ci: run lint, test, and build on every PR - #46
Merged
Conversation
The repo had no .github/workflows — 159 tests that only ever ran on one laptop. Adds a single verify job (checkout → npm ci → lint → test → build) on pull_request and pushes to main. One job rather than three: the whole suite is ~4s of actual work, so parallel jobs would pay 3x setup cost to save nothing. Needs no secrets. src/env.ts validates ANTHROPIC_API_KEY lazily on the first getClient() call rather than at import or build time, so a keyless build genuinely exercises the build — verified locally by moving .env.local aside and unsetting the var for both `npm test` and `npm run build`. Node 24 to match the Vercel production runtime. The repo pins no engines field, so this file is the de facto version of record. Lint fails on errors only; `eslint` exits 0 on warnings by design and there are 3 pre-existing ones. Tighten with --max-warnings=0 once cleared. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UHwboozu79gcGsbgy54YEF
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ErnieAtLYD
added a commit
that referenced
this pull request
Aug 7, 2026
Two follow-ups from the first CI run (#46). 1. actions/checkout and actions/setup-node bumped v4 → v7. v4 targets the Node 20 action runtime, which GitHub now force-runs on Node 24 and annotates with a deprecation warning on every run. v7 runs on 24 natively; the annotation goes away. 2. --max-warnings=0 so warnings gate instead of scrolling past. Getting there needed two things first: - eslint now ignores .remember/** — plugin scratch files that are gitignored, so they exist on a laptop but never on a runner. That asymmetry is why local lint reported 3 warnings and CI reported 2; with a zero-tolerance flag it would have failed locally only. - no-unused-vars configured with ignoreRestSiblings. Destructuring to omit fields before a wire (`{ bodyText, bodyHtml, ...meta }`) leaves bindings unused by design; flagging it had pushed the call site into `_bt`/`_bh` naming that hid which fields were dropped. The rule now expresses the intent, so ReviewForm reads with the real field names. The flag lives in the `lint` script rather than the workflow step so a local run fails exactly the way CI does. Verified both directions: an unused `deadValue` fails the gate, and a rest-sibling omit still passes. Full suite green — 159 tests, build clean. Claude-Session: https://claude.ai/code/session_01UHwboozu79gcGsbgy54YEF Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
There was no
.github/workflows/. 159 tests across 13 files, and nothing ran them but a laptop. Every "tests pass" claim in this repo has been a local claim.What
One job — checkout →
npm ci→ lint → test → build — onpull_requestand pushes tomain.One job, not three. The whole suite is roughly four seconds of real work (
vitest~0.8s,next build~2.5s). Splitting into parallel jobs would pay the checkout +npm cicost three times to save nothing.No secrets required.
src/env.tsvalidatesANTHROPIC_API_KEYlazily:It only runs on the first
getClient()call, not at import or build time — so a keyless build is a genuine check rather than one that passes by accident. Verified by moving.env.localaside and unsetting the var:npm testnpm run build(The 155 vs 159 gap is just this branch being cut from
mainbefore #45's four new tests.)Node 24 to match the Vercel production runtime. The repo pins no
enginesfield, so this workflow is the de facto version of record — worth keeping in step if prod moves.Lint fails on errors only.
eslintexits 0 on warnings by design, and there are 3 pre-existing ones (_bt/_bhinReviewForm.tsx, plus a stray.remember/tmp/scratch file that arguably shouldn't be linted at all). Adding--max-warnings=0today would fail the run on day one; the comment in the file notes where to tighten once they're cleared.concurrencywithcancel-in-progressso a rapid second push doesn't leave an obsolete run burning minutes, andpermissions: contents: readsince nothing here needs write.Note on merge order
This PR and #45 both branch from the same commit. Whichever lands second will be the first to actually get a CI run — #45's four new tests included.