Skip to content

WIP: make cluster validation Bazel tests, not pre-commit bins#819

Draft
agentydragon wants to merge 1 commit intodevelfrom
enforce-bazel-tests-wip
Draft

WIP: make cluster validation Bazel tests, not pre-commit bins#819
agentydragon wants to merge 1 commit intodevelfrom
enforce-bazel-tests-wip

Conversation

@agentydragon
Copy link
Copy Markdown
Owner

Summary

Pre-commit hook that verifies affected Bazel tests have been run (cached and passing)
before allowing a commit. Uses bazel test --check_tests_up_to_date to check the local
action cache.

  • Two-step query: validate labels, then find affected tests via scoped rdeps (~4s warm)
  • Universe excludes packages with broken native deps (gymnasium, pygobject)
  • Optionally runs tests with DUCKTAPE_PRECOMMIT_RUN_TESTS=1

Status: blocked

The standalone language: python hook can't run bazel (pre-commit virtualenv can't access
the bazel output base). Next step: merge into the unified precommit.py which runs via
language: system + run_precommit.sh wrapper.

See devinfra/precommit/ENFORCE_BAZEL_TESTS.md for detailed issues and next steps.

Next steps

  1. Create check_enforce_bazel_tests.py validator module using util.bazel.query.run_query
  2. Add to precommit.py gather + BUILD.bazel deps
  3. Add always_run: true to bazel-precommit, set PRECOMMIT_HOOK=1 in run_precommit.sh
  4. Remove standalone hook entry from .pre-commit-config.yaml
  5. Delete enforce_bazel_tests.py

agentydragon added a commit that referenced this pull request Mar 11, 2026
…lenv isolation)

The standalone hook can't run bazel from pre-commit's isolated virtualenv.
Work preserved on enforce-bazel-tests-wip branch (PR #819).
Next step: merge into unified precommit.py (language: system).
@agentydragon agentydragon force-pushed the enforce-bazel-tests-wip branch from 9d4ac2c to 131e273 Compare March 11, 2026 02:04
Comment thread cluster/validation/flux.py Fixed
Comment thread cluster/validation/sealed_secrets.py Fixed
Comment thread cluster/validation/sealed_secrets.py Fixed
@agentydragon agentydragon force-pushed the enforce-bazel-tests-wip branch 5 times, most recently from f190e4a to a320e68 Compare March 16, 2026 22:08
Add a pre-commit hook that verifies all py_test files have corresponding
Bazel test targets. Includes benchmark tooling and refactors Bazel query
utilities into util/bazel/workspace.py. Migrates cluster validation
scripts into proper Bazel test targets.
@agentydragon agentydragon force-pushed the enforce-bazel-tests-wip branch from a320e68 to 2222f41 Compare March 16, 2026 22:41
@agentydragon agentydragon changed the title WIP: enforce-bazel-tests pre-commit hook WIP: make cluster validation Bazel tests, not pre-commit bins Mar 16, 2026
agentydragon added a commit that referenced this pull request Mar 18, 2026
The integration test and validate_cluster pre-commit hook run the same
checks. Once PR #819 (enforce affected bazel tests before commit) lands,
the pre-commit hook can be removed.
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.

2 participants