ci(perf): Add pending comment before benchmark runs#1267
Conversation
Post a "ベンチマーク取得中..." comment on the PR immediately when the workflow starts, so users know the benchmark is in progress. If a comment already exists, it gets updated to the pending state on each CI run. The final results overwrite this comment once benchmarks complete. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughUpdated GitHub Actions workflow permissions structure by adding top-level Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Deploying repomix with
|
| Latest commit: |
18491be
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://79d7cf3f.repomix.pages.dev |
| Branch Preview URL: | https://ci-perf-benchmark-pending-co.repomix.pages.dev |
Merge the separate PR and main columns into a single "main → PR" column to make it easier to see how performance changed at a glance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
⚡ Performance Benchmark
Details
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1267 +/- ##
=======================================
Coverage 87.18% 87.18%
=======================================
Files 115 115
Lines 4324 4324
Branches 1002 1002
=======================================
Hits 3770 3770
Misses 554 554 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adopt a key-value table layout inspired by Cloudflare Pages deployment comments. Shows latest commit and status in a unified table, with benchmark results as rows in the same table on completion. Details moved to a collapsible section. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/perf-benchmark.yml (1)
141-145:⚠️ Potential issue | 🟠 MajorUpdate the comment job to run even when a benchmark matrix leg fails.
With
needs: benchmark, GitHub Actions applies an implicitsuccess()check that skips this job if the benchmark job fails. The!cancelled()condition does not override this implicit check. Sincefail-fast: falseallows individual matrix legs to fail, the PR comment remains stuck on "Benchmark in progress..." even though the report code already handles missing artifacts gracefully.Suggested fix
comment: name: Comment Results needs: benchmark runs-on: ubuntu-latest - if: ${{ !cancelled() }} + if: ${{ always() && !cancelled() }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/perf-benchmark.yml around lines 141 - 145, The comment job is being skipped when the benchmark job fails due to the implicit success() check from needs: benchmark; update the job "comment" to override that by changing its if condition to use always() and preserve the cancelled guard (e.g., set the if expression to always() && !cancelled()) so the job runs even if individual benchmark matrix legs fail while still skipping on cancellation; keep needs: benchmark to maintain ordering.
🤖 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/perf-benchmark.yml:
- Around line 16-19: The workflow runs post-pending and benchmark in parallel;
add a job dependency so benchmark waits for post-pending: in the benchmark job
block (job name "benchmark") add needs: post-pending and replace/augment its if
with if: ${{ always() && !cancelled() }} so the benchmark job will only start
after post-pending completes while still running when post-pending is skipped
(due to forks) and honoring cancellations.
---
Outside diff comments:
In @.github/workflows/perf-benchmark.yml:
- Around line 141-145: The comment job is being skipped when the benchmark job
fails due to the implicit success() check from needs: benchmark; update the job
"comment" to override that by changing its if condition to use always() and
preserve the cancelled guard (e.g., set the if expression to always() &&
!cancelled()) so the job runs even if individual benchmark matrix legs fail
while still skipping on cancellation; keep needs: benchmark to maintain
ordering.
🪄 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: Pro
Run ID: 13c3fdc5-ac58-4811-b626-c2609b130c28
📒 Files selected for processing (1)
.github/workflows/perf-benchmark.yml
This comment has been minimized.
This comment has been minimized.
HTML <table> doesn't require a header row, matching the clean look of Cloudflare Pages deployment comments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
macOS GitHub Actions runners (M1 Mac mini) show higher variance due to Spotlight indexing, thermal throttling, and shared hardware. Increase measurement runs from 10 to 20 for macOS to stabilize the median. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
- Move pull-requests: write to job-level permissions on post-pending and comment jobs only, so the benchmark job (which executes untrusted PR code) does not get unnecessary write access - Use always() && !cancelled() on comment job to ensure pending comment is overwritten even when benchmark fails - Fix details text to reflect macOS using 20 measurement runs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
…crets These workflows use repository-level secrets (CODECOV_TOKEN, CLAUDE_CODE_OAUTH_TOKEN, COMMITTER_TOKEN) without dedicated environments, which is acceptable for this project's threat model. Adding dedicated environments would add overhead without meaningful security benefit for these use cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
The rule was added in zizmor v1.23.x. The previous config used secrets-inherit which is a different rule. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Review (Consolidated)This PR has been reviewed across multiple iterations. All previously raised issues have been addressed. Here's the final status: All feedback resolved
Summary
Verdict: LGTM — no remaining issues. Ready to merge. 🤖 Generated with Claude Code |
Add a
post-pendingjob that immediately posts a "Benchmark in progress..." comment (Cloudflare Pages style) when the workflow starts. If a comment already exists, it gets updated to the pending state on each CI run. The final results overwrite this comment once benchmarks complete.Changes
post-pendingjob: posts/updates a pending comment in parallel with benchmark executionpull-requests: writeto workflow-level permissions (needed by bothpost-pendingandcommentjobs)Checklist
npm run testnpm run lint