Skip to content

perf(ci): skip go-bench on PRs unless labeled#19758

Draft
davdhacs wants to merge 4 commits intomasterfrom
davdhacs/skip-bench-on-prs
Draft

perf(ci): skip go-bench on PRs unless labeled#19758
davdhacs wants to merge 4 commits intomasterfrom
davdhacs/skip-bench-on-prs

Conversation

@davdhacs
Copy link
Copy Markdown
Contributor

@davdhacs davdhacs commented Apr 1, 2026

Description

Skip go-bench on pull requests unless the PR has the ci-bench-tests label. Benchmarks are uncacheable (~20m) and don't provide signal for typical PR changes.

Follows the existing label pattern: ci-race-tests, ci-release-build.

Testing and quality

How I validated my change

CI — go-bench should be run or skipped on this PR (depending on ci-bench-tests label).

🤖 Generated with Claude Code

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 1, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

davdhacs added a commit that referenced this pull request Apr 1, 2026
The go-bench PR skip is handled separately in #19758.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider adding explicit cleanup for the Postgres container (e.g., a final step with if: always() that runs docker rm -f postgres || true) so failed or cancelled jobs don’t leave stray containers on the runner.
  • You might simplify the readiness check by using Docker healthchecks on the Postgres container (e.g., --health-cmd pg_isready ... and polling container health) instead of a custom shell loop.
  • Once the container removal is validated, ensure the commented if: github.event_name == 'push' condition is actually re-enabled so the workflow behavior matches the description about skipping benchmarks on PRs.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding explicit cleanup for the Postgres container (e.g., a final step with `if: always()` that runs `docker rm -f postgres || true`) so failed or cancelled jobs don’t leave stray containers on the runner.
- You might simplify the readiness check by using Docker healthchecks on the Postgres container (e.g., `--health-cmd pg_isready ...` and polling container health) instead of a custom shell loop.
- Once the container removal is validated, ensure the commented `if: github.event_name == 'push'` condition is actually re-enabled so the workflow behavior matches the description about skipping benchmarks on PRs.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Benchmarks are uncacheable (~20m) and don't provide signal for
typical PR changes. Run only on pushes to master/release branches,
or when a PR has the `ci-bench-tests` label (following the existing
`ci-race-tests`, `ci-release-build` label pattern).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davdhacs davdhacs force-pushed the davdhacs/skip-bench-on-prs branch from af1fc2f to 4a7623c Compare April 1, 2026 21:58
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

📝 Walkthrough

Walkthrough

Added an if: condition to the go-bench job in the CI workflow so the job runs only on push events or when a pull request carries the ci-bench-tests label. No other steps or commands were modified.

Changes

Cohort / File(s) Summary
Workflow Configuration
.github/workflows/unit-tests.yaml
Added an if: conditional to the go-bench job to skip execution unless the workflow is triggered by a push or the PR includes the ci-bench-tests label. No other changes to job steps or services.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and concisely summarizes the main change: skipping go-bench on pull requests unless labeled, which aligns with the core modification in the workflow file.
Description check ✅ Passed The PR description adequately explains the change: skipping go-bench on PRs unless labeled, addressing performance concerns. However, it lacks detail on validation and omits several template sections.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch davdhacs/skip-bench-on-prs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/unit-tests.yaml (1)

208-212: Prefer dropping --rm and binding Postgres to loopback only.

Using --rm can remove crash evidence before Line 224 logs are collected; and -p 5432:5432 is broader than needed. Binding to localhost plus keeping container metadata improves debugging and tightens exposure.

Suggested patch
-        docker run --rm -d --name postgres \
+        docker run -d --name postgres \
           -e POSTGRES_HOST_AUTH_METHOD=trust \
           -e POSTGRES_INITDB_ARGS="--locale=C" \
-          -p 5432:5432 \
+          -p 127.0.0.1:5432:5432 \
           docker.io/library/postgres:15
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/unit-tests.yaml around lines 208 - 212, The docker run
invocation that starts the Postgres container (the command using --rm, --name
postgres, and -p 5432:5432) should drop the --rm flag so container state/exit
logs remain available for debugging, and restrict port binding to loopback by
replacing -p 5432:5432 with -p 127.0.0.1:5432:5432 (or --publish
127.0.0.1:5432:5432) to avoid exposing Postgres on all interfaces; leave --name
postgres intact so the container is still easily referenced in subsequent
cleanup/logging steps.
🤖 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/unit-tests.yaml:
- Around line 180-182: The benchmark job is still running on PRs because the
push-only guard was left as a TODO; update the GitHub Actions job that runs the
benchmarks (the job named "go-bench") to include the condition "if:
github.event_name == 'push'" so the job only triggers on push events (place this
at the job level alongside runs-on and other top-level job keys), ensuring
benchmarks are skipped for pull_request events and CI time is reduced.

---

Nitpick comments:
In @.github/workflows/unit-tests.yaml:
- Around line 208-212: The docker run invocation that starts the Postgres
container (the command using --rm, --name postgres, and -p 5432:5432) should
drop the --rm flag so container state/exit logs remain available for debugging,
and restrict port binding to loopback by replacing -p 5432:5432 with -p
127.0.0.1:5432:5432 (or --publish 127.0.0.1:5432:5432) to avoid exposing
Postgres on all interfaces; leave --name postgres intact so the container is
still easily referenced in subsequent cleanup/logging steps.
🪄 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: 66f805de-b65d-4818-be82-0a650a8012b5

📥 Commits

Reviewing files that changed from the base of the PR and between 73cac11 and af1fc2f.

📒 Files selected for processing (1)
  • .github/workflows/unit-tests.yaml

@davdhacs davdhacs changed the title perf(ci): skip go-bench on PRs, remove container perf(ci): skip go-bench on PRs unless labeled Apr 1, 2026
davdhacs added a commit that referenced this pull request Apr 1, 2026
The go-bench PR skip is handled separately in #19758.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davdhacs davdhacs added ci-build-race-condition-debug Build a `-race` image tagged with `-rcd`. Required for `/test gke-race-condition-qa-e2e-tests`. ci-bench-tests Run go-bench benchmark tests. and removed ci-build-race-condition-debug Build a `-race` image tagged with `-rcd`. Required for `/test gke-race-condition-qa-e2e-tests`. labels Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.60%. Comparing base (73cac11) to head (61a75ec).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19758   +/-   ##
=======================================
  Coverage   49.60%   49.60%           
=======================================
  Files        2760     2760           
  Lines      208144   208144           
=======================================
  Hits       103242   103242           
  Misses      97237    97237           
  Partials     7665     7665           
Flag Coverage Δ
go-unit-tests 49.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Apr 1, 2026

Images are ready for the commit at 61a75ec.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-531-g61a75ec2ac.

@davdhacs davdhacs removed the ci-bench-tests Run go-bench benchmark tests. label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants