Add github.ref to concurrency configuration for push workflows - #818
Merged
Conversation
- Add isPushWorkflow() function to detect push triggers - Modify buildConcurrencyGroupKeys() to include github.ref for push workflows - Update tests to verify push workflows include github.ref - Add comprehensive test cases for push and mixed workflows - All tests passing, code formatted and linted Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] The default concurrency level should have github.ref if the triggers contain
Add github.ref to concurrency configuration for push workflows
Sep 14, 2025
push or pull-request
pelikhan
approved these changes
Sep 14, 2025
pelikhan
marked this pull request as ready for review
September 14, 2025 16:16
Collaborator
|
@copilot merge origin/main |
Contributor
Author
I cannot perform git merge operations directly as I don't have access to commit/push changes using git commands. There is one commit in main ( |
…5bfc-42fe-b8fd-f5bdce87de8f
pelikhan
deleted the
copilot/fix-bd5b284d-5bfc-42fe-b8fd-f5bdce87de8f
branch
September 14, 2025 16:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the concurrency configuration for workflows with
pushtriggers to includegithub.ref, ensuring proper isolation between different branches and refs.Problem
Previously, workflows with
pushtriggers only used the workflow name in their concurrency group:This meant that pushes to different branches (e.g.,
main,develop,feature/xyz) would all share the same concurrency group, potentially causing unintended workflow cancellations or queueing across branches.Solution
The concurrency configuration now includes
github.reffor push workflows:This ensures that:
mainget concurrency group:"gh-aw-MyWorkflow-refs/heads/main"developget concurrency group:"gh-aw-MyWorkflow-refs/heads/develop"Implementation Details
isPushWorkflow()function to detect workflows with push triggersbuildConcurrencyGroupKeys()to appendgithub.reffor push workflows${{ github.event.pull_request.number || github.ref }}as beforeExamples
Pure push workflow:
Generates:
Mixed push + pull request workflow:
Generates (PR logic takes priority):
Testing
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/tmp/go-build3644294473/b278/cli.test -test.testlogfile=/tmp/go-build3644294473/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true(dns block)/tmp/go-build4271198390/b278/cli.test -test.testlogfile=/tmp/go-build4271198390/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:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.