Commit Graph
2 Commits
Author SHA1 Message Date
jaredandClaude Opus 5.5 ea939d4430 Worker deploys from CI, with version reporting (#40)
CI / Lint (eslint) (push) Successful in 14s
CI / Test (jest) (push) Successful in 18s
CI / Security (npm audit) (push) Successful in 12s
CI / Integration (api) (push) Successful in 1m14s
CI / Scan (secrets, workflows, shell) (push) Successful in 1m29s
CI / Lint (eslint) (pull_request) Successful in 19s
CI / Test (jest) (pull_request) Successful in 13s
CI / Security (npm audit) (pull_request) Successful in 7s
CI / UI (playwright) (push) Successful in 1m43s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Notify (push) Skipped
CI / Integration (api) (pull_request) Successful in 1m51s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m20s
CI / UI (playwright) (pull_request) Successful in 1m37s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
- The worker reports its commit (VERSION file, or git rev-parse in a
  checkout) in worker_connect and heartbeat metadata. The server keeps it
  per live socket and /healthz lists worker_versions.
- deploy/pulse_worker_deploy.sh <sha> <ts>, for the webhook on a worker
  host: replay and age checks, commit must be on main, installs worker.js
  and the npm manifests from exactly that commit, writes VERSION, npm ci,
  restarts, waits until /healthz lists the sha, else restores the
  previous files. Sandbox tests cover deploy, replay, stale and malformed
  input, off-main commits, no-op redeploys and rollback.
- New CI job Deploy worker after Deploy: only when worker/ or the npm
  manifests changed since the commit the workers report, so unrelated
  merges don't restart the worker; then waits for the worker to reconnect
  on the new commit.
- README: Worker deploys (install, hook definition, adding a worker host).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:51:24 -05:00
jaredandClaude Opus 5.5 cb12fec28c Deploys: exact sha, replay protection, health check and automatic rollback
CI / Test (jest) (push) Successful in 47s
CI / Lint (eslint) (push) Successful in 52s
CI / Security (npm audit) (push) Successful in 17s
CI / Deploy (push) Skipped
CI / Notify (push) Skipped
CI / Test (jest) (pull_request) Failing after 12s
CI / Lint (eslint) (pull_request) Successful in 14s
CI / Security (npm audit) (pull_request) Successful in 11s
CI / Deploy (pull_request) Skipped
CI / Notify (pull_request) Skipped
#45 phase 2.

- GET /healthz (unauthenticated): running git sha, version, database
  reachability, connected workers, uptime. 503 when the database is down.
- deploy/pulse_deploy.sh, versioned for the first time (it only existed
  as a hand-edited file on CT 122). It takes <sha> <ts> from the signed
  webhook payload and:
  - refuses requests older than 5 minutes, or not newer than the last
    accepted one (replays);
  - refuses commits that aren't on main;
  - checks out exactly that sha (before, it deployed whatever main was);
  - runs npm ci --omit=dev (before, npm install --production) and
    restarts;
  - waits for /healthz to report the sha with a working database, and
    otherwise rolls back to the previous commit.
- tests/deploy-script.test.js runs the script in a sandbox (temporary git
  origin, fake systemctl/npm/curl): exact-sha deploy with .env kept, replay,
  stale request, off-main commit, malformed input, and rollback of an
  unhealthy build.
- CI's deploy job now succeeds only once production reports the tested sha
  as healthy, before tagging. Before, it only checked that the server
  answered.
- README: CI/CD and deploy documentation, including installing the script
  and the hooks.json arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:25:35 -05:00