Skip to content

ci-validation: keep push and pull_request runs from cancelling each other - #87

Merged
HereLiesAz merged 1 commit into
mainfrom
claude/ci-validation-event-concurrency
Sep 27, 2026
Merged

HereLiesAz merged 1 commit into
mainfrom
claude/ci-validation-event-concurrency

Conversation

@HereLiesAz

@HereLiesAz HereLiesAz commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

A branch with an open PR gets a push and a pull_request event for the same commit. The gateway's normalizeWebhookContext gives both the same refName (the branch), so both dispatches landed in the same ci-validation-<repo>-<ref>-<path> concurrency group. The second run cancelled the first, and the tracker watching the first reported validate_node: cancelled as a failure. That happened on HereLiesAz/azphalt#231 and #232.

The fix adds inputs.target_event_name, which is a required input, to the group:

  • a push run and a PR run for the same commit no longer cancel each other;
  • a newer push still cancels the older push run, and a newer PR update still cancels the older PR run.

Trade-off: a branch with an open PR now runs validation twice per commit, once per event. Stopping that would need the gateway to drop one of the two events, and it can't do that across the board, because some workflows (for example the OpenCode review, which comments on the PR) need the PR event. ci-validation.yml is the only workflow that keys its group on the ref this way.

audit_workflow_collection.py and every scripts/test_*.py pass, and the YAML parses.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QwYWVPse8spRrfMMcuTJPv


Generated by Claude Code

Summary by Sourcery

Separate ci-validation concurrency groups by triggering event so push and pull_request runs no longer interfere with each other.

Bug Fixes:

  • Prevent push and pull_request validation runs for the same commit from cancelling each other and being reported as failures.

Enhancements:

  • Keep cancellation behavior between successive runs of the same event type while allowing push and pull_request runs to proceed independently.

CI:

  • Include the triggering event name in ci-validation concurrency groups.

…ther

A branch with an open PR sends a push and a pull_request event for the
same commit. Both landed in one concurrency group, so the second run
cancelled the first and its tracker reported the cancelled job as a
failure. The event name now separates them; newer runs of the same event
still cancel older ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QwYWVPse8spRrfMMcuTJPv
@sourcery-ai

sourcery-ai Bot commented Sep 27, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates ci-validation concurrency grouping to include the target event name, preventing push and pull_request runs for the same branch and commit from cancelling each other while retaining latest-run cancellation within each event type.

Sequence diagram for event-specific CI validation cancellation

sequenceDiagram
    participant Push as push run
    participant PR as pull_request run
    participant Group as Concurrency group
    participant Tracker as Validation tracker

    Push->>Group: ci-validation-repo-ref-path-push
    PR->>Group: ci-validation-repo-ref-path-pull_request
    Group-->>Push: Keep running
    Group-->>PR: Keep running
    Push->>Tracker: validate_node
    PR->>Tracker: validate_node

    opt Newer push arrives
        Push->>Group: Replace push group
        Group-->>Push: cancel-in-progress
    end

    opt Newer pull_request update arrives
        PR->>Group: Replace pull_request group
        Group-->>PR: cancel-in-progress
    end
Loading

File-Level Changes

Change Details Files
Separate concurrency cancellation domains by webhook event type.
  • Append the required target event name to the validation concurrency group key.
  • Preserve cancellation of superseded runs within the same push or pull_request event stream.
.github/workflows/ci-validation.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
workflows 8d7a428 Commit Preview URL

Branch Preview URL
Sep 27 2026, 09:21 PM

@HereLiesAz
HereLiesAz marked this pull request as ready for review September 27, 2026 21:39
@HereLiesAz
HereLiesAz merged commit aed6248 into main Sep 27, 2026
3 checks passed
@HereLiesAz
HereLiesAz deleted the claude/ci-validation-event-concurrency branch September 27, 2026 21:39

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @HereLiesAz, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 23 hours and 43 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

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.

2 participants