Skip to content

CLP-964 Make concurrency queueing explicit so pending runs are not silently cancelled in sonar-analyzer-commons - #539

Merged
frederic-tingaud-sonarsource merged 1 commit into
masterfrom
clp-959-concurrency-queue
Sep 23, 2026
Merged

frederic-tingaud-sonarsource merged 1 commit into
masterfrom
clp-959-concurrency-queue

Conversation

@frederic-tingaud-sonarsource

Copy link
Copy Markdown
Contributor

Part of CLP-959

concurrency.queue defaults to single, which allows only one run to sit in pending.
With cancel-in-progress: false the running job is protected, but as soon as a third run
joins the group the pending run is silently cancelled: it never executes, nothing retries
it, and no failure is reported anywhere.

This PR makes the queueing policy explicit in every concurrency block of this repository.

Workflow queue Rationale
.github/workflows/build.yml inverse expression Per-commit build/deploy: nothing may be dropped on the default branch, while PR builds must still supersede each other.

Why queue is an expression here

cancel-in-progress in build.yml is an expression, and GitHub rejects
queue: max combined with cancel-in-progress: true with a workflow validation error.
That error does fire for expressions, not just the literal true — so a plain queue: max
would have stopped PR runs from starting at all.

Setting queue to the exact logical inverse of the cancel expression keeps the pair valid in
both states:

Branch cancel-in-progress queue Effect
default branch false max every commit's run is kept and queued
PR branch true single superseded PR builds are cancelled, exactly as before

Verified empirically on SonarSource/core-languages-tooling with throwaway probe workflows
(branch since deleted):

  • queue: max + cancel-in-progress: <expr → true> → run created 0 jobs, "workflow file issue"
  • cancel-in-progress: <expr → false> + queue: <expr → 'max'> → success
  • cancel-in-progress: <expr → true> + queue: <expr → 'single'> → success
  • cancel-in-progress: <expr → true> + queue: <expr → 'max'> → 0 jobs (proves the queue expression is genuinely evaluated, not ignored)

🤖 Generated with Claude Code

queue defaults to single, so a pending run is silently cancelled when a
third run joins the group even with cancel-in-progress: false.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Make concurrency queueing explicit so pending runs are not silently cancelled in sonar-analyzer-commons CLP-964 Make concurrency queueing explicit so pending runs are not silently cancelled in sonar-analyzer-commons Sep 22, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

CLP-964

@gitar-bot

gitar-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Workflow concurrency now retains default-branch runs and supersedes PR runs

Makes concurrency queueing policy explicit across workflows to prevent pending runs from being silently cancelled. Uses conditional expressions to keep queue and cancel-in-progress compatible on both default and PR branches. No issues found.

Review coverage

🧪 Functional validation No results

📋 Rules No rules evaluated

🤖 Auto-approval Not enabled · Set up

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqube-next

Copy link
Copy Markdown

@guillaume-dequenne guillaume-dequenne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@frederic-tingaud-sonarsource
frederic-tingaud-sonarsource merged commit e71c3b3 into master Sep 23, 2026
11 checks passed
@frederic-tingaud-sonarsource
frederic-tingaud-sonarsource deleted the clp-959-concurrency-queue branch September 23, 2026 08:30
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.

2 participants