Skip to content

fix(ci): only verify latest instance of each job#2018

Merged
cwrau merged 1 commit intomainfrom
fix/ci/only-use-latest-job-instance-for-checking
Mar 27, 2026
Merged

fix(ci): only verify latest instance of each job#2018
cwrau merged 1 commit intomainfrom
fix/ci/only-use-latest-job-instance-for-checking

Conversation

@cwrau
Copy link
Copy Markdown
Member

@cwrau cwrau commented Mar 13, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Fixed CI/CD workflow check deduplication to improve build reliability. The system now properly filters duplicate job runs, keeping only the latest check instance when determining overall job completion status. This prevents false reports of unfinished checks when the same job runs multiple times.

Copilot AI review requested due to automatic review settings March 13, 2026 10:00
@cwrau cwrau requested a review from a team as a code owner March 13, 2026 10:00
@cwrau cwrau requested review from SyeKlu and removed request for a team March 13, 2026 10:00
@cwrau cwrau enabled auto-merge March 13, 2026 10:00
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 13, 2026

📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/wait-for-checks.yaml
Added jq filtering to deduplicate check_runs by retaining only the latest instance per check name using grouping and max id selection.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • SyeKlu
  • marvinWolff

Poem

🐰 Check runs stack up, oh what a sight,
Duplicates hiding the truth in plain light,
With jq's wise grouping, we filter with care,
Latest id standing, all others laid bare! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: filtering check runs to verify only the latest instance of each job, which directly matches the implemented fix in wait-for-checks.yaml.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ci/only-use-latest-job-instance-for-checking
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can enforce grammar and style rules using `languagetool`.

Configure the reviews.tools.languagetool setting to enable/disable rules and categories. Refer to the LanguageTool Community to learn more.

Copy link
Copy Markdown

@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.

🧹 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 cat is 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

📥 Commits

Reviewing files that changed from the base of the PR and between a055491 and 74c4f5f.

📒 Files selected for processing (1)
  • .github/workflows/wait-for-checks.yaml

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 jq to keep only the latest run per name.

💡 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.

Comment thread .github/workflows/wait-for-checks.yaml
Comment thread .github/workflows/wait-for-checks.yaml
@cwrau cwrau added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit 0cf8e12 Mar 27, 2026
19 of 25 checks passed
@cwrau cwrau deleted the fix/ci/only-use-latest-job-instance-for-checking branch March 27, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants