Repository navigation
feat(fleet): check that make ci is each repository's local CI gate (ADR-0083) - #253
Merged
Merged
Conversation
…DR-0083) ADR-0083 makes make ci the 1 local entry point to the CI gate: it runs every offline check of ci.yml, lint and format included, no pull-request workflow lints or formats outside it, and AGENTS.md names it. A change rolled out to many repositories runs make ci in each clone before it pushes. - scripts/lib/ci-gate.mjs: the B12 readers (moved from test/repository-baseline.test.mjs, which re-exports them) and new readers for workflow triggers, lint actions and tools, Makefile reach, npm scripts and script files. make a b now counts both targets in B12. - scripts/check-fleet-conventions.mjs checks rows B12 and B19 beside the B4 presence part, and takes OWNER/REPO arguments to check any repository. - Baseline row B19, the quality-loop design doc, AGENTS.md and docs/org-adrs.md; link-only back-links in ADR-0044, ADR-0071 and ADR-0073.
Review of the first head found 7 reader gaps. Each now has a targeted test and a correction record: - on: events are read at 1 level (indentless lists, flow mappings), not from branch names or inputs; - a uses: line inside a block scalar body is text, not a step; - a quoted make argument is a target; - a lint tool counts only when a simple command that make ci reaches calls it (commandCalls), after the Makefile variables that the command uses are expanded, never from a message, a comment, an installer argument or an unused variable; - npm pre and post scripts are followed, unless --ignore-scripts; - row B12 needs ci.yml to run on pull_request.
…er options Re-review found 5 more reader gaps. Each now has a targeted test and a correction record: - a quoted string is 1 argument word; only $(...), backquotes and the string after -c (or a flag group ending in c, as in sh -lc) are command lines; - npm scripts come from npm invocations (commandCalls), each with its own --ignore-scripts; - a flow on: value is read to its matching bracket and split at the top level only; - the values of xargs, sudo, env, nice, time and timeout options are skipped; - Makefile variables are expanded before prerequisites and recipe make calls are followed. ADR-0083 names the readers' limits.
…hell
Re-review found 2 more gaps in commandCalls. Each now has a targeted
test and a correction record:
- the reader splits a line into shell words first: quotes join their
word ("golangci-lint", CGO_ENABLED="0"), and a substitution keeps its
place in its word ($(go env GOPATH)/bin/staticcheck runs staticcheck);
- a -c argument is code only after a shell (sh, bash, dash, zsh, ksh,
ash; also nsl run ... sh -lc), never after grep -c.
The last review found that echo sh -c 'x' still counted x as a command: the reader searched every argument for a shell name. A -c argument is now code only when the command is a shell (after wrappers), or a shell after nsl run and its options. Targeted tests through toolsCalled and lintGaps; the correction record names the case.
Contributor
Author
Cross-review record
Checks at
|
Contributor
Author
Cross-review record (update)
|
The reader skipped a shell's option words but not their values, so bash -o pipefail -c 'shellcheck x.sh' ran no tool and a conformant make ci got a false B19 gap. shellCode now parses the options: -o, -O, +o, +O (also in a group such as -eo), --rcfile and --init-file take the next word as their value, and the code is the first word after the options. Targeted test and correction record.
Contributor
Author
Fix for the re-review 4 finding
|
Contributor
Author
Cross-review record (final)
|
bketelsen
approved these changes
Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ADR-0083 makes
make cithe 1 local entry point to the CI gate in every frostyard code repository and in the bketelsen repositories that ADR-0076 names:make ciruns every check thatci.ymlruns on pull requests, lint and format included; only a check that needs network access or a credential (govulncheck, a GitHub API read, a pip install inside a test) stays in a job of its own.make cidoes not run.AGENTS.mdnamesmake ci.make ciin each clone before it pushes there.Why: of the 552 pull requests that
frostyard-machinesopened from 2026-11-07 to 2026-11-14, 28 had a real CI failure. 6 of them failed only on lint or format (shellcheck SC2034 in apt-publisher, bootc-debian and omarchy-apps; golangci-lint ST1018 in repogen; ansible-lint line length in bketelsen/fleet), and 5 of those 6 came from rollouts to many repositories.Changes:
scripts/lib/ci-gate.mjs(new): the B12 readersworkflowCommandsandciCoverageGaps, moved verbatim fromtest/repository-baseline.test.mjs(which re-exports them), plus new hand-written readers:runsOnPullRequest(top-levelon:only),workflowActions,makeRules/makeCalls/makeReach(prerequisites, recipemake/$(MAKE)calls in command position, outside quotes),npmScripts,scriptPaths,workflowLintChecks,lintGaps,lintScriptPaths,namesMakeCi.LINT_TOOLSandLINT_ACTIONSlist the tools and actions the check knows. One B12 change:make a bin arun:command now counts both targets (frostmail runsmake desktop-build desktop-build-windows).scripts/check-fleet-conventions.mjs/scripts/lib/fleet-conventions.mjs: beside the B4 presence part, checkB12:(ci.ymlexists and runs every part ofmake ci) andB19:(AGENTS.mdnamesmake ci; no lint or format check outsidemake ciin a pull-request workflow). WithOWNER/REPOarguments, it checks those repositories instead of the enabled declarations; a bad argument exits 2.docs/specs/repository-baseline.md; the local CI gate and the rollout rule indocs/design/quality-loop.md;AGENTS.md;docs/org-adrs.md; the ADR index; link-only back-links in ADR-0044, ADR-0071 and ADR-0073.test/ci-gate.test.mjs(input shapes of each reader: YAML forms ofon:, comments, quoted and block values, CRLF, BOM, empty file, continuation lines, inline recipes, target-specific variables, pattern rules, quotedmake,-C/-f, cycles, badpackage.json, globs, URLs, matches inside longer words); new cases intest/fleet-conventions.test.mjsandtest/repository-baseline.test.mjs(B12 multi-target case; B19 for core itself).The enabled declarations (clix, core, firn, std, updex) pass the new checks, so the required
fleet-conventionsjob stays green.Survey on 2026-11-13 (
node scripts/check-fleet-conventions.mjsover the 29 non-archived, non-fork frostyard repositories without hotedge, Logomenu and incus, plus the 6 bketelsen repositories): 6 fail.AGENTS.mddoes not namemake cimise.toml,mise.lock,Makefile,ci.yml; B19AGENTS.mdvalidate.ymlis outsidemake cici.ymldoes not runmake desktop-buildci.ymldoes not runmake verifyand 4 commands of thecirecipeci.ymldoes not run 8 commands of thecirecipe (race, cross build, echo lines)Risk tier
Risk tier: 3 — changes the organization gate (CI's required
fleet-conventionsjob) and adds a baseline row;scripts/lib/**andtest/**are quality-gates paths athighinpolicies/agent-governance.json. No path in.github/risk-paths.jsonand no workflow changes.Docs housekeeping
TEMPLATE.mddocs/README.mdThe ADR amends ADR-0071, ADR-0044 and ADR-0073 in part and lists each statement it makes false. The decision comes from a review of the CI failures of bot pull requests (cause 3, lint or format in rollouts). The owners of the failing repositories were not consulted before this PR; their gaps arrive as sweep issues.
Verification
make cigreen locally (876 tests pass, docs gate, corrections, risk paths)GITHUB_TOKEN=… npm run check:fleet:okfor clix, core, firn, std, updexnode scripts/check-fleet-conventions.mjs badexits 2 with the usage line