fix: add concurrency group to child-repo-sync workflow - #57
Conversation
When multiple child repos merge simultaneously, their notify chains fire concurrent on-child-update runs that race to push the same branch name. This causes push failures and duplicate PRs. Adding a concurrency group queues the runs instead of racing them, so each sync PR is created cleanly in sequence. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR adds a Key changes:
Issue found:
Confidence Score: 2/5
|
| Filename | Overview |
|---|---|
| .github/workflows/on-child-update.yml | The concurrency block was inserted between workflow_dispatch: and its inputs: child key, splitting the on: section and producing invalid YAML that will break workflow dispatch inputs and likely fail to parse entirely. |
Sequence Diagram
sequenceDiagram
participant CR1 as Child Repo 1
participant CR2 as Child Repo 2
participant GHA as GitHub Actions
participant CQ as Concurrency Queue
participant Meta as Meta Repo
CR1->>GHA: repository_dispatch child-repo-updated
CR2->>GHA: repository_dispatch child-repo-updated
GHA->>CQ: Enqueue run for CR1 (group: child-repo-sync)
GHA->>CQ: Enqueue run for CR2 (group: child-repo-sync, cancel-in-progress: false → queued)
CQ->>Meta: Run 1 (CR1): checkout → push sync/CR1/sha → create PR → auto-merge
CQ->>Meta: Run 2 (CR2): checkout → push sync/CR2/sha → create PR → auto-merge
Comments Outside Diff (1)
-
.github/workflows/on-child-update.yml, line 6-17 (link)concurrencyblock breaksworkflow_dispatchinputsThe
concurrency:block was inserted betweenworkflow_dispatch:and itsinputs:child key. This splits theon:block in two —inputs:is now orphaned outside theon:context with 4-space indentation, which is invalid at the top-level scope of a GitHub Actions workflow YAML. GitHub's parser will either reject the workflow entirely or silently drop theworkflow_dispatchinputs, breaking manual dispatch.The
concurrency:block must be a top-level sibling ofon:,permissions:, andjobs:— it should come after the entireon:block.Prompt To Fix With AI
This is a comment left during a code review. Path: .github/workflows/on-child-update.yml Line: 6-17 Comment: **`concurrency` block breaks `workflow_dispatch` inputs** The `concurrency:` block was inserted between `workflow_dispatch:` and its `inputs:` child key. This splits the `on:` block in two — `inputs:` is now orphaned outside the `on:` context with 4-space indentation, which is invalid at the top-level scope of a GitHub Actions workflow YAML. GitHub's parser will either reject the workflow entirely or silently drop the `workflow_dispatch` inputs, breaking manual dispatch. The `concurrency:` block must be a top-level sibling of `on:`, `permissions:`, and `jobs:` — it should come **after** the entire `on:` block. How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: .github/workflows/on-child-update.yml
Line: 6-17
Comment:
**`concurrency` block breaks `workflow_dispatch` inputs**
The `concurrency:` block was inserted between `workflow_dispatch:` and its `inputs:` child key. This splits the `on:` block in two — `inputs:` is now orphaned outside the `on:` context with 4-space indentation, which is invalid at the top-level scope of a GitHub Actions workflow YAML. GitHub's parser will either reject the workflow entirely or silently drop the `workflow_dispatch` inputs, breaking manual dispatch.
The `concurrency:` block must be a top-level sibling of `on:`, `permissions:`, and `jobs:` — it should come **after** the entire `on:` block.
```suggestion
workflow_dispatch:
inputs:
repo_name:
description: 'Child repo name'
required: true
default: 'test-repo'
short_sha:
description: 'Short SHA'
required: true
default: 'abc1234'
message:
description: 'Commit message'
required: true
default: 'feat: test commit'
type:
description: 'Commit type'
required: true
default: 'feat'
actor:
description: 'Actor'
required: true
default: 'test-user'
concurrency:
group: child-repo-sync
cancel-in-progress: false
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix: add concurrency group to child-repo..." | Re-trigger Greptile
The concurrency block was incorrectly placed between workflow_dispatch and its inputs, breaking the YAML structure. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Fixed — moved |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughA workflow-level concurrency configuration is added to the GitHub Actions workflow file, establishing a shared concurrency group named Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
concurrency: { group: child-repo-sync, cancel-in-progress: false }toon-child-update.ymlProblem
Merging 5 repos at once triggered 5+ concurrent
on-child-updateruns. Multiple runs tried to push the same branch name simultaneously, causing push failures and orphaned duplicate PRs (e.g., #54, #55).The existing idempotency logic handles some race conditions but fails when the winning run's PR isn't visible yet to the losers'
find_existing_prcheck.Fix
cancel-in-progress: falseensures runs queue and execute sequentially — each gets a clean shot at creating its sync branch and PR without contention.🤖 Generated with Claude Code
Summary by CodeRabbit