Skip to content

ci: one build per branch, newer push cancels the older run (#90) - #105

Merged
compot-dev merged 2 commits into
v2from
ci/concurrency
Oct 13, 2026
Merged

compot-dev merged 2 commits into
v2from
ci/concurrency

Conversation

@compot-dev

@compot-dev compot-dev commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #90.

Workflow-level concurrency grouped by event and ref, cancel-in-progress for pushes and pull requests:

  • On basic / v2 a newer merge cancels the run of the older one, so the latest release and the Telegram post always carry the build of the newest commit, not of whichever run finished last.
  • Working branches and PRs: superseded runs are cancelled too (saves CI minutes).
  • Manual runs (workflow_dispatch, optionally with commit_hash) get a group per run: never cancelled by a push and never replaced by another manual run.

Decision on the second question of #90: every merge into basic / v2 keeps publishing to latest (testers use it, see LABORATORY.md); only the race is removed. A manual run with an old commit_hash still publishes that build on purpose.

@compot-dev

Copy link
Copy Markdown
Collaborator Author

/review

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Queued manual builds get dropped ✓ Resolved
Description
The workflow assigns every manual dispatch for a ref to one concurrency group while disabling
cancellation of the running job. GitHub Actions retains only one pending run per group, so a later
manual dispatch can replace an earlier pending build instead of letting all manual builds queue
behind one another.
Code

.github/workflows/build.yml[R16-17]

+  group: build-${{ github.event_name }}-${{ github.ref }}
+  cancel-in-progress: ${{ github.event_name != 'workflow_dispatch' }}
Evidence
The workflow declares manual dispatches at the top level and groups them using the event name and
ref. Therefore repeated manual dispatches for the same ref share the same concurrency group, while
the false expression only disables cancellation of an active run and does not create an unlimited
pending queue.

.github/workflows/build.yml[5-10]
.github/workflows/build.yml[15-17]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Manual `workflow_dispatch` runs for the same ref share one concurrency group, and `cancel-in-progress: false` only protects the currently running run; pending manual runs can still be replaced by newer pending runs.
## Fix Focus Areas
- .github/workflows/build.yml[15-17]
## Recommended Fix
Do not rely on workflow-level concurrency to provide an unlimited FIFO queue for manual runs. Either exclude `workflow_dispatch` runs from this concurrency group so every manual request is retained, or implement an explicit durable queue if manual runs must execute serially; keep push and pull-request runs grouped with cancellation enabled.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can turn these tips off under Display > Comment parts

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread .github/workflows/build.yml Outdated
@compot-dev

Copy link
Copy Markdown
Collaborator Author

Qodo: Queued manual builds get dropped — accepted and fixed: every manual run now has its own concurrency group (manual-<run_id>), so manual runs neither cancel nor replace each other.

/review

@compot-dev

Copy link
Copy Markdown
Collaborator Author

/review

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Qodo: Queued manual builds get dropped — accepted and fixed: every manual run now has its own concurrency group (manual-<run_id>), so manual runs neither cancel nor replace each other.

/review

The change addresses finding 1: each manual dispatch now uses a unique manual-${{ github.run_id }} concurrency group, so manual runs will not cancel or replace one another. /review isn’t available in this deployment, so I can’t trigger a fresh review here; I can still inspect the diff or explain the concurrency behavior.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit feca2d2

@compot-dev
compot-dev merged commit c3620c6 into v2 Oct 13, 2026
4 checks passed
@compot-dev
compot-dev deleted the ci/concurrency branch October 13, 2026 09:17
compot-dev added a commit that referenced this pull request Oct 15, 2026
ci: one build per branch, newer push cancels the older run (#90)
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.

CI: concurrency, so an older run cannot overwrite the latest release

1 participant