Skip to content

ci(security): scope codeql cancel-in-progress to PR events only - #91

Merged
WomB0ComB0 merged 1 commit into
masterfrom
fix/codeql-no-cancel-master
May 10, 2026
Merged

ci(security): scope codeql cancel-in-progress to PR events only#91
WomB0ComB0 merged 1 commit into
masterfrom
fix/codeql-no-cancel-master

Conversation

@WomB0ComB0

Copy link
Copy Markdown
Member

Summary

Closes the gap where master commits could miss CodeQL scanning during merge bursts.

The workflow-level concurrency block:

```yaml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
```

cancelled in-flight runs across every trigger including `push: master`. On 2026-05-09 four consecutive master commits had cancelled CodeQL runs because each merge preempted the previous scan before SARIF upload:

Commit Source CodeQL outcome
f62f74a #78 cancelled
eea018f #77 cancelled
b35ac71 #79 cancelled
c5d0c1d #82 cancelled
56a33f2 #81 succeeded (last in chain)

Only the final commit in the chain ever got scanned. The intermediate four are unscanned in GitHub Code Scanning state.

Fix

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

  • PR events: still cancel on update (each new PR push supersedes its predecessor). Same UX as today.
  • Master push events: queue rather than preempt. Every commit gets scanned end-to-end.
  • Schedule events: also queue (`gitleaks` job already opts out of schedule via `if: github.event_name != 'schedule'`; CodeQL runs once a week and won't conflict).

Test plan

  • Visual diff: 1 file, +6/-1 lines (5-line comment + 1 changed expression).
  • After merge, the next master push will queue if a previous master run is in flight, rather than cancel it.

Note

This does NOT close the same hole in the `security` workflow if it has the same pattern — quick check shows `security.yml` is a different workflow with its own concurrency. Out of scope here; if it has the same issue I'll open a follow-up.

The workflow-level concurrency block cancelled every in-flight run on
push to master. When several PRs merged within the typical CodeQL run
duration (~3-4 min), each merge cancelled its predecessor's scan
before SARIF could upload. On 2026-05-09, four consecutive master
commits (#77, #78, #79, #82) had cancelled CodeQL runs for exactly
this reason — only #81 (the last in the chain) actually completed.

For PR events the cancel-on-update behavior is correct: each new
push to a PR branch makes the prior run obsolete. For master events
every commit must be scanned end-to-end.

Gating cancel-in-progress on github.event_name == 'pull_request'
keeps PR responsiveness while ensuring master commits queue rather
than preempt.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@WomB0ComB0 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 31 minutes and 22 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 78747913-b378-41c1-9634-191e038ea355

📥 Commits

Reviewing files that changed from the base of the PR and between 2ff1148 and 55bf96d.

📒 Files selected for processing (1)
  • .github/workflows/codeql.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/codeql-no-cancel-master

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size/XS A-DevOps CI/CD and tooling labels May 10, 2026
@WomB0ComB0
WomB0ComB0 merged commit 3e605a2 into master May 10, 2026
24 checks passed
@WomB0ComB0
WomB0ComB0 deleted the fix/codeql-no-cancel-master branch May 10, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-DevOps CI/CD and tooling size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant