Skip to content

CI: gate deploys on tests; upgrade to Node 24 LTS and nginx 1.30 - #7

Merged
DeanCron merged 1 commit into
mainfrom
deancron-ci-tests-and-runtime-upgrade
Oct 6, 2026
Merged

DeanCron merged 1 commit into
mainfrom
deancron-ci-tests-and-runtime-upgrade

Conversation

@DeanCron

@DeanCron DeanCron commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Why

  • Pushes to main deployed straight to production with no lint/test step.
  • The Docker build stage used node:20-alpine (Node 20 reached EOL April 2026); runtime used nginx:1.27-alpine.

Changes

  • CI gate (deploy.yml): new test job — npm ci, lint, vitest, server tests (npm run test:server), and npm run build (typecheck + bundle budget). Runs on PRs; build-and-deploy now needs: test and is skipped for PRs.
  • Dockerfile: node:24-alpine build stage; nginx:1.30-alpine runtime (Alpine 3.24 ships Node 24 for the OG/dev-todos/broadband sidecars).
  • better-sqlite3 11 → 12: v11 has no Node 24 (ABI 137) prebuilds; v12 does. API usage (prepare/pragma/get/all) unchanged.
  • sharp → 0.35.5: fixes high-severity librsvg CVE (GHSA-wq5f-xc86-pv6w), relevant since the OG sidecar renders SVG.
  • .nvmrc = 24, used by both workflows.
  • allowScripts in package.json for native deps (npm's new install-scripts approval gate).
  • npm audit fix for dev-only advisories (vitest, xmldom, humanfs).

Verification (local, Node 24.21)

  • Clean npm ci ✅, lint ✅, 205/205 unit tests ✅, 3/3 server tests ✅, build + bundle budget ✅, better-sqlite3 + sharp load/render ✅.
  • ⚠️ Docker image not built locally (no Docker available); first real image build happens on merge to main.

Known remaining

  • 4 audit findings inside mapshaper (dev-only build tool); the only fix is a major downgrade, so left as-is.

- Add a test job (lint, vitest, server tests, build + bundle budget) that
  runs on PRs and must pass before build-and-deploy on main.
- Dockerfile: node:20-alpine (EOL) -> node:24-alpine; nginx:1.27-alpine ->
  nginx:1.30-alpine (Alpine 3.24, packaged Node 24 for the sidecars).
- better-sqlite3 11 -> 12 for Node 24 prebuilt binaries.
- sharp 0.35.5 (librsvg CVE fix, used by the OG renderer).
- Pin Node via .nvmrc; snapshot workflow uses it too.
- Declare allowScripts for native deps (npm install-scripts gate).
- npm audit fix for dev-only advisories (vitest, xmldom, humanfs).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@DeanCron
DeanCron merged commit d0b7447 into main Oct 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant