Skip to content

CI: cover every input of the nine path-filtered workflows, and check the filters with a guard test - #542

Merged
teddashh merged 4 commits into
mainfrom
w5-ci-filters
Nov 15, 2026
Merged

teddashh merged 4 commits into
mainfrom
w5-ci-filters

Conversation

@teddashh

Copy link
Copy Markdown
Contributor

Nine workflows have paths filters: at-members, at-secops, at-usage, backup, contracts, dns, fleetupdate, installer and portal. They run only when a changed file matches the filter. Their filters missed many of the files their jobs build, test, format or read, so a change to one of those files did not run the jobs. For example, at-members listed only tests/e2e/at/members/**, docs/e2e/at/members/**, mk/at-members.mk and its own workflow file, while its jobs also use files under apps/, contracts/ and db/.

What changes:

  • A guard test. TestWorkflowPaths in tests/ci/ runs in the Go job's go test ./.... For each job of the nine workflows, it derives the job's inputs:

    • the Go packages that the job's make targets build, test or vet, read from make -n, with their dependencies from go list -deps for amd64 and arm64 and for each build tag;
    • the test sources of the packages whose tests run, and the imports of fixtures copied into temporary modules;
    • the scripts and files that the steps and test processes use, from an inventory per job. Their sources are scanned for literal package and repository paths, and one that the inventory lacks fails the test. Dynamic script wiring and the portal's npm scripts are pinned, so changing them fails the test until the inventory is reviewed;
    • the files of every gofmt command in the steps and recipes, in three forms: $(git ls-files …) with git pathspecs, $(rg --files … -g '*.go'), and plain paths.

    It then requires the job's filter to match every input file, on each of the workflow's pull_request and push events. A miss fails the test, naming the workflow, job, event and file. The test also fails on a gofmt command in any other form, on a pattern the matcher does not support ([, ], + or \), and when its root is not the top level of a git checkout.

  • The filters gain the missing inputs. Patterns per list, before and after: at-members 4 → 77, at-secops 4 → 52 and at-usage 4 → 82 (these three filter pull_request only); backup 9 → 14, contracts 11 → 14, dns 19 → 53, fleetupdate 11 → 40, installer 9 → 47 and portal 10 → 16. Nothing outside the paths lists changes.

    • fleetupdate's lists end in '**/*.go'. Its job runs make go-lint, whose gofmt checks every tracked Go file, so any Go change can fail it.
    • at-secops's deploy/** becomes deploy/backup/** and deploy/devstack/**: its job reads no other deploy/ files.
    • Where a directory holds packages that a job does not need, the filter lists the directory's direct files (<dir>/*) instead of the whole tree.

Tests: unit tests cover the matcher (a leading **/, go.*, and each rejected character), the extraction of Go commands from make -n, the three gofmt forms and an unknown form, the pinned wiring, and the YAML parser's reading of the on key.

Deliberate breakages, each reverted afterwards. Each made TestWorkflowPaths fail with a message naming the place:

  • removing '**/*.go' from fleetupdate's pull_request list: 117 misses on pull_request in 11 directories, none on push. Removing it from the push list only: 117 misses, all on push;
  • adding tests/installer to the files of a gofmt command in mk/dns.mk: 10 misses on each of dns's two events;
  • giving at-secops's gofmt its files from $(find tests/e2e/at/secops -name '*.go'): unsupported file-list command;
  • adding 'tests/[ab]/**' to contracts's pull_request list, and 'a/+b' to at-secops's: unsupported syntax in pattern.

Validation: on the exact source 344deb5f:

  • the change's shape: exactly the 13 owned paths (9 workflow files and 4 test files) in 4 commits, scanned, with clean whitespace;
  • the nine workflow files parse, and outside on.<event>.paths each equals its version at 2f5159f3;
  • the guard in tests/ci: each of its 6 top-level tests passed once, none failed or skipped, and all 9 formatter sets were logged; go vet and gofmt are clean;
  • CI's at-members and at-usage verify steps, the at-secops component checks (47 Python tests ran), backup lint and unit tests (1 package ok), and the installer verify steps;
  • none of the 223 test databases the runs named was left behind;
  • CI's fleetupdate verify (lint, unit tests, build) and its integration packages against PostgreSQL except internal/db (3 packages ok), and the DNS lint, build, unit and publish steps (12 packages ok);
  • CI's Go job: go-lint, go test ./... (95 packages ok; 35 of them came from Go's test cache, which reuses a pass of the same test binary with the same inputs; tests/ci, the only Go package this change touches, ran fresh), the build of every command for amd64 and arm64, and the tidy check;
  • CI's contracts job: build, lint, drift, typecheck, tests, the coverage floor, and both 20-second fuzz runs;
  • CI's Portal job: lockfile install, typecheck, lint, format check, unit tests with coverage (367 tests passed), and the live Playwright suite against fvpn-control and fvpn-worker (12 tests passed, none failed, flaky or skipped);
  • no test database created during this set was left behind.

Then the same checks on a temporary merge of this source into main f0f10c9b, which merged without conflicts:

  • the nine workflow files parse, and outside on.<event>.paths each equals its version at f0f10c9b;
  • the guard in tests/ci: each of its 6 top-level tests passed once, none failed or skipped, and all 9 formatter sets were logged; go vet and gofmt are clean;
  • CI's at-members and at-usage verify steps, the at-secops component checks (47 Python tests ran), backup lint and unit tests (1 package ok), and the installer verify steps;
  • none of the 223 test databases the runs named was left behind;
  • CI's fleetupdate verify (lint, unit tests, build) and its integration packages against PostgreSQL except internal/db (3 packages ok), and the DNS lint, build, unit and publish steps (12 packages ok);
  • CI's Go job: go-lint, go test ./... (96 packages ok; 2 of them came from Go's test cache in the same way; tests/ci ran fresh), the build of every command for amd64 and arm64, and the tidy check;
  • CI's contracts job: build, lint, drift, typecheck, tests, the coverage floor, and both 20-second fuzz runs;
  • CI's Portal job: lockfile install, typecheck, lint, format check, unit tests with coverage (367 tests passed), and the live Playwright suite against fvpn-control and fvpn-worker (12 tests passed, none failed, flaky or skipped);
  • no test database created during this set was left behind.

These are local runs; no CI result is claimed here. Every one of the nine workflow files changes, so this pull request runs all nine workflows. Their container and network-namespace jobs were not run locally; the steps of those jobs are unchanged.

Review: An independent review of the first version found three problems. fleetupdate's lists missed 117 Go files in 11 directories that its make go-lint formats, and the guard did not derive formatter inputs. At-secops's deploy/** was broader than what its job reads. And [, ] and + were matched as literal characters. The third commit fixes all three. A second review, of that commit, approved it with no findings. A local run of the Go job's tests then failed: TestGofmtInputExtraction expects the guard to refuse a directory outside a git checkout, but make go-test puts its temporary directories inside the checkout, where git finds the enclosing repository. The fourth commit makes the guard require the top level of a checkout and adds a test for a subdirectory. A third review, of that commit, approved it.

Agent: codex/gpt-6.1-terra

🤖 Generated with Claude Code

Agent: codex/gpt-6.1-terra
Agent: codex/gpt-6.1-terra
@teddashh
teddashh merged commit 6479796 into main Nov 15, 2026
58 checks passed
@teddashh
teddashh deleted the w5-ci-filters branch November 15, 2026 01:06
teddashh added a commit that referenced this pull request Nov 15, 2026
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant