Skip to content

Dispatch merge queue cancellation separately#29441

Queued
electrum wants to merge 1 commit into
trinodb:masterfrom
electrum:fix-cancelled-job-status-icon
Queued

Dispatch merge queue cancellation separately#29441
electrum wants to merge 1 commit into
trinodb:masterfrom
electrum:fix-cancelled-job-status-icon

Conversation

@electrum
Copy link
Copy Markdown
Member

Cancel the merge queue workflow from a separate workflow so that the originally failing job in the merge queue workflow shows as "failed" instead of "cancelled". This makes it easier to tell which one failed.

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

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

This PR adjusts the merge-queue cancellation mechanism so that cancellation is performed by a separate workflow, allowing the original failing job in the merge-queue “ci” workflow to remain concluded as failed (instead of being finalized as cancelled).

Changes:

  • Replaced in-workflow gh run cancel calls with a shared .github/bin/cancel-merge-queue.sh dispatcher script.
  • Added a dedicated cancel-merge-queue-workflow workflow that waits until GitHub records a failed job, then cancels the run.
  • Centralized the cancellation request message formatting and dispatch logic.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/ci.yml Routes merge-group failure-triggered cancellation through a shared dispatcher script.
.github/workflows/cancel-merge-queue-workflow.yml New workflow that waits for failure to be recorded before cancelling the originating run.
.github/bin/cancel-merge-queue.sh New helper script that dispatches the cancellation workflow with run metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/cancel-merge-queue-workflow.yml
@electrum electrum force-pushed the fix-cancelled-job-status-icon branch from 8410832 to 479e170 Compare May 12, 2026 18:57
@electrum
Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR refactors merge queue cancellation across the CI pipeline from scattered inline logic into a centralized, reusable mechanism. A new dispatcher script (.github/bin/cancel-merge-queue-workflow.sh) accepts a job identifier and delegates to a dedicated workflow (.github/workflows/cancel-merge-queue-workflow.yml), which polls for failed jobs and cancels the run. The changes update 10 jobs in the main CI workflow to call this shared script instead of performing cancellation inline, reducing duplication and centralizing cancellation semantics.


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

@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/bin/cancel-merge-queue-workflow.sh (1)

5-5: ⚡ Quick win

Consider validating the required argument.

The script doesn't validate that the failure name argument was provided. While all current call sites provide it, adding a check would improve robustness and provide a clearer error message if called incorrectly in the future.

🛡️ Suggested validation
+if [[ $# -lt 1 ]]; then
+  echo "::error::Usage: $0 <failure-name>"
+  exit 1
+fi
 name="$1"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/bin/cancel-merge-queue-workflow.sh at line 5, Add validation after
the name="$1" assignment to ensure the required argument is provided: check if
the variable name (name) is empty or unset, and if so print a clear error/usage
message to stderr and exit with a non-zero status. Update the script to perform
this guard before proceeding with any further logic that uses name so callers
get a helpful error when the argument is missing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/bin/cancel-merge-queue-workflow.sh:
- Line 5: Add validation after the name="$1" assignment to ensure the required
argument is provided: check if the variable name (name) is empty or unset, and
if so print a clear error/usage message to stderr and exit with a non-zero
status. Update the script to perform this guard before proceeding with any
further logic that uses name so callers get a helpful error when the argument is
missing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b78a90f1-35f5-4b46-942f-e969771aa9a4

📥 Commits

Reviewing files that changed from the base of the PR and between 601ade6 and 479e170.

📒 Files selected for processing (3)
  • .github/bin/cancel-merge-queue-workflow.sh
  • .github/workflows/cancel-merge-queue-workflow.yml
  • .github/workflows/ci.yml

@electrum electrum force-pushed the fix-cancelled-job-status-icon branch from 479e170 to 563cb97 Compare May 12, 2026 19:09
@electrum electrum enabled auto-merge May 12, 2026 20:59
@electrum electrum added this pull request to the merge queue May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants