fix(ci): stable SonarQube scanner cache key for PRs [NOJIRA]#308
Open
tobias0106 wants to merge 2 commits into
Open
fix(ci): stable SonarQube scanner cache key for PRs [NOJIRA]#308tobias0106 wants to merge 2 commits into
tobias0106 wants to merge 2 commits into
Conversation
pull-request-kotlin.yml keyed the ~/.sonar/cache on
`${os}-sonar-${head_ref}-${sha}` with restore-key `${os}-sonar-`. That never
matches the main-branch cache saved by sonar-cloud.yml (`${os}-sonar`, no
trailing dash), and PR-only caches aren't shared across branches — so every PR
missed and re-downloaded the scanner JRE + analyzer plugins (~minutes, and the
source of the intermittent "stream was reset" JRE-download failures).
Align the PR workflow to the same stable `${os}-sonar` key so PRs restore the
warm cache populated by the main-branch scan.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Removed comments explaining the cache key for Sonar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
pull-request-kotlin.ymlcaches~/.sonar/cachewith key${{ runner.os }}-sonar-${{ github.head_ref }}-${{ github.sha }}and restore-key${{ runner.os }}-sonar-.…-sonar-(trailing dash) never matches the main-branch cache saved bysonar-cloud.yml, which uses${{ runner.os }}-sonar(no dash).Net: every PR re-downloads the scanner JRE + analyzer plugins — adds minutes, and is the source of the intermittent
Call to .../api/v2/analysis/jres/… failed: stream was resetfailures.Fix
Align the PR workflow to the same stable
${{ runner.os }}-sonarkey thatsonar-cloud.yml(main-branch) already uses, so PRs restore the warm cache populated onmain. (Cache is immutable per key, so the save no-ops when the hit is from main; it self-refreshes on the 7-day eviction cycle.)Fixes the cache miss seen across the Kotlin fleet (e.g. service-wallet PRs).
Follow-up (separate, discussed)
-Dsonar.scanner.skipJreProvisioning=trueto skip the JRE download entirely (runners already have Corretto JDK) — bigger reliability win, will propose separately.🤖 Generated with Claude Code