Skip to content

ci: don't cancel in-progress main push runs (fix startup_failure on rapid merges) - #1006

Merged
JSONbored merged 1 commit into
mainfrom
fix/ci-concurrency-no-cancel-main
Jun 22, 2026
Merged

ci: don't cancel in-progress main push runs (fix startup_failure on rapid merges)#1006
JSONbored merged 1 commit into
mainfrom
fix/ci-concurrency-no-cancel-main

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Problem

Merging two PRs within seconds left main's CI showing startup_failure on both push runs. Root cause: ci.yml uses

concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: true

For push to main, github.ref is refs/heads/main, so back-to-back merges land in the same group and cancel-in-progress races them during startup → both end as startup_failure (GitHub can't cleanly cancel a run that's still starting). The workflows are valid — the PRs' pull_request runs passed identically.

Fix

Scope cancellation to PR events only:

cancel-in-progress: ${{ github.event_name == 'pull_request' }}

PR pushes still cancel superseded runs (fast feedback), but every merge to main now gets a complete CI run. Merging this also produces the clean green push run main is currently missing.

cancel-in-progress: true on group ci-${{ github.ref }} means back-to-back merges to main
share one concurrency group and cancel each other during startup, producing startup_failure
runs (e.g. merging two Renovate PRs ~5s apart left main's CI red despite valid workflows).
Scope cancellation to pull_request events so every main merge gets a complete CI run while PR
pushes still cancel superseded runs.
@dosubot dosubot Bot added the size:XS label Jun 22, 2026
@ghost ghost added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 22, 2026
@ghost

ghost commented Jun 22, 2026

Copy link
Copy Markdown

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

🛠️ Maintainer review — Held for maintainer review

Reviewed 1 changed file(s) — two independent AI reviewers, synthesized. ✅ Safe to merge — both reviewers found no blocking issues.

ℹ️ Correct and all CI green — held for maintainer review.

Merge readiness: ✅ Mergeable · all CI checks green/neutral/skipped.

Summary

The change correctly scopes the concurrency cancel‑in‑progress flag to PR runs only, preventing cancellation of back‑to‑back main pushes and fixing the reported startup_failure issue. No security concerns, code correctness, or test regressions are introduced. The workflow syntax is valid and the added comments improve maintainability.

💡 Nits — non-blocking, optional

  • Minor comment formatting could be tightened.
  • Consider adding quotes around the expression (e.g., "${{ github.event_name == 'pull_request' }}") for clarity, though not required.
  • Document the behavior in the project’s CI guidelines to inform contributors.

@ghost ghost added the reviewbot-review label Jun 22, 2026
@ghost

ghost commented Jun 22, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #1006 is no longer open. No action.

💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 22, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Held for maintainer (guardrail_area) — correct + CI green

@JSONbored JSONbored self-assigned this Jun 22, 2026
@JSONbored
JSONbored merged commit 718117d into main Jun 22, 2026
9 checks passed
@JSONbored
JSONbored deleted the fix/ci-concurrency-no-cancel-main branch June 22, 2026 08:46
JSONbored added a commit that referenced this pull request Jun 22, 2026
The expression form (cancel-in-progress: ${{ github.event_name == 'pull_request' }}) from #1006
caused GitHub to fail ci.yml at startup (startup_failure) on both push and pull_request, so the
required `validate` check never reported and PRs sat stuck 'waiting'. actionlint accepts the
expression but GitHub's runtime parser does not start the run. Revert to the known-good literal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant