rules_tap
Public Bazel rules + prebuilt CLI for tap (test selection / impact / flake / culprit). Engine is private in fastverk/tap.
| Latest | 0.0.3 |
|---|---|
| Versions | 3 |
| Category | Bazel rules |
| Maintainers | Matt Marshall |
| Registry | https://registry.tbzl.dev/modules/rules_tap/ |
| Source | github.com/tomato-bazel/rules_tap |
bazel_dep(name = "rules_tap", version = "0.0.3")
View source & releases on GitHub ↗
The public Bazel surface for tap — SAVVI’s Test Automation Platform (change-based test selection, target-graph impact analysis, flake tracking, culprit-finding).
This repo ships only the thin Starlark rules + the prebuilt tap CLI (fetched per-arch from this
repo’s GitHub release assets). The engine, gRPC server/daemon, proto contracts, and deploy stay
private in fastverk/tap. Consumers resolve rules_tap anonymously — no access to the private
source — exactly how rules_lang ships prebuilt atlas oleans for the private aion/polyglot engine.
Install
.bazelrc:
common --registry=https://raw.githubusercontent.com/fastverk/bazel-registry/main/
common --registry=https://bcr.bazel.build/
MODULE.bazel:
bazel_dep(name = "rules_tap", version = "0.0.3")
Use
Test-authoring rules — tag/shard tests and define the cacheable test universe:
load("@rules_tap//bazel:defs.bzl", "tap_test_attrs", "tap_test_universe")
ts_test(name = "node_test", srcs = [...], **tap_test_attrs(owner = "graph", flaky_attempts = 2))
tap_test_universe(name = "perf_universe", scope = ["//services/...", "//lib/..."], tags = ["perf-gate"])
Impact aspect — materialize a per-target source-impact manifest (the engine diffs two commits’ manifests for precise change-impact):
bazel build //... --aspects=@rules_tap//bazel:aspects.bzl%test_impact_aspect --output_groups=tap_impact
Change-based test selection in CI — the prebuilt CLI, no source or Rust toolchain needed:
bazel run @rules_tap//cli:tap -- affected --base "$CI_MERGE_REQUEST_DIFF_BASE_SHA" --tag perf-gate \
| xargs -r bazel test --keep_going
Or, on a fastverk_project (rules_ci) repo, get that lane
by convention — no hand-wired script — via the tap_ci_feature() helper:
load("@rules_tap//ci:defs.bzl", "tap_ci_feature")
fastverk_project(
name = "project",
repo = "aion/db",
features = {"tap": tap_ci_feature()}, # adds the `test:affected` lane to the generated pipeline
)
tap_ci_feature() returns a fastverk_project feature bundle ({"jobs", "variables"}) — rules_ci
takes no dependency on rules_tap; its generic features mechanism composes the lane.
Surface
| Target | What |
|---|---|
@rules_tap//bazel:defs.bzl | test_impact_aspect, tap_test_attrs, tap_test_universe (pure Starlark) |
@rules_tap//cli:tap | the prebuilt tap CLI (native_binary, host-arch-selected) |
@rules_tap//ci:defs.bzl | tap_ci_feature() — the affected-test lane as a fastverk_project feature bundle |
Conformance#
No gate findings. 8 contested atoms. See how gating works or the full report.
Contested atoms
Third-party modules where this module resolves a different version than others do. Not a violation of anything this module did — it is the actionable form of a registry-level convergence finding, and the sentence a maintainer can act on.
| Atom | Resolved here | Elsewhere |
|---|---|---|
apple_support | 1.24.2 | 2.2.0 ×1 |
bazel_skylib | 1.8.2 | 1.9.0 ×2 |
nlohmann_json | 3.6.1 | 3.12.0.bcr.1 ×1 |
protobuf | 33.4 | 34.0.bcr.1 ×2 |
rules_jvm_external | 6.7 | 6.8 ×4 |
rules_python | 1.7.0 | 2.0.1 ×1 |
rules_swift | 3.1.2 | 3.6.1 ×1 |
upb | 0.0.0-20220923-a547704 | 0.0.0-20230516-61a97ef ×1 |
Dependencies#
Depends on
Versions#
3 published versions, newest first. Each resolves to an immutable, integrity-checked archive.
| Version | Integrity (sha256) | Source archive |
|---|---|---|
0.0.3 latest | KK2zZ7dYBjba32T5… | tag archive ↗ |
0.0.2 | LUoljjfswIk0eLiO… | tag archive ↗ |
0.0.1 | pe6Q8AJIW1cUgiRY… | tag archive ↗ |
Changelog#
All notable changes to rules_tap. The format is loosely Keep a Changelog — version headers mirror the published bazel-registry entries.
0.0.3
- Prebuilt CLI bumped to tap-cli-v0.0.2 (
cli.bzl): thetap affectedCLI is now CI-env-aware — a faithful drop-in forscripts/ci/affected-test-targets.sh. With no--baseit resolves the diff base from the pipeline env (CI_MERGE_REQUEST_DIFF_BASE_SHA,GITHUB_BASE_REF, then the origin/main merge-base) and forces the full tag-filtered universe on a tag pipeline, a default-branch build, or theBAZEL_TEST_ALLoverride. Without this a default-branch push (empty merge-base diff) would test nothing. tap_ci_feature()defaultdiff_baseis now""(omit--base, let the env-aware CLI resolve it) — so the single generatedtest:affectedjob is correct in every pipeline context (affected on MRs, full on main/tags), norules:gymnastics. Pass an explicitdiff_baseonly for a non-standard CI.
0.0.2
//ci:defs.bzl—tap_ci_feature(), afastverk_project(rules_ci) feature-bundle helper that adds tap’s change-based affected-test lane to a generated CI pipeline:fastverk_project(features = {"tap": tap_ci_feature()}). Pure Starlark (returns a{"jobs", "variables"}dict) — rules_ci stays decoupled (nobazel_depon rules_tap); the genericfeaturesmechanism composes the lane. The job runs the prebuilt//cli:tap(fetched anonymously) to emit the diff-affectedbazel testlabels and runs exactly those (bazel run @rules_tap//cli:tap -- affected … | xargs -r bazel test), superseding the legacyscripts/ci/affected-test-targets.sh. No change to the rules or the prebuilt CLI (stilltap-cli-v0.0.1).
0.0.1
- The public Bazel surface for tap, extracted from the (now private)
fastverk/tap://bazel:defs.bzl—test_impact_aspect(per-target source-impact manifest aspect),tap_test_attrs(owner/flake/shard tagging),tap_test_universe(cacheable genquery universe). Pure Starlark, no dependency on the private engine.//cli:tap— the prebuilt, per-archtapCLI, fetched from this repo’s GitHub release assets (tap-cli-v*) by//:cli.bzland exposed as a host-arch-selectednative_binary. Built + uploaded by the privatefastverk/taprepo’spublish-tap-cliworkflow (mirrors rules_lang’s atlas oleans).