perf(ci): skip go-bench on PRs unless labeled#19758
Conversation
|
Skipping CI for Draft Pull Request. |
The go-bench PR skip is handled separately in #19758. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
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 runsdocker 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.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>
af1fc2f to
4a7623c
Compare
📝 WalkthroughWalkthroughAdded an Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/unit-tests.yaml (1)
208-212: Prefer dropping--rmand binding Postgres to loopback only.Using
--rmcan remove crash evidence before Line 224 logs are collected; and-p 5432:5432is 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
📒 Files selected for processing (1)
.github/workflows/unit-tests.yaml
The go-bench PR skip is handled separately in #19758. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 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
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:
|
|
Images are ready for the commit at 61a75ec. To use with deploy scripts, first |
Description
Skip
go-benchon pull requests unless the PR has theci-bench-testslabel. 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-testslabel).🤖 Generated with Claude Code