Compare commits

..
Author SHA1 Message Date
jared 7a01c28e06 Merge pull request 'CI: build branches through their pull request only' (#69) from ci-triggers into main
CI / UI screenshots (before/after) (push) Skipped
CI / Test (jest) (push) Successful in 46s
CI / Lint (eslint) (push) Successful in 47s
CI / Security (npm audit) (push) Successful in 44s
CI / Integration (api) (push) Successful in 2m49s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m24s
CI / UI (playwright) (push) Successful in 2m42s
CI / Deploy (push) Successful in 13s
CI / Deploy worker (push) Successful in 6s
CI / Notify (push) Successful in 3s
2026-11-23 02:16:43 -05:00
jaredandClaude Opus 5.5 61991841aa CI: mariadb.sh avoids the unreachable Azure apt mirror and retries apt
CI / Test (jest) (pull_request) Successful in 27s
CI / Lint (eslint) (pull_request) Successful in 29s
CI / Security (npm audit) (pull_request) Successful in 24s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 3m7s
CI / Integration (api) (pull_request) Successful in 4m4s
CI / UI screenshots (before/after) (pull_request) Successful in 11s
CI / UI (playwright) (pull_request) Successful in 2m2s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
The Playwright image's apt sources point at azure.archive.ubuntu.com, which
timed out from the runner after it moved nodes; the UI job failed at Start
MariaDB twice. Switch to archive.ubuntu.com and retry apt up to 3 times.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 02:10:22 -05:00
jaredandClaude Opus 5.5 f140b380fb CI: build branches through their pull request only; pushes build main
CI / Lint (eslint) (pull_request) Successful in 17s
CI / Test (jest) (pull_request) Successful in 24s
CI / Security (npm audit) (pull_request) Successful in 51s
CI / UI (playwright) (pull_request) Failing after 1m32s
CI / UI screenshots (before/after) (pull_request) Successful in 8s
CI / Integration (api) (pull_request) Successful in 3m59s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m18s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
Every PR branch ran the whole pipeline twice (push and pull_request),
doubling the runner queue. Required checks move to the (pull_request)
contexts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:58:33 -05:00
jared 93b1422300 Merge pull request 'Tests: fix two CI flakes seen on main' (#68) from test-flakes into main
CI / UI screenshots (before/after) (push) Skipped
CI / Test (jest) (push) Successful in 32s
CI / Lint (eslint) (push) Successful in 36s
CI / Security (npm audit) (push) Successful in 17s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m40s
CI / Integration (api) (push) Successful in 3m18s
CI / UI (playwright) (push) Successful in 3m6s
CI / Deploy (push) Successful in 15s
CI / Deploy worker (push) Successful in 7s
CI / Notify (push) Successful in 4s
2026-11-23 01:58:17 -05:00
jaredandClaude Opus 5.5 6d289a3bce Tests: fix two CI flakes seen on main
CI / Lint (eslint) (pull_request) Successful in 27s
CI / Test (jest) (pull_request) Successful in 1m4s
CI / Security (npm audit) (pull_request) Successful in 39s
CI / Integration (api) (pull_request) Successful in 4m18s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 3m50s
CI / UI screenshots (before/after) (pull_request) Successful in 10s
CI / UI (playwright) (pull_request) Successful in 2m39s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Test (jest) (push) Successful in 1m15s
CI / Lint (eslint) (push) Successful in 1m20s
CI / Security (npm audit) (push) Successful in 27s
CI / Integration (api) (push) Successful in 3m42s
CI / Scan (secrets, workflows, shell) (push) Successful in 3m11s
CI / UI (playwright) (push) Successful in 2m38s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Notify (push) Skipped
- calculateNextRun interval: bounded by the clock before and after the
  call (its first use loads cron-parser, which took 30 s once on a loaded
  runner and broke the fixed 1 s tolerance).
- Integration helper: retry a GET once when a pooled keep-alive connection
  is reset (ECONNRESET as the server closes it); writes are never retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:57:53 -05:00
5 changed files with 39 additions and 9 deletions

No files matched your search

+4 -1
View File
@@ -3,9 +3,12 @@ name: CI
# One pipeline: lint, unit tests, audit, scans, integration and UI tests must all pass before main deploys (#45). # One pipeline: lint, unit tests, audit, scans, integration and UI tests must all pass before main deploys (#45).
# Actions are pinned to full commit SHAs (version in the trailing comment). # Actions are pinned to full commit SHAs (version in the trailing comment).
# Pushes build only main (which deploys); branches are built through their pull
# request. Building both pushes and pull requests of a branch ran every job twice and
# doubled the runner queue.
on: on:
push: push:
branches: ["**"] branches: [main]
pull_request: pull_request:
branches: ["**"] branches: ["**"]
schedule: schedule:
+4 -3
View File
@@ -596,9 +596,10 @@ Everything runs from `.gitea/workflows/ci.yml`:
| `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 | | `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 |
| `Notify` | Matrix alert on any failure on `main` or in the weekly audit, and on every deploy | As needed | | `Notify` | Matrix alert on any failure on `main` or in the weekly audit, and on every deploy | As needed |
Branch protection on `main` requires `CI / Lint (eslint) (push)`, `CI / Test (jest) (push)`, Branch protection on `main` requires `CI / Lint (eslint) (pull_request)`, `CI / Test (jest) (pull_request)`,
`CI / Security (npm audit) (push)`, `CI / Scan (secrets, workflows, shell) (push)`, `CI / Security (npm audit) (pull_request)`, `CI / Scan (secrets, workflows, shell) (pull_request)`,
`CI / Integration (api) (push)` and `CI / UI (playwright) (push)`. Actions are pinned to commit `CI / Integration (api) (pull_request)` and `CI / UI (playwright) (pull_request)` (branches are only
built through their pull request; pushes build `main`). Actions are pinned to commit
SHAs, container images to digests, checkouts don't keep the token, and builds use `npm ci`. The plan for the rest of the pipeline is tracked in #45. SHAs, container images to digests, checkouts don't keep the token, and builds use `npm ci`. The plan for the rest of the pipeline is tracked in #45.
### Integration tests ### Integration tests
+14 -2
View File
@@ -6,8 +6,20 @@
set -euo pipefail set -euo pipefail
: "${DB_NAME:?}" "${DB_USER:?}" "${DB_PASSWORD:?}" : "${DB_NAME:?}" "${DB_USER:?}" "${DB_PASSWORD:?}"
apt-get update -qq # The Playwright image points apt at Azure's Ubuntu mirror, which our runner can't
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends mariadb-server >/dev/null # always reach; use the main Ubuntu mirror instead, and retry transient failures.
for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
[ -f "$f" ] && sed -i 's#http://azure\.archive\.ubuntu\.com/#http://archive.ubuntu.com/#g' "$f"
done
for attempt in 1 2 3; do
if apt-get -o Acquire::Retries=3 update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 install -y -qq --no-install-recommends mariadb-server >/dev/null; then
break
fi
[ "$attempt" = 3 ] && { echo "::error::could not install mariadb-server"; exit 1; }
echo "apt failed (attempt $attempt); retrying in 10s"
sleep 10
done
mkdir -p /run/mysqld && chown mysql:mysql /run/mysqld mkdir -p /run/mysqld && chown mysql:mysql /run/mysqld
if ! mariadb-admin ping --silent 2>/dev/null; then if ! mariadb-admin ping --silent 2>/dev/null; then
(mariadbd --user=mysql --bind-address=127.0.0.1 --port=3306 >/tmp/mariadb.log 2>&1 &) (mariadbd --user=mysql --bind-address=127.0.0.1 --port=3306 >/tmp/mariadb.log 2>&1 &)
+12 -1
View File
@@ -18,11 +18,22 @@ const SSO = {
}; };
async function api(method, url, { headers = {}, body } = {}) { async function api(method, url, { headers = {}, body } = {}) {
const res = await fetch(BASE + url, { const send = () => fetch(BASE + url, {
method, method,
headers: { ...(body !== undefined ? { 'Content-Type': 'application/json' } : {}), ...headers }, headers: { ...(body !== undefined ? { 'Content-Type': 'application/json' } : {}), ...headers },
body: body !== undefined ? JSON.stringify(body) : undefined, body: body !== undefined ? JSON.stringify(body) : undefined,
}); });
let res;
try {
res = await send();
} catch (e) {
// A pooled keep-alive connection can be closed by the server (5 s idle timeout) just
// as the client reuses it: ECONNRESET. Retry once, but only reads; a write might
// already have taken effect.
const reset = e && e.cause && e.cause.code === 'ECONNRESET';
if (method !== 'GET' || !reset) throw e;
res = await send();
}
const text = await res.text(); const text = await res.text();
let json = null; let json = null;
try { json = JSON.parse(text); } catch { /* not JSON */ } try { json = JSON.parse(text); } catch { /* not JSON */ }
+5 -2
View File
@@ -123,10 +123,13 @@ describe('evalCondition', () => {
describe('calculateNextRun', () => { describe('calculateNextRun', () => {
test('interval: returns a date ~N minutes in the future', () => { test('interval: returns a date ~N minutes in the future', () => {
// Bounded by the clock before and after the call: its first use loads cron-parser,
// which took 30 s once on a loaded CI runner and broke a fixed 1 s tolerance.
const before = Date.now(); const before = Date.now();
const result = calculateNextRun('interval', '30'); const result = calculateNextRun('interval', '30');
expect(result.getTime()).toBeGreaterThanOrEqual(before + 30 * 60000 - 100); const after = Date.now();
expect(result.getTime()).toBeLessThanOrEqual(before + 30 * 60000 + 1000); expect(result.getTime()).toBeGreaterThanOrEqual(before + 30 * 60000);
expect(result.getTime()).toBeLessThanOrEqual(after + 30 * 60000);
}); });
test('interval: throws on non-positive value', () => { test('interval: throws on non-positive value', () => {