Skip to content

feat: add concurrency group to conclusion job using workflow ID#19616

Merged
pelikhan merged 4 commits intomainfrom
copilot/emit-concurrent-group-conclusion-job
Mar 4, 2026
Merged

feat: add concurrency group to conclusion job using workflow ID#19616
pelikhan merged 4 commits intomainfrom
copilot/emit-concurrent-group-conclusion-job

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Concurrent agents running the same workflow could have their conclusion jobs interfere with each other since no job-level concurrency was set.

Changes

  • notify_comment.go: buildConclusionJob now sets a job-level concurrency group of the form gh-aw-conclusion-{workflow_id} (derived from the markdown filename) with cancel-in-progress: false, matching the pattern used by the safe_outputs job
  • notify_comment_test.go: Added TestConclusionJobConcurrencyGroup covering both the non-empty and empty WorkflowID cases
  • Lock files: All 164 .lock.yml files recompiled with the new field

Resulting YAML

conclusion:
  concurrency:
    group: "gh-aw-conclusion-my-workflow"
    cancel-in-progress: false

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:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD ode-gyp-bin/sh go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE go ache�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD FFiles,SFiles,Sw-json go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha npx prettier --check '**/*.cjs' GOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go sh -c "prettier" --cheremote.origin.url go 64/bin/go tierignore GO111MODULE 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha npx prettier --check '**/*.cjs' GOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK run-script/lib/nxterm-color sh -c "prettier" --check 'scripts/**/*GOSUMDB go 64/bin/go tierignore GO111MODULE 64/bin/go go (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env ck '**/*.cjs' '*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha q1o1Cfb1s GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE ortcfg env d/gh-aw/main.go d/gh-aw/capitaliGOMOD 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGOPROXY (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha heck '**/*.cjs' GOINSECURE GO111MODULE $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go m/_n�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)

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

Original prompt

Emit a concurrent group using the workflow id for the conclusion job so that concurrent agents on the same workflow do not interfere.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Changeset

  • Type: patch
  • Description: Prevent conclusion jobs from colliding across concurrent agents by setting a workflow-specific concurrency group for the conclusion job.

Generated by Changeset Generator for issue #19616 ·

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.



✨ PR Review Safe Output Test - Run 22676642058

💥 [THE END] — Illustrated by Smoke Claude ·

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Emit concurrent group using workflow ID for conclusion job feat: add concurrency group to conclusion job using workflow ID Mar 4, 2026
@pelikhan pelikhan added the smoke label Mar 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready.

@pelikhan pelikhan marked this pull request as ready for review March 4, 2026 15:42
Copilot AI review requested due to automatic review settings March 4, 2026 15:42
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.53.0
jq 1.7
yq 4.52.4
curl 8.5.0
gh 2.87.3
node 20.20.0
python3 3.12.3
go 1.24.13
java 10.0.102
dotnet 10.0.102

Result: 12/12 tools available ✅

Overall Status: PASS

🔧 Tool validation by Agent Container Smoke Test ·

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Commit pushed: 76bc842

Generated by Changeset Generator

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🧪 Smoke Test Results for §22676642022

Test Result
GitHub MCP
Safe Inputs GH CLI
Serena MCP
Playwright
Web Fetch
File Writing
Bash Tool
Discussion Interaction
Build gh-aw
Discussion Creation
Workflow Dispatch
PR Review

Overall: PASS (11/12, Serena MCP not available)

@pelikhan @Copilot

📰 BREAKING: Report filed by Smoke Copilot ·

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR adds a concurrency group (gh-aw-conclusion-{workflow-id}) to the conclusion job, preventing race conditions when multiple agent runs fire simultaneously on the same workflow. The implementation is clean and well-tested. cancel-in-progress: false is the right choice for safe-output jobs that must complete their writes.

📰 BREAKING: Report filed by Smoke Copilot

}
})
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice table-driven tests! One minor note: the test directly accesses job.Concurrency as a string field — worth ensuring this field is exported and remains stable as part of the Job struct API, since downstream consumers (like these tests) depend on it.

var concurrency string
if data.WorkflowID != "" {
group := "gh-aw-conclusion-" + data.WorkflowID
concurrency = c.indentYAMLLines(fmt.Sprintf("concurrency:\n group: %q\n cancel-in-progress: false", group), " ")
Copy link
Contributor

Choose a reason for hiding this comment

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

Good use of cancel-in-progress: false here — this ensures that in-flight conclusion jobs (which are writing to issues/discussions) aren't killed mid-write when a new agent run starts. Correct choice for safe-outputs jobs that must complete their reporting.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@pelikhan pelikhan merged commit 358f0d1 into main Mar 4, 2026
49 of 50 checks passed
@pelikhan pelikhan deleted the copilot/emit-concurrent-group-conclusion-job branch March 4, 2026 15:46
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Smoke Test Results — Run §22676642058

Status: PARTIAL (2 skipped, 15 passed)

Core Tests #1–10: ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅

PR Review Tests #11–17: ✅ ✅ ✅ ⚠️ ✅ ✅ ⚠️

💥 [THE END] — Illustrated by Smoke Claude ·

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

💥 Automated smoke test review - all systems nominal!

💥 [THE END] — Illustrated by Smoke Claude

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds job-level concurrency to the generated conclusion job to prevent concurrent agents running the same workflow from colliding on shared “conclusion” side effects (e.g., comment/status updates).

Changes:

  • Emit a concurrency: block for the conclusion job using WorkflowID (gh-aw-conclusion-{workflow_id}) with cancel-in-progress: false.
  • Add a unit test covering both present/absent WorkflowID cases.
  • Recompile generated .lock.yml workflows to include the new conclusion job concurrency stanza.

Reviewed changes

Copilot reviewed 161 out of 161 changed files in this pull request and generated no comments.

File Description
pkg/workflow/notify_comment.go Sets a workflow-specific concurrency group for the conclusion job when WorkflowID is available.
pkg/workflow/notify_comment_test.go Adds coverage ensuring the conclusion job concurrency block is emitted (or not) depending on WorkflowID.
.github/workflows/*.lock.yml Regenerated locked workflows to include the new conclusion concurrency config.
.changeset/patch-conclusion-job-concurrency-group.md Records a patch-level changelog entry for the behavior change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants