`GET /admin-api/alerts` appeared in **zero** gate scripts. Both alert kinds were proven in-process, against `FakeUpstream`, at the database level — and the half that matters for an alert, the half where a human sees it, had nothing on the other end. The console read six endpoints and this was not one of them. The page now renders them: kind, source, count, last status and path, when. The kind an operator has to act on is marked rather than only printed, and the note above the table says what each kind means in words, because `server_error_streak` and `candidate_ban` are different sentences: your upstream is failing (and the edge will not ban the visitor who saw it) versus the rule would have banned and the mode is Observe. `scripts/console-smoke.sh` seeds four 502s from an address chosen for this run (`/boom`, added last commit), and `scripts/console-check.cjs` asserts the row by **source and count**, the note text, the marking, and that the table survives the phone pass: 26 → **30 assertions**. The wiring was the interesting part. The seeding runs in one container and the browser in another, so the address chosen at seed time cannot be inherited — an empty `SEED_ERROR` on the driver side would have quietly turned "the alert this run wrote" into "some alert exists somewhere". The seed now writes its values to `console-seed.env` (gitignored) and the rehearsal passes them to the browser container. `AdminConsoleTests` got the fast half: the markup contains the alerts table and fetches the endpoint. A static check cannot assert the row is there — that is what the browser gate is for — but it can notice the table disappearing without waiting for Chromium. 28 → **29 integration tests**. Numbers. Host: build 0 warnings, unit 54/54, integration 29/29. Linux rehearsal, one invocation on this tree, EXIT=0: source gates 54/54 + 29/29 + smoke 19/19, compose **35/35**, console **30/30** in a real Chromium. actionlint 1.7.12 over both workflow files: 0 problems; shellcheck, `bash -n` and `node --check` clean. Two things said plainly. The console number above is the Linux one: this laptop's browser cache has chromium-1223/1228/1234 and the pinned Playwright wants 1243, so the darwin console gate was not re-run for this change. And during the run the table's own note read "Newest 25" — the endpoint is capped and residue from earlier runs fills the page. That is OPEN-18's amplification showing up where an operator would see it, and the note states the cap instead of pretending the table is everything.
172 lines
7.2 KiB
YAML
172 lines
7.2 KiB
YAML
# The gates OPEN-2's evidence rests on, run by something other than an agent who
|
|
# chose to run them. Four mergeEvidence fields on that epic say "no CI pipeline
|
|
# exists yet — every gate quoted above was run locally"; this closes that.
|
|
#
|
|
# Honest status of this file itself: the workflow has never executed on a
|
|
# runner, because the repository has no remote yet. Do not read this file as
|
|
# proof that CI is green — it is proof of what CI will run. What narrowed the
|
|
# gap between those two sentences is that the steps below no longer retype the
|
|
# commands: they call scripts/ci-gates.sh, the same file an operator runs as
|
|
# `scripts/ci-gates.sh all` before pushing. One definition of a gate, two
|
|
# callers, so a local green run and a CI green run cannot drift apart.
|
|
#
|
|
# Timeouts are explicit. The first build of this project stalled ~12 minutes on
|
|
# a single apt-get step; a hung job is worse than a failed one.
|
|
#
|
|
# What has been done to narrow the darwin/linux gap without a runner:
|
|
# scripts/ci-linux-rehearsal.sh runs the gates in containers. Source gates
|
|
# (restore, build, unit, integration, smoke) in mcr.microsoft.com/dotnet/sdk:10.0
|
|
# — Ubuntu 24.04.5, SDK 10.0.401 resolving the pinned global.json, 54/54 + 29/29
|
|
# + 19/19, first try, 1:02.81 wall cold: evidence that the 25-minute timeout
|
|
# below is not near. Compose gate in docker:cli against the host daemon: 35/35 on
|
|
# Linux. Console gate in mcr.microsoft.com/playwright:v1.63.0-noble — the stack
|
|
# seeded by docker:cli, the same console-check.cjs driving it in a real Linux
|
|
# Chromium: 30/30. So every gate this file runs now has a Linux number. What it
|
|
# does not have is a runner: the repository has no remote, so this file has
|
|
# never executed on GitHub.
|
|
#
|
|
# One gate is not in this file: geo database freshness. It is a schedule, not a
|
|
# push gate (the pin ages on the vendor's calendar, not on ours), so it lives in
|
|
# .github/workflows/geo-freshness.yml and calls scripts/geo-db-freshness.sh.
|
|
|
|
name: ci
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
DOTNET_NOLOGO: "1"
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
|
|
# The compose smoke test needs a token to exercise the admin API. It is not a
|
|
# secret: it is a throwaway value for a stack that exists only inside the job.
|
|
OPENWAF_ADMIN_TOKEN: ci-only-throwaway
|
|
|
|
jobs:
|
|
lint:
|
|
name: lint the workflow and the shell
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# The linter itself is pinned to a version and a checksum, not piped from
|
|
# a setup script: a gate that can be moved by someone republishing a tag is
|
|
# not a gate. actionlint also checks the run: blocks below with shellcheck.
|
|
- name: actionlint (pinned, checksum verified)
|
|
run: |
|
|
VERSION=1.7.12
|
|
SHA256=8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8
|
|
curl -fsSL -o /tmp/actionlint.tar.gz \
|
|
"https://github.com/rhysd/actionlint/releases/download/v${VERSION}/actionlint_${VERSION}_linux_amd64.tar.gz"
|
|
echo "${SHA256} /tmp/actionlint.tar.gz" | sha256sum -c -
|
|
tar xzf /tmp/actionlint.tar.gz -C /tmp actionlint
|
|
/tmp/actionlint -no-color .github/workflows/ci.yml
|
|
|
|
# Both smoke scripts are gates, so a broken one has to fail loudly here
|
|
# rather than look like a passing run with zero assertions.
|
|
- name: shellcheck the smoke scripts
|
|
run: shellcheck -s bash scripts/*.sh
|
|
|
|
source:
|
|
name: build, test, smoke
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 25
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install the SDK pinned by dotnet/global.json
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: |
|
|
10.0.x
|
|
|
|
# One gate per step so the job log still names the one that failed; the
|
|
# definitions live in scripts/ci-gates.sh, not here.
|
|
- name: Restore
|
|
run: ./scripts/ci-gates.sh restore
|
|
|
|
- name: Build (also the warning gate — TreatWarningsAsErrors)
|
|
run: ./scripts/ci-gates.sh build
|
|
|
|
- name: Unit tests — the decision core
|
|
run: ./scripts/ci-gates.sh unit
|
|
|
|
- name: Integration tests — the real pipeline against a fake upstream
|
|
run: ./scripts/ci-gates.sh integration
|
|
|
|
- name: Smoke — a running edge and a real upstream, curl assertions
|
|
run: ./scripts/ci-gates.sh smoke
|
|
|
|
image:
|
|
name: build the image and smoke it
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# The plain build, the one the README shows, plus its size: this is the
|
|
# step that catches a Dockerfile regression the compose path would hide.
|
|
- name: docker build and image size
|
|
run: ./scripts/ci-gates.sh image
|
|
|
|
# Brings up edge + nginx, waits for the image's own HEALTHCHECK, asserts
|
|
# over a socket, and tears the stack down on exit.
|
|
- name: Compose smoke — the deployed image
|
|
run: ./scripts/ci-gates.sh compose-smoke
|
|
|
|
# The console is a page, and a page fails in ways curl cannot see: a typo in
|
|
# the inline script, a fetch that 401s, a table that renders nothing while the
|
|
# summary looks fine. This drives it in a real Chromium.
|
|
#
|
|
# Honest status: this job has never run on a runner, like the rest of the
|
|
# file. What was verified is the gate it calls — scripts/ci-gates.sh console
|
|
# passed locally (30 assertions, playwright-core 1.63.0 — the version pinned
|
|
# right above, and rehearsed on Linux in the Playwright image), and its
|
|
# control (a wrong token) exits 1 rather than reporting success. The step
|
|
# calls the gate by name rather than retyping the script, so the CI definition
|
|
# and the operator command cannot drift.
|
|
console:
|
|
name: the operator page in a real browser
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
# Pinned to a version that exists in the registry at the time of writing
|
|
# (checked with `npm view playwright version`), and the browser is
|
|
# installed for that exact version.
|
|
- name: Install playwright (pinned) and chromium
|
|
run: |
|
|
npm init -y >/dev/null
|
|
npm install --no-save playwright@1.63.0
|
|
npx playwright install --with-deps chromium
|
|
echo "PLAYWRIGHT_CORE=$(node -e 'console.log(require.resolve("playwright-core"))')" >> "$GITHUB_ENV"
|
|
|
|
- name: Console smoke — the page, not only its endpoints
|
|
env:
|
|
# Written into the job's workspace so the next step can publish it.
|
|
# A green console job with no picture leaves nothing to inspect once
|
|
# the runner is gone; a red one leaves the reviewer the page as it
|
|
# broke. console-check.cjs writes <path> and <path>.phone.png.
|
|
SCREENSHOT: console-evidence.png
|
|
run: ./scripts/ci-gates.sh console
|
|
|
|
# always(): the failure case is the one worth looking at.
|
|
- name: Publish the console screenshots
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: console-evidence
|
|
path: console-evidence*.png
|
|
if-no-files-found: warn
|
|
retention-days: 14
|