chore(ci): skip CLI build on pull requests to reduce build time#19817
chore(ci): skip CLI build on pull requests to reduce build time#19817janisz wants to merge 1 commit intoROX-33958/resue-componentsfrom
Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
Build CLIstep'sifcondition always evaluatesgithub.event.pull_request.labels.*.nameeven for non-pull_requestevents, which will fail whengithub.event.pull_requestis undefined; wrap the label check in angithub.event_name == 'pull_request' && …guard or split conditions so label access only happens on PR events. - Similarly, the
PR labelsstep should be conditioned to run only forpull_requestevents to avoid invokingjoerick/pr-labels-actionwhen the event payload has no PR context.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `Build CLI` step's `if` condition always evaluates `github.event.pull_request.labels.*.name` even for non-`pull_request` events, which will fail when `github.event.pull_request` is undefined; wrap the label check in an `github.event_name == 'pull_request' && …` guard or split conditions so label access only happens on PR events.
- Similarly, the `PR labels` step should be conditioned to run only for `pull_request` events to avoid invoking `joerick/pr-labels-action` when the event payload has no PR context.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Caution Review failedFailed to post review comments 📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR centralizes runtime entrypoints by adding Changes
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/build.yaml:
- Around line 241-248: The "Build CLI" job step's conditional omits manual runs
— update the if condition used in the "Build CLI" step to also allow
github.event_name == 'workflow_dispatch' (i.e., include 'workflow_dispatch' in
the OR chain alongside 'push', 'workflow_call', and the label check) so
manually-triggered workflows will run make cli and produce real CLI binaries.
🪄 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: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: a37c6f55-f3dc-402c-b782-366a51ee6014
📒 Files selected for processing (1)
.github/workflows/build.yaml
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## ROX-33958/resue-components #19817 +/- ##
===========================================================
Coverage 49.60% 49.60%
===========================================================
Files 2763 2763
Lines 208254 208254
===========================================================
Hits 103309 103309
Misses 97278 97278
Partials 7667 7667
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🚀 Build Images ReadyImages are ready for commit 961885c. To use with deploy scripts: export MAIN_IMAGE_TAG=4.11.x-559-g961885cc5c |
7e2871a to
cc20ba4
Compare
User request: Speed up build.yaml by skipping CLI builds on PRs. Problem: The pre-build-cli job compiles roxctl and roxagent for 11 platform/architecture combinations, taking 5-10 minutes per PR build. These binaries are rarely needed for PR testing. Solution: Always create stub text files (fast ~2s), then conditionally build real CLI binaries that overwrite stubs. Go cache is skipped when CLI won't be built. This preserves artifact structure without requiring Dockerfile or Makefile changes. Stub creation is unconditional (fast) for simplicity. Build CLI step overwrites stubs when needed. Build conditions (CLI compilation runs when): - GOTAGS=release: Tagged releases - master branch: Nightly builds - workflow_call: Release-ci.yaml calls - ci-build-cli label: Developer explicitly requests Impact: - PRs without label: ~5-10 min savings (stubs used, cache skipped) - Master/releases: No change (real binaries built) - Developers needing CLI: Add ci-build-cli label to PR Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
961885c to
b4a6ac5
Compare
|
/konflux-retest central-db-on-push |
|
/konflux-retest main-on-push |
|
/konflux-retest scanner-v4-on-push |
1 similar comment
|
/konflux-retest scanner-v4-on-push |
|
/konflux-retest operator-on-push |
|
/konflux-retest main-on-push |
|
/konflux-retest operator-on-push |
|
/konflux-retest roxctl-on-push |
|
/konflux-retest main-on-push |
|
/konflux-retest scanner-v4-on-push |
|
/konflux-retest roxctl-on-push |
1 similar comment
|
/konflux-retest roxctl-on-push |
|
/konflux-retest operator-on-push |
|
@janisz: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/konflux-retest operator-bundle-on-push |
2 similar comments
|
/konflux-retest operator-bundle-on-push |
|
/konflux-retest operator-bundle-on-push |
Description
Problem: The pre-build-cli job compiles roxctl and roxagent for 11 platform/architecture combinations, taking 5-10 minutes per PR build. These binaries are rarely needed for PR testing.
Solution: Create stub text files before compilation, then conditionally run the build. On PRs without the ci-build-cli label, stubs remain and compilation is skipped. On pushes, workflow_call, or labeled PRs, real binaries overwrite stubs. This preserves artifact structure without requiring Dockerfile or Makefile changes.
Impact:
See: https://redhat-internal.slack.com/archives/CELUQKESC/p1775031436674199
User-facing documentation
Testing and quality
Automated testing
How I validated my change
CI