Repository navigation
BUILD-12998 Fix build-number ref authorization for PR merge commits - #360
Conversation
984ec6f to
be62a91
Compare
|
@guillaume-dequenne I'll merge this shortly, but FYI the earliest this will go out as a release + push to |
|
Code Review ✅ Approved🟡 Medium risk · Anchoring build-number refs to default-branch HEAD adds a lookup; lookup failures stop new claims before refs are written, potentially blocking allocation. Anchors build-number allocator lock, number, and run-marker refs to the repository's default-branch HEAD, resolved once before locking, so allocation no longer fails with HTTP 403 on pull-request merge commits. No issues found. Verification Rules 2/2 met Repos 9 inspectedFunctional validation No results Rules 2 passed 1 not applicable
Broader impact Repos 9 inspectedCross-repo 9 repositories inspected 0 open impacts
4 more repositories Auto-approval Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |



Build-number allocation can fail with GitHub HTTP 403 on a pull-request merge commit even when the workflow token has Contents: write. SonarSource/sonar-cpp#7091 reproduces this twice; its Edge authentication and ITs never run because allocation fails first.
Anchor the allocator's lock, number and run-marker refs to the repository's existing default-branch HEAD, resolved once before acquiring the lock. These commits are bookkeeping targets only: the protocol uses the ref names/existence, not commit contents. Existing-marker reuse avoids the extra lookup; lookup failures stop before any refs are written. Locking, number uniqueness, migration and cleanup behavior are retained.
Validation:
The production Edge cold-download validation is already green in SonarSource/sonar-cpp#7198. This fix addresses its separate CI allocator blocker. SonarSource/sonar-cpp#7091 now pins this exact commit for its regular/release allocation calls and has full CI running; its merge depends on review of this shared fix. Inclusion in the v2 action line will also fix other existing consumers.