Skip to content

fix(ci): stop failing PRs that touch only docker-host subtrees - #553

Merged
balajinvda merged 1 commit into
mainfrom
fix/bazel-gate-empty-container-matrix
Jul 29, 2026
Merged

fix(ci): stop failing PRs that touch only docker-host subtrees#553
balajinvda merged 1 commit into
mainfrom
fix/bazel-gate-empty-container-matrix

Conversation

@balajinvda

@balajinvda balajinvda commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Why

PR #548 failed its required Bazel check with nothing wrong in it. The run
contains three jobs: detect succeeded, the one matrix row that ran
(bazel (cloud-tasks)) succeeded, and only the aggregate gate failed.

detect emitted selected 1 subtree(s): build-container=[] docker-host=[cloud-tasks].

The bazel job is guarded on needs.detect.outputs.any == 'true', the combined
count across both lanes, but its matrix comes from outputs.matrix, which was
empty. any was true because a subtree had been selected, so the job was asked
to start with an empty matrix. GitHub cannot create a job from an empty matrix
vector and resolves it to failure, not skipped -- so needs.bazel.result
was failure even though no row failed or could have.

The gate then rejected that: its build-container branch accepted only success,
while the docker branch three lines below already tolerated skipped. That
asymmetry is what turned an empty lane into a red required check.

This blocks any PR whose changes fall entirely in the docker-host lane.

What changed

Two lines, both needed.

The bazel job now guards on needs.detect.outputs.matrix != '[]', its own
lane, exactly as bazel-docker already guards on matrix_docker != '[]'. That
turns the empty case from failure into skipped.

The gate then tolerates skipped for it, mirroring the docker branch. Fixing
only the guard would not help: the gate would still reject skipped.

This does not weaken the check. The job's condition is tied to its matrix being
non-empty, so skipped can only mean this lane had nothing to do -- it cannot
mask a row that should have run. The existing BAZEL_ANY != true early exit
still covers the case where no subtree was selected at all.

Customer Release Notes

Not customer visible.

Plan Summary

Not applicable.

Usage

Not applicable.

Testing

The diagnosis is from the failing run itself rather than inference: detect's log
shows the empty build-container lane, the job list shows the only row passing,
and the gate's own env dump shows BAZEL_RESULT: failure with BAZEL_ANY: true.

The fix is exercised by this PR only insofar as it touches a workflow file. The
case it repairs is a docker-host-only change, which this is not. #548 is the
real reproduction: it should go green once it picks up main, since
pull_request runs the workflow from the PR's own ref and cannot inherit the
fix without a branch update.

Notes

Introduced with the change-aware matrix. It stayed latent because it needs a PR
whose entire change set lands in the docker-host lane, which until cloud-tasks
had active work was rare.

References

None

Related Merge Requests/Pull Requests

Unblocks #548.

Dependencies

None.

Summary by CodeRabbit

  • Bug Fixes
    • Improved CI workflow handling when only Docker-host checks are selected.
    • Prevented skipped build-container checks from being incorrectly reported as failures.
    • Ensured verification results accurately reflect whether applicable checks ran.

A pull request changing only a docker-host subtree failed the required Bazel
check with no failing job in the run. The single matrix row that ran passed.

detect splits its output into two lanes. Such a change produces
build-container=[] with docker-host=[<subtree>], but the build-container job was
guarded on the combined `any` output rather than on its own matrix. `any` is
true because a subtree was selected, so the job was asked to start with an empty
matrix. GitHub cannot create a job from an empty matrix vector and resolves it
to `failure` rather than `skipped`, so the aggregate result was failure while
every row that existed succeeded.

The gate then rejected it: the build-container branch accepted only `success`,
while the docker branch immediately below already tolerated `skipped`. The
asymmetry is what turned an empty lane into a red required check.

Both halves are corrected. The job now guards on its own matrix, the way
bazel-docker already does, and the gate tolerates `skipped` for it. That cannot
hide a row that should have run: the job's condition is tied to its matrix being
non-empty, so skipped means only that this lane had nothing to do, and the
existing BAZEL_ANY check still catches the case where no subtree was selected.

Co-authored-by: Balaji Ganesan <bganesan@nvidia.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@balajinvda
balajinvda requested a review from a team as a code owner July 29, 2026 22:50
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 936f4064-6f12-41d4-b5d3-945f6302c898

📥 Commits

Reviewing files that changed from the base of the PR and between 576cd2f and e608905.

📒 Files selected for processing (1)
  • .github/workflows/bazel.yml

📝 Walkthrough

Walkthrough

The Bazel workflow now skips the build-container job when its matrix is empty and treats that skipped state as valid during verification.

Changes

Bazel workflow gating

Layer / File(s) Summary
Align Bazel matrix gating and verification
.github/workflows/bazel.yml
The bazel job runs only when its build-container matrix is non-empty, and bazel-verification accepts success or skipped results.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • NVIDIA/nvcf#456: Updates Docker-host lane subtree and matrix eligibility in the same Bazel workflow.

Suggested reviewers: famousdirector

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses valid Conventional Commits format and accurately describes the CI workflow fix for docker-host-only PRs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bazel-gate-empty-container-matrix

Comment @coderabbitai help to get the list of available commands.

@balajinvda
balajinvda enabled auto-merge July 29, 2026 22:57
@balajinvda
balajinvda added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 07956c3 Jul 29, 2026
38 checks passed
@balajinvda
balajinvda deleted the fix/bazel-gate-empty-container-matrix branch July 29, 2026 23:33
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