Repository navigation
docs: record the dashboard toolchain (npm, Node 24.22.1, oxlint) - #23
Conversation
|
The choice itself is right: npm + Node 24 + oxlint is easy to defend, and writing it down was the
The Node release table and the supported-until dates check out. |
b79769a to
90fb22b
Compare
|
All seven are in, plus the ADR status. Rebased on main first, so it stays one commit.
Also flipped Status from Proposed to Accepted, to match 0001-0004. Unrelated, but 0006 is still |
devinder-dev
left a comment
There was a problem hiding this comment.
All seven are in, and I checked the facts against the files: no engines field in dashboard/package.json, oxlint 1.89.0, api/.bun-version 1.4.4, and create-vite 9.3.3's react-ts template really does scaffold oxlint. The npm/Node split reads much better. Approved.
Merge order: #30 first, as you say, since the "In CI" section describes its jobs.
Two small things, neither blocking:
- Splitting the image from the manifest: I agree with the split, but for a different reason. With #30,
deployalreadyneedsdashboard-image, so in one PR the tag would still be pushed before the manifest is applied. What would break is visibility: a new GHCR package starts private and k3s pulls without credentials, so the first rollout would hitImagePullBackOffand roll back, API included. Splitting lets us makerelay-dashboardpublic and test an anonymous pull before #24 depends on it. - The npm row: the Bun paragraph argues about Bun as a runtime (Vite and Playwright on its compatibility layer). Bun as only the package manager (
bun install, with Node still running Vite) is a different option; one sentence on why not (a second tool and lockfile format in a Node folder, andnpm ciis what we both know) would close it. Fine as a follow-up.
Thanks for the 0006 reminder.
Two jobs, so the dashboard gets the same lane in the pipeline the API
already has:
```
dashboard-test ──► dashboard-image ──┐
api-test ──────────► api-image ──────┤──► deploy
deploy-script-test ──────────────────┘
```
`dashboard-test` runs the 35 Playwright tests that until now only ever
ran on my laptop.
`dashboard-image` builds `relay-dashboard`, smoke-tests it, and pushes
it on main only.
`deploy` waits for both image jobs: every image a commit's manifests ask
for has to be on
GHCR before the server is told to pull them.
## Why the smoke test checks two things, not one
A status check on `/index.html` looks sufficient and is not.
`nginx.conf` hands every
unknown path to `index.html` (it has to, or `/deliveries` would 404 on
reload), so that
request answers 200 almost no matter what is in the image.
I built a deliberately broken image — the real one with `assets/`
deleted — to see which
check catches it:
```
/index.html → 200 passes
/assets/index-BimGaWWm.js → 404 fails
```
`location /assets/` has `try_files $uri =404` and no fallback, so the
bundle that
`index.html` names is the request that proves the build is really inside
the image. The
step reads that path out of `index.html` rather than hardcoding it,
because the filename
is content-hashed and changes on every build.
Run against the real image the step exits 0; against the broken one it
exits 1 with
`::error::/assets/index-BimGaWWm.js answered 404: the build is not in
the image`.
## Details worth a second look
- **`cache-from: type=gha,scope=dashboard`.** The scope defaults to
`buildkit` for
everyone, and Docker's docs are explicit: build two images without it
and each
overwrites the other's cache. The API keeps the default, so the two no
longer collide.
Naming the API's scope `api` would be tidier but means touching your
job, so I left it.
- **`npm ci`, Node from `dashboard/.nvmrc`.** The dashboard is npm and
Node 24, not Bun.
`npm install` would be free to resolve versions `package-lock.json`
never pinned.
- **`npx playwright install --with-deps chromium`.** The runner has no
browser. Without
this line the job fails on its first run with "browser not found".
- **`curl -fs`, not `-fsS`, inside the wait loop.** A refused connection
while nginx
starts is expected, and printing it would make a green run look broken.
- **Comparing `%{http_code}` by hand.** `curl -s` exits 0 on a 404, so
`set -e` does not
catch it.
## One request, and one ordering note
**Please add `dashboard-test` as a required check** on main. A green job
stops nobody from
merging; only branch protection does, and only you can change it.
The comment in `dashboard-test` names **decision 0005**, which is still
open as #23. Merging
that first keeps the reference from dangling.
## How it was checked
- `npm ci`, `npm run lint`, `npm run build`, `npm run test:e2e` locally:
**35 passed** in 19.5 s.
- The image built and served: `/index.html` 200, `/deliveries` 200
(fallback), uid 101.
- The smoke step extracted straight out of this YAML and run against
both a good and a
broken image, with the results above.
- `pipeline.yml` parses, and `deploy` really lists all three jobs in
`needs`.
## Not in this PR
- `k8s/app/dashboard.yaml` — #24, which goes out of draft once this is
merged and the first
`relay-dashboard` image is on GHCR.
- Uploading the Playwright HTML report and traces as artifacts on
failure. The `github`
reporter annotates failing tests on the PR, which is enough until a red
test is hard to read.
Co-authored-by: Abdikhani Abdirashid <Abdikhani_abdirashd@hotmail.com>
|
Correction to my note above: |
Records the dashboard's toolchain, which you asked for in the #9 review: npm + Node + oxlint were chosen in the code without ever being written down, so neither of us could point at a reason for them.
New file:
docs/decisions/0005-dashboard-toolchain.md. 0004 is taken (public images, #18), hence 0005. Docs only, no code.The three decisions
enginesnames Node, Playwright is released against Node; Bun would mean trusting its compatibility layer for the two tools that decide whether the dashboard builds and whether the e2e tests can be believedcreate-vitedefault, no config, fast enough to actually stay on; ESLint's extra rules need a typed-lint setup firstOn the Node version — a correction
My answer to your question 2 on #9 said Node 22, current LTS. Both halves were wrong, and I've corrected it there too. The real picture, from
nodejs/Release:So 22 had left active LTS a year before I called it current, and 24 moved to maintenance eleven days ago. I'm staying on 24 rather than moving to 26 because 26 is three days old as an LTS and our rule is to prefer releases at least two weeks old — the week of the defense is the wrong time to be early. Maintenance still means security and bug fixes, and Apr 2028 is well past us. Happy to move to 26 after the defense if you'd rather.
Two things the ADR writes down as consequences
api/and the worker, Node fordashboard/. Each folder declares its own:api/.bun-version,dashboard/.nvmrc.package.jsonhas noenginesfield. Today npm installs happily on a Node that Vite then refuses. I hit exactly that this morning: my shell was falling back to the system Node 18, so the dashboard build could not run on my machine at all. Addingenginesturns that into one clear error at install time instead. Worth doing when the dashboard enters CI.Still open, noted in the ADR
The dashboard isn't in CI. Whether it builds currently depends on whose laptop ran it, which is how the Node 18 problem went unnoticed. Step 5.2 should run
tsc -b,oxlintand the Playwright tests on Node 24.22.1.