Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.19.6
node-version-file: apps/website/.nvmrc
cache: npm
cache-dependency-path: apps/website/package-lock.json
- run: npm ci
Expand Down Expand Up @@ -509,7 +509,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24.21.0
node-version-file: apps/website/.nvmrc
cache: npm
cache-dependency-path: apps/website/package-lock.json
- run: npm ci
Expand Down
260 changes: 130 additions & 130 deletions apps/collection/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions apps/collection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
"@react-native-menu/menu": "^2.0.0",
"@react-native-picker/picker": "2.11.4",
"@types/react": "~19.3.0",
"expo": "~58.0.25",
"expo": "~58.0.26",
"expo-build-properties": "~58.0.12",
"expo-constants": "~58.0.14",
"expo-dev-client": "~58.0.20",
"expo-dev-client": "~58.0.21",
"expo-font": "~58.0.11",
"expo-haptics": "~58.0.8",
"expo-linear-gradient": "~58.0.4",
"expo-linking": "~58.0.17",
"expo-navigation-bar": "~58.0.4",
"expo-router": "~58.0.31",
"expo-router": "~58.0.32",
"expo-screen-orientation": "~58.0.4",
"expo-splash-screen": "~58.0.14",
"expo-status-bar": "~58.0.5",
Expand Down Expand Up @@ -85,7 +85,7 @@
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-react": "^7.37.5",
"jest": "30.5.2",
"jest-expo": "58.0.14",
"jest-expo": "~58.0.15",
"jest-junit": "16.0.0",
"patch-package": "^8.0.1",
"prettier": "^3.9.10",
Expand Down
2 changes: 1 addition & 1 deletion apps/website/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.19.6
v24.21.0
2 changes: 1 addition & 1 deletion apps/website/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Website agent instructions

