ci(bazel): glob-gate root on main too (drop the every-merge force)#327
Conversation
#311 forced the root row on every push to main to keep the cache warm. That was a workaround for the wrong hypothesis: root was cold because it never uploaded (its .bazelrc --config=remote pinned --remote_upload_local_results=false), not because it ran too rarely. With the upload fix in place and the cache rings not evicting, root only needs to run (and upload) when a ROOT_GLOB file actually changes -- a later root PR reads the closure warmed by the last root-touching merge. Forcing root on every merge just spun up a ~7k-target job for docs- and helm-only merges that warm nothing new. Make root purely glob-gated on merges as it already is on PRs; keep the main-push upload (CACHE_UPLOAD) so warming still happens whenever root runs. Co-authored-by: Balaji Ganesan <bganesan@nvidia.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Bazel workflow no longer passes ChangesBazel matrix detection
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8).github/workflows/bazel.ymlTraceback (most recent call last): Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/bazel.yml:
- Around line 152-162: Expand the root-gate matching around ROOT_GLOBS to
include WORKSPACE, WORKSPACE.bazel, go.work, go.work.bazel, and root-level *.bzl
changes, keeping behavior consistent with the full-build triggers in the
target-selection logic. Use a matcher that supports the literal root-level *.bzl
pattern, since the current fixed-prefix awk check cannot interpret it;
preferably reuse a canonical root-global matcher if one exists.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 5e83c395-8a76-49be-938b-fa5ca669add3
📒 Files selected for processing (1)
.github/workflows/bazel.yml
With the force-root-on-every-merge removed, root is selected only when a ROOT_GLOB matches. ROOT_GLOBS omitted WORKSPACE, WORKSPACE.bazel, go.work, go.work.bazel, and root-level *.bzl, all of which the target-selection logic treats as full-build triggers. A change to one of them (go.work.bazel exists today) would select zero matrix rows and pass without running Bazel. Add the fixed-name files to ROOT_GLOBS and gate root on root-level *.bzl with a grep, since the awk fixed-prefix check cannot match a literal *.bzl pattern. Addresses the CodeRabbit review comment on this PR. Co-authored-by: Balaji Ganesan <bganesan@nvidia.com>
Why
#311 forced the
rootrow on every push to main to keep the remote cache warm. That was a workaround for the wrong hypothesis. The real reason root was always cold was that it never uploaded: root's.bazelrc--config=remotepinned--remote_upload_local_results=false, so even when root ran on a root-change merge it warmed nothing. That is fixed (forceupload=trueon main +.bazelrcconsistency).With the upload fix in place and the cache rings not evicting, root only needs to run when a
ROOT_GLOBfile changes: a later root PR reads the closure warmed by the last root-touching merge. Forcing root on every merge just spun up the ~7k-target build for docs- and helm-only merges that warm nothing new.What changed
is_main_pushforce in the detect job. Root is now purely glob-gated on merges, exactly as it already is on PRs — a docs- or helm-only change never triggers root.CACHE_UPLOAD), so root still warms the cache whenever it does run.REFenv.Testing
YAML parses; the detect
run:block passesbash -n. A docs-only merge will no longer schedule the root row.Issues
Relates to #283
References
Refines the warming approach from #311.
Dependencies
None
Summary by CodeRabbit
*.bzlchanges are now properly detected for triggering root builds.