tomato·bazeldocs v0 · latest
Docs/Reference/Modules/rules_tap

rules_tap

Public Bazel rules + prebuilt CLI for tap (test selection / impact / flake / culprit). Engine is private in fastverk/tap.

Latest0.0.3
Versions3
CategoryBazel rules
MaintainersMatt Marshall
Registryhttps://registry.tbzl.dev/modules/rules_tap/
Sourcegithub.com/tomato-bazel/rules_tap
MODULE.bazelstarlark
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

TargetWhat
@rules_tap//bazel:defs.bzltest_impact_aspect, tap_test_attrs, tap_test_universe (pure Starlark)
@rules_tap//cli:tapthe prebuilt tap CLI (native_binary, host-arch-selected)
@rules_tap//ci:defs.bzltap_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.

AtomResolved hereElsewhere
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#

rules_tap in the registry graph — what it depends on (left) and what depends on it (right).

Depends on

platforms1.0.0bazel_skylib1.8.2rules_shell0.6.1devstardoc0.7.2dev

Versions#

3 published versions, newest first. Each resolves to an immutable, integrity-checked archive.

VersionIntegrity (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): the tap affected CLI is now CI-env-aware — a faithful drop-in for scripts/ci/affected-test-targets.sh. With no --base it 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 the BAZEL_TEST_ALL override. Without this a default-branch push (empty merge-base diff) would test nothing.
  • tap_ci_feature() default diff_base is now "" (omit --base, let the env-aware CLI resolve it) — so the single generated test:affected job is correct in every pipeline context (affected on MRs, full on main/tags), no rules: gymnastics. Pass an explicit diff_base only for a non-standard CI.

0.0.2

  • //ci:defs.bzltap_ci_feature(), a fastverk_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 (no bazel_dep on rules_tap); the generic features mechanism composes the lane. The job runs the prebuilt //cli:tap (fetched anonymously) to emit the diff-affected bazel test labels and runs exactly those (bazel run @rules_tap//cli:tap -- affected … | xargs -r bazel test), superseding the legacy scripts/ci/affected-test-targets.sh. No change to the rules or the prebuilt CLI (still tap-cli-v0.0.1).

0.0.1

  • The public Bazel surface for tap, extracted from the (now private) fastverk/tap:
    • //bazel:defs.bzltest_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-arch tap CLI, fetched from this repo’s GitHub release assets (tap-cli-v*) by //:cli.bzl and exposed as a host-arch-selected native_binary. Built + uploaded by the private fastverk/tap repo’s publish-tap-cli workflow (mirrors rules_lang’s atlas oleans).

← All modules