- Use Node.js 20.19.6 from `.nvmrc` and install with `npm ci`.
- Use Node.js 24.21.0 from `.nvmrc` and install with `npm ci`.
- Run `npm run check`, `npm run lint`, and `npm run build` when relevant, and report the documented baseline failures separately.
- Builds require no private values; server routes read provider-managed private environment values at runtime.
- Treat Slack signature verification, contact forms, account deletion, redirects, and signed Server requests as security-sensitive.
Expand Down
4 changes: 2 additions & 2 deletions apps/website/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.19.6-bookworm-slim AS build
FROM node:24.21.0-bookworm-slim AS build
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && rm -rf /var/lib/apt/lists/*
WORKDIR /app/apps/website
COPY apps/website/package.json apps/website/package-lock.json ./
Expand All @@ -9,7 +9,7 @@ COPY CHANGELOG.md /app/CHANGELOG.md
RUN npm run build
RUN npm prune --omit=dev

FROM node:20.19.6-bookworm-slim
FROM node:24.21.0-bookworm-slim
WORKDIR /app
ENV NODE_ENV=production HOST=0.0.0.0 PORT=8080
COPY --from=build --chown=node:node /app/apps/website/build ./build
Expand Down
26 changes: 24 additions & 2 deletions apps/website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The Vite plugin reads the file directly, watches it during development, renders

## Testing

Use the Node version in `.nvmrc` (20.19.6), then `npm ci`.
Use the Node version in `.nvmrc` (24.21.0), then `npm ci`.

- `npm test`: Vitest server tests in Node plus isolated Svelte Testing Library component tests in jsdom.
- `npm run test:watch`: rerun focused tests while editing.
Expand All @@ -80,7 +80,7 @@ Use the Node version in `.nvmrc` (20.19.6), then `npm ci`.
- `npm run build && npm run test:e2e`: Playwright against the built adapter-node application and a synthetic local API. Install Chromium once with `npx --no-install playwright install --no-shell chromium`.
- `npm run test:image`: build and test the production Docker image on an ephemeral loopback port. Requires Docker. Application and fixture API run on a dedicated network. A test-only preload rejects server fetches outside the fixture API, and browser routing rejects external requests. Containers are removed on exit.

CI runs the fast suites under Node 20 and a separate blocking image/browser job under Node 24. Chromium and its runner are pinned together by the lockfile. Browser HTML reports upload after every run; traces and screenshots are retained only on failure. Coverage uploads separately. The aggregate `Monorepo CI` gate includes browser results.
CI fast and image/browser jobs both read Node 24.21.0 from `.nvmrc`. The production build/runtime Docker stages use the same version, and the image smoke test verifies `process.versions.node` inside the running container. Chromium and its runner are pinned together by the lockfile. Browser HTML reports upload after every run; traces and screenshots are retained only on failure. Coverage uploads separately. The aggregate `Monorepo CI` gate includes browser results.

Server tests reset synthetic environment values, timers and fetch stubs for every test; unexpected fetch calls fail immediately. Tests cover CSRF hooks, exact HMAC signing, Slack timestamp/signature failures and approve/reject actions, CAPTCHA/delivery failures, honeypots, verification outcomes and redirect behavior. No real Slack/email requests or production bypasses are used. Browser tests block external requests and cover SSR, hydration, keyboard/mobile navigation, WCAG A/AA axe checks, redirects, verification and a pit display using `test/fixtures/pit.json` (invented teams, no production data).

Expand All @@ -91,3 +91,25 @@ Accessibility automation does not replace manual keyboard/screen-reader review.
The browser suite exposed an existing invalid font shorthand in the pinned Magnolia dependency. `postinstall` applies a small, idempotent source patch that uses valid CSS and falls back to the reduced icon font if the external full font is unavailable. Installation fails with a review instruction if upstream changes the patched code; remove the patch when the upstream fix is adopted. The suite also checks that in-paragraph Download help links remain visibly underlined.

`npm run test:coverage` also generates a static Vitest overview in `test-report/`; its coverage view uses relative routing so it works at `/lovat/website/`. CI uploads `website-test-report` and `website-browser-report` for every applicable run, including failures when reports exist. Successful main runs publish [Website reports](https://highlanderrobotics.github.io/lovat/website/) and [browser results](https://highlanderrobotics.github.io/lovat/website/browser/). See `docs/test-report-hosting.md` for the combined Pages publishing gate.

## Runtime deployment and rollback (LVT-340)

Website uses [Node 24.21.0 LTS](https://nodejs.org/en/download/archive/v24.21.0)
for local development, CI and both Docker stages. Version pins are in `.nvmrc`
and the Dockerfile; the image test derives its fixture image from `.nvmrc` and
checks the real application container version. Keep these pins aligned when
updating the runtime. No framework or adapter dependency update is bundled;
LVT-325 remains the broader dependency upgrade plan.

Before production promotion, require Website, Website browser and Web hosting
images CI checks, and verify the PR preview's public pages, redirects, `/healthz`,
and sandbox contact/Slack flows. CI uses a fixture API and blocks external
requests. Do not use production contact delivery or Slack actions as test data.
Record the deployed preview ID and image check results in LVT-340.

For rollback, redeploy the last verified Website deployment/image through the
provider without changing its runtime environment values, domains or database
configuration. Record that deployment ID before promotion. The retained Netlify
adapter remains available as documented above. Reverting the runtime pin to Node
20 is only an emergency rollback; prepare a corrected supported-runtime image
before the next promotion. This change does not apply Railway IaC or move DNS.
9 changes: 7 additions & 2 deletions apps/website/test/image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ cleanup() {
trap cleanup EXIT
docker build -f Dockerfile -t "$image" ../..
# The application preload allows only the fixture API; browser routes block external requests.
docker pull node:20.19.6-bookworm-slim
node_version=$(tr -d 'v\r\n' < .nvmrc)
fixture_image="node:${node_version}-bookworm-slim"
docker pull "$fixture_image"
docker network create "$network" >/dev/null
stub=$(docker run -d --network "$network" --network-alias stub -e FIXTURE_HOST=0.0.0.0 -v "$PWD/test/fixtures:/fixtures:ro" node:20.19.6-bookworm-slim node /fixtures/server.mjs)
stub=$(docker run -d --network "$network" --network-alias stub -e FIXTURE_HOST=0.0.0.0 -v "$PWD/test/fixtures:/fixtures:ro" "$fixture_image" node /fixtures/server.mjs)
app=$(docker run -d --network "$network" -p 127.0.0.1::8080 -v "$PWD/test/block-outbound.mjs:/test/block-outbound.mjs:ro" -e LOVAT_API_BASE=http://stub:9876 -e LOVAT_SIGNING_KEY=synthetic-browser-key -e PUBLIC_LEARN_URL=http://127.0.0.1:4321 -e PUBLIC_DASHBOARD_URL=http://127.0.0.1:4322 "$image" node --import /test/block-outbound.mjs build)
# Verify the actual runtime, not just the Dockerfile's declared tag.
actual_node_version=$(docker exec "$app" node -p process.versions.node)
[[ "$actual_node_version" == "$node_version" ]]
port=$(docker port "$app" 8080/tcp | awk -F: '{print $NF}')
export TEST_BASE_URL="http://127.0.0.1:$port"
ready=false
Expand Down
Loading