ADR-080: CI Server-Side Devstack Battery — a Non-Blocking Detector, Not the Merge Gate
Status
Accepted (2026-09-29); partially superseded by ADR-086 (D3, D4), 2026-11-06. Resolves #1189 through its acceptance criterion’s second branch: the residual "merge needs no
green server-side gate" is re-accepted here, with tripwires, under the maintainer’s standing ruling that the local
pre-push battery is the merge gate. Depends on #1645 (the cma-runner-craig runner). Re-landed from Aravinth
Manivannan’s !1560.
Partially superseded by ADR-086 (D3, D4) (2026-11-06, #2923):
merge trains on the dhs-aws-autoscaler-docker-4xlarge runner are the merge gate, and the firewall rules are gone with
the host-free devstack. D1 and D2 stand.
Amended 2026-11-10 (#3043–#3046): the battery runs inside the one car job from the one musl compile; cargo xtask
ci is gone. See § Amendment — #3043–#3046 below.
Context
Before this decision the only CI job that ran tests, ci-tests, called cargo xtask validate --skip-devstack, whose
nextest run is --lib --bins: no tests/ target compiled and none of the #[ignore = "requires devstack"] suites ran
server-side (#1189 counted about 1,897 integration-test declarations and 1,312 devstack-gated tests). The ci-tests
change filter did not match services//migrations/*, so a migrations-only MR ran no compile or test job, and
docker-promote did not rebuild on a migration change although every service embeds its migrations at compile time
through sqlx::migrate!().
The pre-push hook runs the whole battery and is the project’s functional-correctness gate
(Testing Reference (CRAIG)). A client hook can be skipped — --no-verify, a lost exec bit, an unset
core.hooksPath, a web edit — and the project setting only_allow_merge_if_pipeline_succeeds is off, so nothing
server-side noticed a push that skipped it. Recurring disk exhaustion on the shared .2xlarge runner made a
server-side battery impractical until #1645 moved the workspace-build jobs to cma-runner-craig.
The maintainer’s standing ruling: GitLab CI is not the merge gate; the local pre-push battery is.
Decision
D1 — ci-integration runs the pre-push devstack battery server-side
A scan-stage job on cma-runner-craig (a fleeting instance executor: a bare microVM, image: ignored) runs, as one
serial job:
-
the
.cma-runner-bootstraptoolchain (apt, rustup fromrust-toolchain.toml, git-lfs), then Docker — from the runner image, or from the distro-signeddocker.io,docker-compose-v2anddocker-buildxpackages when the image lacks it; -
an ephemeral 32-byte field-encryption key in
devstack/field-key.env(mode 600, never printed, never an artifact) — not the sops-store key, becauseCRAIG_CI_AGE_KEYis protected and never reaches an MR ref. A fresh volume seeded under it has no key/data mismatch, so the ADR-048 §D3 boot check passes; -
cargo xtask check-docs, advisory while the template-sync debt stands (#1740); Erratum (2026-11-01, #2880): the step and the command are gone with the template sync engine; -
the raw-compose devstack —
docker compose --profile fault build, thenup -d --wait: Postgres, RabbitMQ, Keycloak, Garage, the migrate one-shots, the keyed seed and the Toxiproxyfaultsidecar; -
cargo xtask test --skip-lint --profile ci-integration --fault-gate(D2); -
a reseed (
down -v,up) andverify-seed --expect keyed, thencargo xtask e2e --no-refresh,sdk-test,security --skip-zap --skip-fuzzandperf --profile smoke.
test-results/ is uploaded with the JUnit reports (when: always, 30 days). The job runs on MR pipelines that touch
code or an operational input the devstack run depends on: services//migrations/, devstack/,
docker-compose.yml, Dockerfile, tools/craig-seed/, tests/, rulesets/, .config/nextest.toml and
.gitlab-ci.yml. ci-tests and docker-promote also gain services/*/migrations/.
Erratum (2026-10-11, #2219): GitLab matches changes: with Ruby File.fnmatch?, where dir/** is one level
only, so the as-built directory entries are dir/**/*.
D2 — One battery body, two callers
cargo xtask test --fault-gate calls validate::run_devstack_battery_standalone, which runs the same private
run_devstack_battery the pre-push devstack phase runs after ensure_ready: .ports.env reconciliation, the
ADR-067 §M9 fault preflight, verify-seed --expect keyed, the template pre-warm, the C24 executed-fault reset,
cargo nextest run --workspace --locked under the caller’s profile with --run-ignored=all, the C24
program-verification gate, the #860 invariants gate and the caregiver-coverage report. Reconciliation comes first so
the fault preflight reads the test-plane Postgres port from .ports.env rather than falling back to the shared devstack
Postgres (#1403). The callers differ only in the nextest profile: integration for the hook, ci-integration for CI
(the same test-group overrides, held equal by the #1648 parity check, with a longer slow timeout for different
hardware). A unit test fails if xtask/src/cmd/test.rs re-implements a battery step.
D3 — A detector, not the merge gate
Superseded by ADR-086 (2026-11-06): merge trains are the merge gate.
ci-integration is allow_failure: true, and only_allow_merge_if_pipeline_succeeds stays off by decision. A red run
is a pipeline warning, never a merge blocker; the pre-push battery is the merge gate. What the job adds is detection: a
push that skipped the hook still leaves a visible server-side result on its MR, and a CI-only failure on an MR whose
battery passed locally is triaged as a finding. This re-accepts the #1189 residual — a merge needs neither the battery
nor a green pipeline — under the tripwires below.
D4 — The host firewall opens to Docker-bridge traffic only
Superseded by ADR-086 (2026-11-06): no job runs these rules.
On a fresh microVM a container dialing host.docker.internal reaches the host’s own bridge address, a local address,
so the packet is INPUT on the bridge interface; a default-deny INPUT drops it and e2e hangs at page.goto. The
job inserts at the top of each chain ACCEPT for INPUT arriving on docker0 or br-+, and for FORWARD arriving
on those bridges in conntrack state DNAT (a connection to a port Docker published). It changes no default policy,
adds no unscoped ACCEPT and runs no ufw command: rules at the top of a chain already precede any ufw chain.
local-dev § Linux + UFW gives the developer-machine equivalent.
2026-11-05 (#2922, plan merge-trains-gate U2): the devstack is host-free — no service publishes a host port
outside the dev profile and nothing dials the host-gateway name, so no container-to-host traffic remains for these
rules to admit (the developer-machine section they cited is gone from local-dev). The job keeps them, harmless, until
U3 (#1739) deletes ci-integration; ADR-086 then supersedes this decision.
|
Tripwires
The residual stays accepted while none of these fires; any one reopens this decision.
-
A merge lands with a red
ci-integrationthat the pre-push battery should have caught. The hook was skipped or has diverged from CI: file afix:issue and establish which before the next merge. -
ci-integrationbecomes blocking without a superseding ADR — itsallow_failureflips, or the project turnsonly_allow_merge_if_pipeline_succeedson. An xtask unit test pinning the job’s shape fails on the first. -
The two battery callers drift — a battery step is copied into
test.rs(the single-body unit test fails), or the job runs a nextest of its own (the job-shape unit test fails onnextest runor--run-ignoredin the job). -
The
ci-integrationandintegrationnextest profiles diverge in their test-group overrides. The #1648 parity check fails. -
The firewall scope widens — a
ufwcommand, aniptables/ip6tables/nftrule not scoped to a Docker bridge, or a pipe-to-shell installer in the job’s own lines. The job-shape unit test fails. The shared.cma-runner-bootstrapanchor, which installs rustup through its upstream installer, is outside that test. -
The concurrent image build exhausts the runner’s memory.
docker compose buildbuilds targets concurrently, against the #1347 serial-build rule; if it fails for memory, give CI the serial builder rather than retrying. -
The runner is missing or interrupted. With
cma-runner-craigoffline the job does not run (the hook is unaffected); arunner_interruptedfailure is infrastructure and gets a retry, not a code investigation. -
The single serial job reds as a whole on one flaky phase and a retry repeats the image build; decomposition is #1739.
Consequences
-
The devstack suites, e2e, the SDK suites, the security probes and perf smoke get a server-side run on every MR that can affect them, including migrations-only and devstack-only MRs.
-
The job builds the workspace twice (the service images and the test binaries), so it inherits the runner’s disk sizing requirement (Known Issues & Lessons Learned).
-
The ephemeral key means CI does not exercise the sops-store adoption path. Only the pre-push battery does, through
cargo xtask dev; thesecrets-policyjob checks the store’s recipients, not adoption. -
The hook, the
integrationprofile and localcargo xtask validatebehave as before:validateruns the same numbered steps, in the same order, with the same labels. The one reordering is the unnumbered.ports.envreconciliation, which now runs before the fault preflight (D2). -
The template-managed
.githooks/pre-pushheader still calls server-side CI the "target compliance gate". It is a synced file, so it is not edited here; the mismatch is reported toclaude-quickstart. Erratum (2026-11-01, #2879): the hooks are CRAIG-owned since the move to gadhs/pi, so the header is CRAIG’s to correct; it still says "target compliance gate", which this ADR’s merge-gate ruling supersedes.
Alternatives considered
-
Make
ci-integrationthe merge gate (blocking, plusonly_allow_merge_if_pipeline_succeeds). Rejected by the ruling: every code MR would wait on a long serial job (its timeout is two hours) on a single dedicated runner that the project does not operate. -
Run the battery inside
ci-tests(cargo xtask validatewithout--skip-devstack). Rejected: that path drives the devstack throughcargo xtask dev(sops adoption,.devstack/markers, the #1636 checkout guard) and needs the protected age key on every MR; raw compose with an ephemeral key is MR-safe. -
Run
ci-integrationonly onmainor a schedule. Rejected: a post-merge run cannot surface a hook-skipped push on the MR that made it. -
Open the firewall with
ufw default allow incoming/allow routedand unscopedACCEPTrules. Rejected: that exposes every host listener on every interface and bypasses Docker’s inter-network isolation, where only bridge-to-host traffic is needed.
Amendment — #2999 (2026-11-08): the configuration layers left CRAIG’s source
ADR-087 U4 (#2955) moved the configuration layers out of CRAIG’s source. A rulesets/<j>/<file> path above now names
<file> in layer <j>: the federal, Georgia and Texas layers are the craig-config-{federal,georgia,texas}
repositories, pinned in config-sources.lock and fetched to target/config/layers/<j>/ by cargo xtask config
fetch, and the synthetic testonia layer is fixtures/config/testonia/. The path filter’s rulesets/** entry is
now config-sources.lock, fixtures/config/**/* and ci/config-trust/**/*. The decision above is unchanged.
Amendment — #3043–#3046 (2026-11-10): the battery runs inside the car from the one compile
Plan ci-dev-loop (#3042) reshaped the D2 battery’s callers and the Consequences above. D1’s server-side run and D2’s one body stand.
-
One body, one flag (U1, #3043).
cargo xtask test --integrationwith no--packagerunsvalidate::run_devstack_battery_standalone, the body D2 names. The--fault-gatespelling is gone, with no alias. -
The battery runs inside the car (U4, #3046). Server-side, the battery is the line
xtask test --integration --profile ci-integrationof the onecarjob, after the gates anddev start, on that job’s stack.cargo xtask validate --profile fullruns the same lines in the same order on a developer’s host (validate::car_lines).cargo xtask ciand itsbatteryandbuild-testsstages are gone. -
The battery compiles nothing (U2, #3044).
dev startcompiles the workspace once, musl and static, in craig-tools, and the battery runs from that one target. The Consequences bullet "The job builds the workspace twice (the service images and the test binaries)" no longer holds: the images copy the binaries that compile produced.
D3 and D4 stay superseded by ADR-086, whose D2 records the car’s shape (amended 2026-11-10).