Skip to content

Serialize Crane workflow runs#110

Merged
mrjf merged 1 commit into
mainfrom
codex/crane-run-concurrency
Jun 5, 2026
Merged

Serialize Crane workflow runs#110
mrjf merged 1 commit into
mainfrom
codex/crane-run-concurrency

Conversation

@mrjf
Copy link
Copy Markdown
Contributor

@mrjf mrjf commented Jun 5, 2026

fix(crane): serialize workflow runs

TL;DR

Crane runs can take longer than the schedule interval once a stale migration actually resumes work. This PR adds a repo-wide Crane concurrency group so scheduled and manual Crane invocations do not overlap and race the same migration state.

Problem

After the stale-completion scheduler fix, issue #78 was correctly selected as active work, but multiple Crane runs overlapped while earlier agent jobs were still inside Execute GitHub Copilot CLI. The compiled default top-level concurrency used github.run_id for schedule/workflow_dispatch events, which made each run its own lock instead of serializing Crane.

Approach

  • Add source workflow concurrency to .github/workflows/crane.md:
    • group: crane-${{ github.repository }}
    • cancel-in-progress: false
  • Run gh aw compile crane and include the regenerated .github/workflows/crane.lock.yml.

Validation

gh aw compile crane
✓ .github/workflows/crane.md (122.3 KB)
✓ Compiled 1 workflow(s): 0 error(s), 0 warning(s)

gh aw validate crane
✓ .github/workflows/crane.md
✓ Compiled 1 workflow(s): 0 error(s), 0 warning(s)

git diff --check

How to test

  1. Dispatch Crane while another Crane run is active.
  2. Confirm the second run waits under the shared crane-${{ github.repository }} concurrency group rather than starting another agent job.
  3. Confirm scheduled runs no longer overlap long-running manual/scheduled Crane agents.

Trade-offs

  • This serializes all Crane migrations in the repository, not just one migration. Crane already selects one migration per run, so repo-wide serialization matches the current operating model.
  • cancel-in-progress: false preserves in-flight work instead of killing the active agent when a scheduled tick arrives.

@mrjf mrjf merged commit 1662812 into main Jun 5, 2026
14 checks passed
@mrjf mrjf deleted the codex/crane-run-concurrency branch June 5, 2026 17:07
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.

1 participant