Compare commits

...
Author SHA1 Message Date
jared fb5ef452d5 Merge pull request 'CI: a rerun of a main run no longer fails on its own deploy tag' (#89) from deploy-tag-idempotent into main
CI / UI screenshots (before/after) (push) Skipped
CI / Test (jest) (push) Successful in 20s
CI / Lint (eslint) (push) Successful in 21s
CI / Security (npm audit) (push) Successful in 34s
CI / Scan (secrets, workflows, shell) (push) Successful in 1m12s
CI / Integration (api) (push) Successful in 2m25s
CI / UI (playwright) (push) Successful in 2m43s
CI / Deploy (push) Successful in 16s
CI / Deploy worker (push) Successful in 22s
CI / Notify (push) Successful in 3s
2026-11-23 22:57:53 -05:00
jaredandClaude Opus 5.5 16a93f02be CI: a rerun of a main run no longer fails on its own deploy tag
CI / Test (jest) (pull_request) Successful in 22s
CI / Security (npm audit) (pull_request) Successful in 30s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m18s
CI / Integration (api) (pull_request) Successful in 2m16s
CI / UI screenshots (before/after) (pull_request) Successful in 15s
CI / Lint (eslint) (pull_request) Successful in 26s
CI / UI (playwright) (pull_request) Successful in 2m45s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
A rerun keeps its run number, so "Tag deployed commit" tried to create
deploy-<date>-<run> again, got a conflict, and failed the Deploy job
after a successful deploy, which also skipped Deploy worker. The step
now accepts an existing tag when it marks the same commit, and fails
with the details when it marks another.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:52:02 -05:00
jared 567941cec4 Merge pull request 'Node 22 everywhere: engines, README, drop the Node 20 job' (#88) from node22-finish into main
CI / UI screenshots (before/after) (push) Skipped
CI / Lint (eslint) (push) Successful in 25s
CI / Test (jest) (push) Successful in 26s
CI / Security (npm audit) (push) Successful in 36s
CI / Scan (secrets, workflows, shell) (push) Successful in 1m14s
CI / Integration (api) (push) Successful in 2m33s
CI / UI (playwright) (push) Successful in 3m0s
CI / Deploy (push) Failing after 5s
CI / Deploy worker (push) Skipped
CI / Notify (push) Successful in 3s
2026-11-23 22:35:45 -05:00
jaredandClaude Opus 5.5 57e4d7527f Node 22 everywhere: engines, README, drop the Node 20 job (#45)
CI / Lint (eslint) (pull_request) Successful in 36s
CI / Test (jest) (pull_request) Successful in 36s
CI / Security (npm audit) (pull_request) Successful in 37s
CI / Integration (api) (pull_request) Successful in 2m18s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m45s
CI / UI screenshots (before/after) (pull_request) Successful in 7s
CI / UI (playwright) (pull_request) Successful in 2m50s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
Production moved to Node 22.23.5 on 2026-11-23: the worker (CT 153)
first, then the server (CT 122), each from NodeSource's node_22.x repo
and checked with real commands end to end. So:
- package.json engines: node >= 22.
- README prerequisites say Node 22, with a note on NodeSource's signing
  key: copies from before January 2026 bind it with SHA-1, which Debian
  13 rejects, so apt reports the repository as unsigned.
- The Test (Node 20) job is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:22:25 -05:00
jared 82ad678532 Merge pull request 'CI: run on Node 22, keep a Node 20 job during the move' (#87) from ci-node22-default into main
CI / UI screenshots (before/after) (push) Skipped
CI / Lint (eslint) (push) Successful in 30s
CI / Test (jest) (push) Successful in 30s
CI / Security (npm audit) (push) Successful in 29s
CI / Test (Node 20) (push) Successful in 34s
CI / Scan (secrets, workflows, shell) (push) Successful in 1m42s
CI / Integration (api) (push) Successful in 2m29s
CI / UI (playwright) (push) Successful in 3m0s
CI / Deploy (push) Successful in 13s
CI / Deploy worker (push) Successful in 6s
CI / Notify (push) Successful in 3s
2026-11-23 22:15:53 -05:00
jaredandClaude Opus 5.5 921d5f6540 CI: run on Node 22, keep a Node 20 job during the move (#45)
CI / Lint (eslint) (pull_request) Successful in 27s
CI / Test (jest) (pull_request) Successful in 26s
CI / Test (Node 20) (pull_request) Successful in 31s
CI / Security (npm audit) (pull_request) Successful in 34s
CI / Integration (api) (pull_request) Successful in 2m19s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m32s
CI / UI screenshots (before/after) (pull_request) Successful in 8s
CI / UI (playwright) (pull_request) Successful in 2m52s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
Every job's container moves to node:22-bookworm (pinned by digest), so
lint, unit, integration (real server and workers), security and scan all
run on the version production is moving to. The extra job becomes
Test (Node 20), not required, covering CT 122 and CT 153 until they are
upgraded; it goes once both run Node 22.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:02:18 -05:00
4 changed files with 31 additions and 33 deletions

No files matched your search

+19 -26
View File
@@ -23,15 +23,15 @@ concurrency:
# Node comes from each job's container image, not actions/setup-node: the runner
# shares one tool cache volume between concurrent jobs, and parallel setup-node
# runs overwrote each other's Node install mid-job. node:20 matches production
# (CT 122) and the worker (CT 153).
# runs overwrote each other's Node install mid-job. Node 22 matches production
# (CT 122) and the worker (CT 153), both on NodeSource's node_22.x since 2026-11-23.
jobs:
lint:
name: Lint (eslint)
runs-on: ubuntu-latest
timeout-minutes: 20 # a hung step fails instead of blocking main
container: node:20-bookworm@sha256:8f693eaa7e0a8e71560c9a82b55fd54c2ae920a2ba5d2cde28bac7d1c01c9ba5
container: node:22-bookworm@sha256:e13726ca604184d7a91fcacab1fc09eefd642dc28e79ac34e85540dd93b78cfb
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
@@ -53,7 +53,7 @@ jobs:
name: Test (jest)
runs-on: ubuntu-latest
timeout-minutes: 20
container: node:20-bookworm@sha256:8f693eaa7e0a8e71560c9a82b55fd54c2ae920a2ba5d2cde28bac7d1c01c9ba5
container: node:22-bookworm@sha256:e13726ca604184d7a91fcacab1fc09eefd642dc28e79ac34e85540dd93b78cfb
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
@@ -63,27 +63,11 @@ jobs:
- name: Run jest with coverage
run: npm test -- --ci
# The unit tests on the next Node LTS, ahead of moving production to it (#45). Not a
# required check: a failure here is a heads-up, not a blocker.
test-node22:
name: Test (Node 22)
runs-on: ubuntu-latest
timeout-minutes: 20
container: node:22-bookworm@sha256:e13726ca604184d7a91fcacab1fc09eefd642dc28e79ac34e85540dd93b78cfb
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false # no job pushes; keep the token out of .git/config
- name: Install dependencies (lockfile only)
run: npm ci
- name: Run jest
run: npx jest --ci
audit:
name: Security (npm audit)
runs-on: ubuntu-latest
timeout-minutes: 10
container: node:20-bookworm@sha256:8f693eaa7e0a8e71560c9a82b55fd54c2ae920a2ba5d2cde28bac7d1c01c9ba5
container: node:22-bookworm@sha256:e13726ca604184d7a91fcacab1fc09eefd642dc28e79ac34e85540dd93b78cfb
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
@@ -120,7 +104,7 @@ jobs:
name: Integration (api)
runs-on: ubuntu-latest
timeout-minutes: 25
container: node:20-bookworm@sha256:8f693eaa7e0a8e71560c9a82b55fd54c2ae920a2ba5d2cde28bac7d1c01c9ba5 # the server and workers on production's Node
container: node:22-bookworm@sha256:e13726ca604184d7a91fcacab1fc09eefd642dc28e79ac34e85540dd93b78cfb # the server and workers on production's Node
env:
DB_HOST: 127.0.0.1
DB_PORT: '3306'
@@ -147,7 +131,7 @@ jobs:
name: Scan (secrets, workflows, shell)
runs-on: ubuntu-latest
timeout-minutes: 20
container: node:20-bookworm@sha256:8f693eaa7e0a8e71560c9a82b55fd54c2ae920a2ba5d2cde28bac7d1c01c9ba5
container: node:22-bookworm@sha256:e13726ca604184d7a91fcacab1fc09eefd642dc28e79ac34e85540dd93b78cfb
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
@@ -335,17 +319,26 @@ jobs:
REPO: ${{ github.repository }}
run: |
TAG="deploy-$(date -u +%Y.%m.%d)-${RUN_NUMBER}"
curl -sf -X POST \
API="https://code.lotusguild.org/api/v1/repos/${REPO}/tags"
code=$(curl -s -o /tmp/tag.json -w '%{http_code}' -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"${TAG}\",\"target\":\"${GIT_SHA}\",\"message\":\"Deployed to production\"}" \
"https://code.lotusguild.org/api/v1/repos/${REPO}/tags"
"$API")
if [ "$code" = 201 ]; then echo "Tagged ${GIT_SHA} as ${TAG}"; exit 0; fi
# A rerun keeps its run number, so the tag can already exist: fine if it is
# this commit's, an error if it names another.
existing=$(curl -sf -H "Authorization: token $GITHUB_TOKEN" "$API/${TAG}" \
| node -e 'let d="";process.stdin.on("data",c=>d+=c).on("end",()=>{try{console.log(JSON.parse(d).commit.sha)}catch(e){}})')
if [ "$existing" = "$GIT_SHA" ]; then echo "${TAG} already marks ${GIT_SHA} (a rerun)"; exit 0; fi
echo "Could not tag ${GIT_SHA} as ${TAG} (HTTP ${code}; existing: ${existing:-none})"
cat /tmp/tag.json; exit 1
deploy-worker:
name: Deploy worker
runs-on: ubuntu-latest
timeout-minutes: 15
container: node:20-bookworm@sha256:8f693eaa7e0a8e71560c9a82b55fd54c2ae920a2ba5d2cde28bac7d1c01c9ba5
container: node:22-bookworm@sha256:e13726ca604184d7a91fcacab1fc09eefd642dc28e79ac34e85540dd93b78cfb
needs: [deploy] # the server first: it must understand anything new the worker sends
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
concurrency:
+10 -5
View File
@@ -167,7 +167,7 @@ The central orchestration hub that:
- Stores all data in MariaDB database
**Technology Stack:**
- Node.js 20.x
- Node.js 22.x
- Express.js (web framework)
- WebSocket (ws package) for real-time bidirectional communication
- MySQL2 (MariaDB driver)
@@ -185,7 +185,7 @@ Lightweight execution agents that:
- Automatically reconnect on connection loss
**Technology Stack:**
- Node.js 20.x
- Node.js 22.x
- WebSocket client
- Child process execution
- System metrics collection
@@ -213,7 +213,7 @@ Lightweight execution agents that:
### Prerequisites
- **Node.js 20.x** or higher
- **Node.js 22.x** or higher
- **MariaDB 10.x** or higher
- **Authelia** configured for SSO (optional but recommended)
- **Network Connectivity** between server and workers
@@ -590,7 +590,7 @@ Everything runs from `.gitea/workflows/ci.yml`:
| `Test (jest)` | `npm test`: unit tests for `lib/` and the worker, and the deploy-script sandbox tests. Fails if coverage drops below the floors in `package.json` (`lib/` 90% lines, `worker/` 40%) | Every push and PR |
| `Security (npm audit)` | `npm audit --audit-level=high`, plus a CycloneDX SBOM of production dependencies (kept 90 days as the `sbom-cyclonedx` artifact of each `main` build) | Every push and PR, and weekly (Monday 06:00) |
| `Scan (secrets, workflows, shell)` | gitleaks over the whole git history, actionlint and zizmor on the workflow files (shellcheck on their scripts; zizmor for injection, credential persistence and unpinned images), shellcheck on every `*.sh`, a check that `public/web_template` is byte-identical to upstream at the commit in its `VERSION`, and semgrep (JavaScript, Node.js, Express, secrets and security-audit rule packs, plus Pulse's own rules in `.semgrep/pulse.yml`: no `vm`/`eval`, no shell commands in the server, no unescaped values in `innerHTML`; their test cases in `.semgrep/pulse.js` run first). Suppress a reviewed false positive on its line with `nosemgrep: <rule id>` and a comment saying why | Every push and PR |
| `Integration (api)` | Starts the real server and three workers on Node 20 against MariaDB, then runs `tests/integration/` over HTTP and WebSocket: the Gandalf API contract, HTTP and WebSocket auth, and execution reliability (worker crash, capacity, abort) | Every push and PR |
| `Integration (api)` | Starts the real server and three workers on Node 22 against MariaDB, then runs `tests/integration/` over HTTP and WebSocket: the Gandalf API contract, HTTP and WebSocket auth, and execution reliability (worker crash, capacity, abort) | Every push and PR |
| `UI (playwright)` | Starts the real server and three workers against a MariaDB service container, then runs the Playwright tests in `tests/ui/` (desktop and phone) | Every push and PR |
| `UI screenshots (before/after)` | On PRs that touch `public/`, `views/` or the render/nav code: runs the base branch and the PR side by side with the same seeded data and uploads a `ui-screenshots` artifact with one before/after image per page (desktop and phone). Pages that came out identical are listed in `unchanged.txt`. Not a required check; attach the relevant images to the PR for review | Pull requests |
| `Deploy` | Calls the `pulse-deploy` webhook on CT 122, waits until `/healthz` reports the tested commit, then tags it `deploy-*` | Push to `main`, only after all six checks pass |
@@ -732,10 +732,15 @@ Both Pulse hooks (`pulse-deploy` on CT 122 and `pulse-worker-deploy` on CT 153)
from the CI runner, 10.10.10.70, as well as requiring the signature. If the runner's address changes,
deploys fail in CI (the verify step times out) until the `ip-range` is updated on both hosts.
To add a worker host, install Node 20 and the worker as above, give it a `.env` with `WORKER_NAME`,
To add a worker host, install Node 22 and the worker as above, give it a `.env` with `WORKER_NAME`,
`PULSE_SERVER`, `PULSE_WS` and `WORKER_API_KEY`, and add its hook (one hook URL per host in the
`Deploy worker` job).
Production installs Node from NodeSource's `node_22.x` apt repository. On Debian 13, use
NodeSource's current signing key (`https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key`,
dearmored to `/usr/share/keyrings/nodesource.gpg`): copies from before January 2026 bind the
key with SHA-1, which Debian 13 rejects, so `apt-get update` reports the repository as unsigned.
---
**PULSE** - Orchestrating your infrastructure, one heartbeat at a time. ⚡
+1 -1
View File
@@ -26,7 +26,7 @@
"jest": "^30.5.2"
},
"engines": {
"node": ">=20"
"node": ">=22"
}
},
"node_modules/@babel/code-frame": {
+1 -1
View File
@@ -3,7 +3,7 @@
"version": "1.0.0",
"main": "server.js",
"engines": {
"node": ">=20"
"node": ">=22"
},
"scripts": {
"start": "node server.js",