ci: never drop a main run's deploy when merges land close together #362

Merged
sharang merged 1 commits from ci/main-run-per-commit into main 2026-09-24 09:40:32 +00:00
Owner

Merging PRs in quick succession drops deploys to staging.

Main runs share one concurrency group. cancel-in-progress: false only protects a run that is already running: a group keeps one pending run, and a queued one is cancelled when the next merge lands. detect-changes diffs HEAD~1..HEAD, so the run that survives deploys only the services its own commit changed.

On 2026-09-23 this cancelled the main runs for #357, #358 and #359 (7666, 7678, 7679). The #357 dashboard only reached staging because #361 happened to touch the dashboard later.

Change (.gitea/workflows/ci.yml only)

  • Main runs get a group per commit (github.sha), so no main run is dropped. PR runs keep one group per ref, and a newer push still cancels them.
  • Each deploy job gets its own group (deploy-agent, deploy-dashboard, deploy-docs, deploy-mcp, never cancelled in progress). Without it, runs from two merges could deploy the same service in parallel and an older image could land last. With it, a service's deploys run one at a time, in merge order. A queued deploy can still be replaced by a newer one for the same service, but the newer one builds from a later main, so it includes the change.

How to check

The PR run exercises only the pull-request path of the group expression. The main path is visible on the next two merges that land close together: both main runs should complete, not be cancelled.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

Merging PRs in quick succession drops deploys to staging. Main runs share one concurrency group. `cancel-in-progress: false` only protects a run that is already running: a group keeps one *pending* run, and a queued one is cancelled when the next merge lands. `detect-changes` diffs `HEAD~1..HEAD`, so the run that survives deploys only the services its own commit changed. On 2026-09-23 this cancelled the main runs for #357, #358 and #359 (7666, 7678, 7679). The #357 dashboard only reached staging because #361 happened to touch the dashboard later. ## Change (`.gitea/workflows/ci.yml` only) - **Main runs get a group per commit** (`github.sha`), so no main run is dropped. PR runs keep one group per ref, and a newer push still cancels them. - **Each deploy job gets its own group** (`deploy-agent`, `deploy-dashboard`, `deploy-docs`, `deploy-mcp`, never cancelled in progress). Without it, runs from two merges could deploy the same service in parallel and an older image could land last. With it, a service's deploys run one at a time, in merge order. A queued deploy can still be replaced by a newer one for the same service, but the newer one builds from a later main, so it includes the change. ## How to check The PR run exercises only the pull-request path of the group expression. The main path is visible on the next two merges that land close together: both main runs should complete, not be cancelled. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang added 1 commit 2026-09-24 09:01:42 +00:00
ci: never drop a main run's deploy when merges land close together
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 6m22s
6586607898
A concurrency group keeps one pending run, so a queued main run was
cancelled when the next merge landed, and its services were never
deployed (7666, 7678, 7679 on 2026-09-23). Main runs now get a group
per commit, and each deploy job a group per service, which keeps a
service's deploys in merge order.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang merged commit 6d700589fe into main 2026-09-24 09:40:32 +00:00
Sign in to join this conversation.