Skip to content

ci(drift): wire the board-selection gate's test and shrink the budget - #1938

Merged
zackees merged 1 commit into
mainfrom
agent/wire-select-boards-guard
Nov 6, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/wire-select-boards-guard

Conversation

@zackees

@zackees zackees commented Nov 6, 2026

Copy link
Copy Markdown
Member

What

ci/test_select_boards.py guards ci/select_boards.py — the dispatcher that decides which build-<board>.yml workflows a push runs (ci-minimal.yml builds its PR matrix from it) and which ones nightly-platforms.yml dispatches. ci/gate_script_tests.toml already named it as the covering test, so gate_script_coverage was green, but no entry point executed the module — a decorative guard on the seam that decides whether a board is built at all.

Wired into DRIFT_UNITTEST_MODULES (single source of truth; also propagates to ci/local_gate.py) and the drift step, dropped from KNOWN_UNWIRED, MAX_UNWIRED 2 → 1.

Why the wiring PR also adds tests

Promoting it exposed the same gap as #1934–#1937: all 15 existing tests drove select_workflows / matrix_entries; the CLI and its fail-open boundary had none.

select_boards.py deliberately treats an unknown diff as "select every board" so a force-push or a rewound base cannot silently stop platform coverage. Nothing asserted that — inverting it to [] would pass every existing test and quietly retire the per-board builds.

Added 7 tests:

test guards
empty base / ZERO_SHA returns None without invoking git
failed git diff returns None + explains on stderr
successful diff exact argv forwarded, blank lines dropped
main() unknown diff prints every board, rc 0
main() --all never consults the diff
main() --base/--head forwarded to the diff
main() --matrix template_build records (workflow, test_dir, toolchain_cache)

Verification (real output)

  • python -m unittest ci.test_select_boards → 22 tests OK (was 15)
  • whole drift registry (28 modules) → 446 tests OK in 13.9 s, rc 0 (was 424)
  • ci.test_local_suites + ci.test_gate_script_coverage → 23 OK
  • ci/gate_script_coverage.py --budget 0 → rc 0, "Every workflow-invoked gate script is accounted for"
  • ruff check → clean; ci/check_python_complexity.py → clean; ci/render_workflows.py --check → rc 0

RED (mutation, each restored afterwards):

  • changed_files empty-base → []: test_missing_or_zero_base_… fails
  • failed-diff branch → []: test_failed_git_diff_… fails ([] is not None)
  • blank-line filter removed: test_successful_diff_drops_blank_lines fails
  • --all still diffs: test_all_skips_the_diff_entirely fails
  • --matrix branch disabled: test_matrix_flag_… fails
  • workflow token removed or registry entry removed: test_drift_workflow_step_matches_registry fails
  • re-allowlisted + unwired: 2 not less than or equal to 1

`ci/test_select_boards.py` guards `ci/select_boards.py`, the dispatcher that
decides which `build-<board>.yml` workflows a push runs (`ci-minimal.yml` PR
matrix) and which ones the nightly sweep dispatches. `ci/gate_script_tests.toml`
already claimed the coverage, but no entry point executed the module, so the
claim was decorative and the dispatcher could rot silently.

Wired into `DRIFT_UNITTEST_MODULES` (which also propagates to `ci/local_gate.py`)
and the drift step; dropped from `KNOWN_UNWIRED`, `MAX_UNWIRED` 2 -> 1.

Promoting it exposed the same seam as #1934-#1937: the 15 existing tests drove
`select_workflows`/`matrix_entries` only, so the whole fail-open boundary and
the CLI were untested. An unknown diff (empty base, ZERO_SHA, failed
`git diff`) exists precisely so platform coverage is NOT silently skipped after
a force-push; nothing asserted it. Added 7 tests:

- empty base and ZERO_SHA return None without invoking git
- a failed `git diff` returns None and explains itself on stderr
- a successful diff forwards the exact argv and drops blank lines
- `main()` with an unknown diff prints every board and exits 0
- `--all` never consults the diff at all
- `--base`/`--head` are forwarded to the diff
- `--matrix` emits template_build records (workflow, test_dir, toolchain_cache)
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@zackees
zackees added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit c51a11d Nov 6, 2026
31 checks passed
@zackees
zackees deleted the agent/wire-select-boards-guard branch November 6, 2026 21:29
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant