Skip to content

Prefix docs-build concurrency group to avoid collisions during migration#33

Merged
Mpdreamz merged 1 commit intomainfrom
feature/concurency
Mar 26, 2026
Merged

Prefix docs-build concurrency group to avoid collisions during migration#33
Mpdreamz merged 1 commit intomainfrom
feature/concurency

Conversation

@Mpdreamz
Copy link
Copy Markdown
Member

Summary

When repositories migrate from elastic/docs-builder's preview-build.yml to elastic/docs-actions' docs-build.yml, both workflows coexist temporarily on migration PRs. During this window, two docs-build workflow runs fire for every commit:

Run Trigger Reusable workflow Concurrency group
Old (base branch) pull_request_target preview-build.yml docs-build-{branch}
New (PR branch) pull_request docs-build.yml docs-build-{branch}

Both resolve to the same concurrency group because:

  1. Both caller workflows share name: docs-build
  2. Both reusable workflows use the same group pattern: ${github.workflow}-${branch}
  3. Both evaluate cancel-in-progress to true for PR events (preview-build.yml uses startsWith(github.event_name, 'pull_request') which matches pull_request_target)

The result: whichever run starts second cancels the first, causing the old workflow's jobs to appear as cancelled on the PR checks tab.

Observed on elastic/ecs-dotnet#558

On every commit, the pull_request_target docs-build run was cancelled by the pull_request run. For example on commit 3f57a7d:

  • pull_request_target run started at 14:48:00 → cancelled at 14:53:04
  • pull_request run started at 14:48:03 → success at 14:53:23

Fix

Prefix the concurrency group in docs-build.yml with docs-actions-build- so it no longer collides with preview-build.yml's group. Both workflows run independently during migration; after merge only the new one remains.

docs-deploy.yml and docs-preview-cleanup.yml don't need this change — deploy already uses a distinct docs-deploy- prefix with workflow_run context, and cleanup has no concurrency settings (it runs once on PR close).

Test plan

  • Verify on a migration PR (e.g. ecs-dotnet#558) that both old and new docs-build runs complete without cancelling each other
  • Verify that rapid pushes to the same PR branch still correctly cancel stale runs within the new workflow

Made with Cursor

When repositories migrate from elastic/docs-builder's preview-build.yml
to elastic/docs-actions' docs-build.yml, both the old and new workflows
coexist temporarily:

- The OLD workflow (on the base branch) triggers via pull_request_target
  and calls preview-build.yml, which defines a concurrency group of
  `${github.workflow}-${branch}`.

- The NEW workflow (on the PR branch) triggers via pull_request and calls
  docs-build.yml, which defined the same concurrency group pattern.

Because both caller workflows typically share the same `name: docs-build`,
they resolve to identical concurrency groups. Both have
cancel-in-progress: true for PR events, so whichever starts second
cancels the first — causing the old workflow's jobs to show as
"cancelled" on the PR checks.

This was observed on elastic/ecs-dotnet#558, where every commit showed
the pull_request_target docs-build run cancelled by the pull_request run
(e.g. commit 3f57a7d: the pull_request_target run started at 14:48:00,
the pull_request run started 3 seconds later and cancelled it).

Adding a `docs-actions-build-` prefix to the concurrency group makes it
distinct from preview-build.yml's group, so both workflows run
independently during the migration window.

Made-with: Cursor
@Mpdreamz Mpdreamz requested review from a team and reakaleek March 26, 2026 11:22
@Mpdreamz Mpdreamz added the fix label Mar 26, 2026
@Mpdreamz Mpdreamz merged commit 20549df into main Mar 26, 2026
2 of 3 checks passed
@Mpdreamz Mpdreamz deleted the feature/concurency branch March 26, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants