Skip to content

Keep no-op comment runs out of the PR coverage cancellation group - #300

Draft
Saurabh Singh (saurabh500) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-pr-coverage-cancel-issue
Draft

Keep no-op comment runs out of the PR coverage cancellation group#300
Saurabh Singh (saurabh500) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-pr-coverage-cancel-issue

Conversation

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

PR Code Coverage triggers on every issue_comment, and GitHub resolves concurrency at run creation — before the job if: runs. So an ordinary review comment created a run that joined pr-coverage-<n>, cancelled the in-flight pull_request run mid-wait (the artifact wait is up to 1h15m), and then concluded skipped itself. Any PR under review effectively lost its coverage run and showed a red check.

Changes

  • Concurrency group is now conditional on whether the run will do work. Runs that the coverage-report job will skip get a unique -noop-<run_id> suffix, so they share a group with nothing and cancel nothing.
  • Real runs keep the shared per-PR group, so a new push still supersedes a stale wait — the original intent of cancel-in-progress.
  • The predicate mirrors the full job if:, not just the /coverage prefix, so fork pull_request events and non-maintainer comments are also treated as no-ops. A comment marks the two as needing to stay in sync.
concurrency:
  group: >-
    pr-coverage-${{ github.event.pull_request.number || github.event.issue.number }}${{
    !((github.event_name == 'pull_request' &&
    github.event.pull_request.head.repo.full_name == github.repository) ||
    (github.event_name == 'issue_comment' &&
    github.event.issue.pull_request != null &&
    startsWith(github.event.comment.body, '/coverage') &&
    contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)))
    && format('-noop-{0}', github.run_id) || '' }}
  cancel-in-progress: true

Skipped runs still appear as skipped exactly as before; only their group membership changes. The folded scalar collapses to a single-line expression, so no newlines leak into the group value.

Co-authored-by: saurabh500 <1623701+saurabh500@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cancellation of PR coverage run on comments Keep no-op comment runs out of the PR coverage cancellation group Aug 15, 2026
@saurabh500
Saurabh Singh (saurabh500) requested a balanced review from Copilot August 15, 2026 15:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Prevents no-op comment-triggered coverage runs from cancelling active PR coverage runs.

Changes:

  • Gives skipped runs unique concurrency groups.
  • Preserves per-PR cancellation for real coverage runs.
  • Mirrors the job execution predicate in concurrency handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

PR coverage run is cancelled by any PR comment, including comments the job skips

3 participants