From 8d6183a1adc70217a492809da72b51450be364d9 Mon Sep 17 00:00:00 2001 From: Tobias Svane Mikkelsen Date: Wed, 10 Jun 2026 15:07:49 +0200 Subject: [PATCH 1/2] fix(ci): stable SonarQube scanner cache key for PRs [NOJIRA] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/pull-request-kotlin.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-request-kotlin.yml b/.github/workflows/pull-request-kotlin.yml index 7927487..0887a01 100644 --- a/.github/workflows/pull-request-kotlin.yml +++ b/.github/workflows/pull-request-kotlin.yml @@ -112,10 +112,11 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 with: path: ~/.sonar/cache - key: ${{ runner.os }}-sonar-${{ github.head_ref }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-sonar-${{ github.head_ref }}- - ${{ runner.os }}-sonar- + # Stable key (matches sonar-cloud.yml) so PRs reuse the warm cache + # populated by the main-branch scan, instead of missing on every + # branch+sha and re-downloading the scanner JRE + analyzer plugins. + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar - name: Run linter env: GHL_USERNAME: ${{ secrets.GHL_USERNAME }} @@ -194,9 +195,9 @@ jobs: ~/.gradle/caches ~/.gradle/wrapper key: ${{ runner.os }}-gradle-${{ github.head_ref }}-${{ github.sha }} - - name: Save SonarCloud cache + - name: Save SonarQube cache if: ${{ always() && !inputs.skip-sonar && steps.sonar-cache.outputs.cache-hit != 'true' }} uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 with: path: ~/.sonar/cache - key: ${{ runner.os }}-sonar-${{ github.head_ref }}-${{ github.sha }} + key: ${{ runner.os }}-sonar From d39cc2c7f49e230b10d3824226cf4bf067aade61 Mon Sep 17 00:00:00 2001 From: Tobias Svane Mikkelsen <62556939+tobias0106@users.noreply.github.com> Date: Wed, 10 Jun 2026 15:11:03 +0200 Subject: [PATCH 2/2] Clean up comments in pull-request-kotlin.yml Removed comments explaining the cache key for Sonar. --- .github/workflows/pull-request-kotlin.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/pull-request-kotlin.yml b/.github/workflows/pull-request-kotlin.yml index 0887a01..c98b512 100644 --- a/.github/workflows/pull-request-kotlin.yml +++ b/.github/workflows/pull-request-kotlin.yml @@ -112,9 +112,6 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 with: path: ~/.sonar/cache - # Stable key (matches sonar-cloud.yml) so PRs reuse the warm cache - # populated by the main-branch scan, instead of missing on every - # branch+sha and re-downloading the scanner JRE + analyzer plugins. key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Run linter