Skip to content

Remove frontmatter concurrency_policy support, implement code-based concurrency rules#105

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/fix-104
Closed

Remove frontmatter concurrency_policy support, implement code-based concurrency rules#105
Copilot wants to merge 4 commits intomainfrom
copilot/fix-104

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 19, 2025

This PR removes the ability for users to specify concurrency_policy in workflow frontmatter and implements all concurrency rules directly in Go code based on workflow trigger types.

Problem

The previous implementation allowed users to define custom concurrency policies in their workflow frontmatter using the concurrency_policy field. This added complexity to the user interface and exposed internal implementation details through the schema.

Solution

Removed Frontmatter Support

Users can no longer specify concurrency_policy in their workflow frontmatter. The field is completely removed from parsing and schema validation.

Code-Based Policy Generation

All concurrency rules are now implemented directly in Go code with intelligent defaults based on workflow characteristics:

  • Pull Request workflows: Use gh-aw-${{ github.workflow }}-${{ github.ref }} with cancel-in-progress: true
  • Issue workflows: Use gh-aw-${{ github.workflow }}-${{ github.event.issue.number || github.event.pull_request.number }} with cancel-in-progress: true
  • Alias workflows: Use issue/PR number grouping but without cancellation enabled
  • Schedule/Manual workflows: Use basic gh-aw-${{ github.workflow }} grouping without cancellation
  • Other workflows: Use basic gh-aw-${{ github.workflow }} grouping without cancellation

User Override Support Maintained

The existing concurrency field in frontmatter continues to work and takes precedence over auto-generated policies, ensuring backward compatibility for users with specific concurrency requirements.

Key Benefits

  • Simplified User Interface: Users no longer need to understand complex policy syntax
  • Consistent Behavior: All workflows get appropriate concurrency settings automatically
  • Reduced Complexity: Removes parsing logic and schema validation for internal fields
  • Backward Compatible: Existing concurrency field overrides still work

Technical Implementation

  • Removed parseConcurrencyPolicyFromFrontmatter() and related parsing functions
  • Simplified GenerateConcurrencyConfigWithFrontmatter() to use only code-based rules
  • Removed concurrency_policy field filtering from schema validation
  • Updated tests to focus on code-based policy generation rather than frontmatter parsing
  • Maintained existing policy computation logic for different workflow trigger types

This change makes the concurrency system more predictable and easier to maintain while providing users with sensible defaults that work well for most use cases.

Fixes #104.


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

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] concurrency policy Implement sophisticated concurrency policy computation system for GitHub Agentic Workflows Aug 19, 2025
Copilot AI requested a review from pelikhan August 19, 2025 06:10
}
]
},
"concurrency_policy": {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot remove this field and instead maintain policy internally only in golang.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the concurrency_policy field from the JSON schema as requested. The field is now processed internally by Go code only - users can still define it in frontmatter but it's filtered out during schema validation. This maintains all functionality while keeping the policy logic internal. See commit 820cd8b.

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

Copilot AI commented Aug 19, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

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-build3472697713/b278/cli.test -test.testlogfile=/tmp/go-build3472697713/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build1173761122/b278/cli.test -test.testlogfile=/tmp/go-build1173761122/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build690550344/b278/cli.test -test.testlogfile=/tmp/go-build690550344/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 AI changed the title Implement sophisticated concurrency policy computation system for GitHub Agentic Workflows Implement sophisticated concurrency policy computation system with internal processing Aug 19, 2025
Copilot AI requested a review from pelikhan August 19, 2025 11:24
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot remove support for specifying concurrency_policy in the frontmatter. The different rules should be done in code.

…only

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

Copilot AI commented Aug 19, 2025

@copilot remove support for specifying concurrency_policy in the frontmatter. The different rules should be done in code.

Removed support for specifying concurrency_policy in frontmatter entirely. All concurrency rules are now implemented directly in Go code based on workflow trigger types (issues, pull requests, schedule, etc.). The policy computation system still provides sophisticated concurrency rules, but users can no longer customize them via frontmatter - they are purely code-based. See commit bd3166d.

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-build2592620781/b278/cli.test -test.testlogfile=/tmp/go-build2592620781/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build1424743779/b278/cli.test -test.testlogfile=/tmp/go-build1424743779/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 AI changed the title Implement sophisticated concurrency policy computation system with internal processing Remove frontmatter concurrency_policy support, implement code-based concurrency rules Aug 19, 2025
@pelikhan pelikhan closed this Aug 19, 2025
@pelikhan pelikhan deleted the copilot/fix-104 branch September 17, 2025 15:14
@github-actions github-actions bot mentioned this pull request Mar 17, 2026
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.

concurrency policy

2 participants