Skip to content

ci: CI files outside Build and Test's closure run no build or test - #1125

Open
zaneni6 wants to merge 1 commit into
mainfrom
ci/build-and-test-closure
Open

zaneni6 wants to merge 1 commit into
mainfrom
ci/build-and-test-closure

Conversation

@zaneni6

@zaneni6 zaneni6 commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Why

#1124 adds two standalone workflows, devkit-auto-swap.yml and devkit-swap-review.yml, plus their script devkit_auto_swap.py. Build and Test never calls any of them, yet the PR still ran every dev-kit build, every NPU suite and HIPEP. Two reasons:

What

build_and_test_closure() works out, from the PR's own checkout, which CI files a Build and Test run can use:

  1. build-and-test.yml.
  2. The workflows and actions it reaches through uses: ./.github/..., transitively.
  3. The script/ci files any of them names or imports. The test_* unit tests are left out, because the changes job runs them on every event and they call nothing else.

Any changed workflow, action or script/ci file outside that set is OUTSIDE_BUILD_AND_TEST: nothing is built or tested for it, and there is no list to keep up to date. If a PR wires a new script into Build and Test, its own build-and-test.yml puts the script in the set, so it is tested.

The rule errs towards testing:

  • A mention anywhere is enough, comments included.
  • A reference counts even if the PR deletes or renames its target. Removing a script or workflow that Build and Test still calls is therefore tested, and fails.
  • Files in subdirectories of script/ci count as used.
  • If build-and-test.yml cannot be read, every CI file falls back to the existing rules.
  • decide() now takes the repo, so --repo works out the set for that checkout.

On #1124's real diff, using its own checkout: run_tests=false, no build, NPU, HIPEP, dev-kit job or bench. Today the set holds the same workflows, actions and scripts as a hand-built prototype. Outside it are the expected workflows: build-container, cpu-tests, devkit-aie-image, devkit-bench-comment, pr-security-scan, release, smolvla-package and weekly-security-scan.

Tests

python3 -m unittest discover -s ci -p 'test_*.py' -t ci: 448 tests OK. New tests cover:

  • ci: dev-kit auto-swap: swap in and merge an approved pull request's binaries #1124's files, plus a new workflow, action and script, all running nothing.
  • The set on the real tree.
  • A temporary repo: following uses:, names and imports; wiring a script in; deleted or renamed targets; subdirectories; an unreadable build-and-test.yml.
  • A deleted setup_windows_deps.ps1, which must still be tested.
  • A guard: every script/ci script outside the set must be a test, or be named by another workflow. Anything else is either dead or called in a way the set cannot see.

An independent review found three ways a change Build and Test uses could go untested: deleted or renamed targets, script/ci subdirectories, and --repo. All three are fixed above and covered by tests. check_internal_refs.py: ok.

After this merges, merging main into #1124 makes its next run follow the new rule.

🤖 Generated with Claude Code

changes.py named the standalone workflows it skips, and treated every
devkit-*.yml workflow and every script/ci file as dev-kit CI. So #1124
(two new standalone workflows, devkit-auto-swap.yml and
devkit-swap-review.yml, and their script devkit_auto_swap.py) still ran
every dev-kit build, every NPU suite and HIPEP.

build_and_test_closure() now works out, from the checkout, the CI files a
Build and Test run can use: build-and-test.yml, the workflows and actions
it reaches through uses:, transitively, and the script/ci files any of
them names or imports (the test_* unit tests aside, which the changes job
runs on every event). A changed workflow, action or script/ci file
outside it is OUTSIDE_BUILD_AND_TEST: nothing is built or tested for it,
and no list has to be kept. It errs towards testing: a mention, comments
included, is enough; a reference counts even when the change deletes or
renames away its target, so that break is tested and fails; files in
script/ci subdirectories count as used; and an unreadable
build-and-test.yml leaves every CI file to the existing rules. decide()
takes the repo, so --repo works out the closure of that checkout.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Security scan found no critical or high findings on lines changed by this pull request

View the security scan run for complete reports.

“New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta.

This branch has not been deployed

No deployments
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