Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 19, 2025

This PR implements enhanced concurrency policies for GitHub Actions workflows that include issue numbers or pull request numbers in their concurrency groups for better workflow isolation and resource management.

Problem

Previously, workflows triggered by issue or pull request events used generic concurrency groups that could cause unnecessary blocking between unrelated issues/PRs:

# Before: All issue workflows share the same concurrency group
concurrency:
  group: "gh-aw-${{ github.workflow }}"

Solution

The new implementation generates context-aware concurrency groups that include relevant issue/PR numbers:

# Issue workflows now include issue number
concurrency:
  group: "gh-aw-${{ github.workflow }}-${{ github.event.issue.number }}"

# PR workflows include PR number with cancellation
concurrency:
  group: "gh-aw-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
  cancel-in-progress: true

# Mixed workflows handle both contexts
concurrency:
  group: "gh-aw-${{ github.workflow }}-${{ github.event.issue.number || github.event.pull_request.number }}"
  cancel-in-progress: true

Key Changes

  • Modular Architecture: Refactored concurrency generation with buildConcurrencyGroupKeys() for extensible key building
  • Smart Trigger Detection: Added isIssueWorkflow() and isDiscussionWorkflow() helper functions
  • Context-Aware Policies: Different concurrency strategies based on workflow trigger types
  • Extended Support: Added discussion workflow support as an additional trigger benefit
  • Comprehensive Testing: Full test coverage for all new functions and workflow types
  • Documentation: Added comprehensive concurrency policies table to frontmatter documentation

Workflow Types Supported

Trigger Type Concurrency Group Cancellation
issues workflow-${{ github.event.issue.number }}
pull_request workflow-${{ github.event.pull_request.number || github.ref }}
discussion workflow-${{ github.event.discussion.number }}
Mixed issue/PR workflow-${{ github.event.issue.number || github.event.pull_request.number }}
Alias workflows workflow-${{ github.event.issue.number || github.event.pull_request.number }}

This ensures that workflows operating on different issues/PRs can run concurrently while preventing conflicts within the same context.

Fixes #113.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ith modular key building

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] [copilot] concurrency policy for issue/pull_request events should have issue/pr.number Enhance concurrency policy for issue/pull_request events with modular key building Aug 19, 2025
@Copilot Copilot AI requested a review from pelikhan August 19, 2025 13:52
Copilot finished work on behalf of pelikhan August 19, 2025 13:52
@pelikhan
Copy link
Contributor

@copilot update docs with concurrency table

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 19, 2025

@copilot update docs with concurrency table

Updated the frontmatter documentation with a comprehensive concurrency policies table that shows all supported workflow types, their concurrency groups, and cancellation behavior. The table includes examples and benefits of the enhanced concurrency system. See commit 51b34f6.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.contoso.com
    • Triggering command: /tmp/go-build3322705458/b278/cli.test -test.testlogfile=/tmp/go-build3322705458/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of pelikhan August 19, 2025 15:50
@pelikhan pelikhan marked this pull request as ready for review August 19, 2025 15:58
@pelikhan
Copy link
Contributor

@copilot rebuild all workflow lock files

Copy link
Contributor Author

Copilot AI commented Aug 19, 2025

@copilot rebuild all workflow lock files

Successfully rebuilt all workflow lock files using make recompile. The lock files now reflect the enhanced concurrency policies with issue/PR-specific concurrency groups for better workflow isolation. All 4 workflow files were recompiled successfully with validation enabled.

Copilot finished work on behalf of pelikhan August 19, 2025 16:06
@pelikhan pelikhan merged commit aa62695 into main Aug 19, 2025
6 checks passed
@pelikhan pelikhan deleted the copilot/fix-113 branch August 19, 2025 16:20
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.

[copilot] concurrency policy for issue/pull_request events should have issue/pr.number
2 participants