fix(ci): only verify latest instance of each job#2018
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
📝 WalkthroughWalkthroughThe GitHub Actions workflow script now deduplicates check_run results by filtering aggregated runs to retain only the latest instance per check name using jq grouping and maximum id selection, preventing multiple instances of the same job from being treated as separate unfinished checks. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 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)
📝 Coding Plan
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 Tip CodeRabbit can enforce grammar and style rules using `languagetool`.Configure the |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/wait-for-checks.yaml (1)
62-62: Logic for deduplicating check runs is correct.The
group_by(.name) | map(max_by(.id))approach correctly keeps only the latest instance of each job, which fixes the issue of stale job instances being treated as unfinished checks.Minor style nit: the
catis unnecessary here.,
♻️ Optional: Remove useless use of cat
- cat "$all_runs_file" | jq '.check_runs |= (group_by(.name) | map(max_by(.id)))' # only use the latest instance of each job + jq '.check_runs |= (group_by(.name) | map(max_by(.id)))' "$all_runs_file" # only use the latest instance of each job🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/wait-for-checks.yaml at line 62, Remove the useless use of cat in the pipeline: instead of piping cat "$all_runs_file" into jq, call jq directly with the file as an argument and the same filter (the existing jq filter is correct: group_by(.name) | map(max_by(.id))). Update the invocation that currently uses cat "$all_runs_file" | jq '...' to pass "$all_runs_file" directly to jq so the deduplication logic (group_by/.name + max_by/.id) remains unchanged but without the unnecessary cat.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/wait-for-checks.yaml:
- Line 62: Remove the useless use of cat in the pipeline: instead of piping cat
"$all_runs_file" into jq, call jq directly with the file as an argument and the
same filter (the existing jq filter is correct: group_by(.name) |
map(max_by(.id))). Update the invocation that currently uses cat
"$all_runs_file" | jq '...' to pass "$all_runs_file" directly to jq so the
deduplication logic (group_by/.name + max_by/.id) remains unchanged but without
the unnecessary cat.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 77320f3a-9e54-42ce-8986-abafc3ff4b47
📒 Files selected for processing (1)
.github/workflows/wait-for-checks.yaml
There was a problem hiding this comment.
Pull request overview
Updates the wait-for-checks GitHub Actions workflow to avoid treating multiple reruns/restarts of the same job as distinct checks by collapsing check runs to the latest instance per job.
Changes:
- Post-processes the GitHub API check run payload with
jqto keep only the latest run pername.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Summary by CodeRabbit