Blastradius

Configuration reference

Everything you can set on the Maven plugin (blastradius:select, version 0.4.0) and the matching Gradle extension, plus how to wire it into CI.

Build modes

Decided fresh on every invocation; never configured by hand.

ModeWhenWhat happens
TRACKCurrent commit is baseRef (or -Dblastradius.mode=track)Full suite runs untouched; a subprocess rebuilds the index for next time.
SELECTNot baseRef, and a usable index exists for the merge baseSurefire is narrowed to the affected tests.
FALLBACKNot baseRef, and no usable indexFull suite runs. Reason printed: MISSING, UNREADABLE, FORMAT_VERSION_MISMATCH, ANCHOR_UNREACHABLE, ANCHOR_MISMATCH, MERGE_BASE_UNAVAILABLE, INTERNAL_ERROR.

Parameters

ParameterCLI propertyDefaultMeaning
baseRef-DbaseRefrequiredTarget Git reference (main, origin/main, a tag). Non-target builds compare from its merge base with HEAD.
indexPath-DindexPath.blastradius/index.jsonIndex file template; the merge-base SHA is inserted before the filename. Rejected if it resolves outside the project.
indexStore-DindexStorefilefile keeps indexes in the workspace; s3 shares them between runners.
s3Bucket-Ds3Bucket—Required when indexStore=s3.
s3Prefix-Ds3PrefixemptyOptional key prefix.
s3Region-Ds3Region—Required when indexStore=s3; used to sign requests.
s3Endpoint-Ds3Endpoint—Optional S3-compatible endpoint, e.g. MinIO (path-style access).
—-Dblastradius.mode=track—Force TRACK, e.g. to pre-warm the index.
—-Dblastradius.explain=truefalsePrint the per-test decision listing.
—-Dblastradius.directInvocationFallback=falsetrueDisable the one-hop fallback for a project class a test executed that directly invokes a changed class. It can conservatively select an extra test.

indexPath is one shared namespace for the whole reactor: configure it once at the root.

CI: cache the index

The trunk job writes .blastradius/; the pull-request job restores it. Cache it like ~/.m2. S3 is not required. If a PR cannot restore an index, Blastradius runs the full suite.

steps:
  - uses: actions/checkout@v7

  - name: Restore Blastradius index
    id: blastradius-index
    uses: actions/cache/restore@v4
    with:
      path: .blastradius
      key: blastradius-index-${{ runner.os }}-${{ github.sha }}
      restore-keys: |
        blastradius-index-${{ runner.os }}-

  - run: mvn -B --no-transfer-progress verify

  - name: Save Blastradius index from main
    if: ${{ github.ref == 'refs/heads/main' && success() && steps.blastradius-index.outputs.cache-hit != 'true' }}
    uses: actions/cache/save@v4
    with:
      path: .blastradius
      key: blastradius-index-${{ runner.os }}-${{ github.sha }}

Fetch enough Git history to find the merge base. Never put credentials under .blastradius/: Actions caches are readable by pull-request workflows.

Shared S3 index store

Use it when trunk and PR jobs cannot share a workspace cache.

<configuration>
  <baseRef>main</baseRef>
  <indexStore>s3</indexStore>
  <s3Bucket>ci-dependency-indexes</s3Bucket>
  <s3Prefix>blastradius</s3Prefix>
  <s3Region>eu-central-1</s3Region>
</configuration>

Credentials come from the AWS SDK default chain (environment, OIDC, profile, instance role). Prefer GitHub OIDC with a short-lived role over long-lived keys. The writer role needs s3:GetObject and s3:PutObject on the prefix; a PR needs only s3:GetObject. Do not grant either to untrusted fork PRs: those fall back to the full suite.

Gradle

The plugin ID is io.github.baokhang83.blastradius. Applying it configures every Java Test task; run the normal ./gradlew test. Publication to the Gradle Plugin Portal is pending, so it must currently be built from source.

blastradius {
  baseRef = 'main'
  indexStore = 's3'            // optional
  s3Bucket = 'ci-dependency-indexes'
  s3Prefix = 'blastradius'
  s3Region = 'eu-central-1'
  // s3Endpoint = 'https://minio.example.com'
  // directInvocationFallback = false
}

Files and console output

Add .blastradius/ to .gitignore.

[blastradius] SELECT — index built from 4e02156 (2026-07-10T03:03:04Z)
[blastradius] 1 / 2 tests selected (50.0% skipped)
[blastradius]   dependency-matched: 1, new-or-modified: 0, fallback: 0

Full prose reference, including the GitHub Actions feedback action: plugin README.