Skip to content

ci: partial-clone (blob:none) the Kotlin PR checkouts - #327

Merged
JesperTerkelsen merged 1 commit into
mainfrom
ci/sonar-checkout-blob-filter
Aug 17, 2026
Merged

ci: partial-clone (blob:none) the Kotlin PR checkouts#327
JesperTerkelsen merged 1 commit into
mainfrom
ci/sonar-checkout-blob-filter

Conversation

@JesperTerkelsen

Copy link
Copy Markdown
Member

What

Add filter: blob:none to both fetch-depth: 0 checkouts in the reusable pull-request-kotlin.yml.

fetch-depth: 0 (needed for SonarQube new-code blame) with no blob filter downloads every historical version of every file. blob:none keeps all commits and trees — which blame needs — but fetches file blobs lazily, only when blame touches a changed file. Faster checkout, identical Sonar accuracy.

Why it matters

This reusable workflow runs gradlew sonar on every PR for ~37 caller repos (service-wallet, service-ocpp, service-control, service-charges, service-search, … and the library-* repos). A one-line change here speeds the PR checkout for all of them.

Evidence

Validated first on monorepo-typescript (PR #7398), 10 runs vs 20 baseline:

  • Checkout −42% (19s → 12s median), non-overlapping distributions, Mann-Whitney p ≈ 1×10⁻⁵.
  • No SonarQube scan regression (p = 0.68) — the blame lazy-fetch cost did not materialise.

Risk / rollout

  • Same proven, git-native pattern already used by the test shards in monorepo-typescript.
  • Fans out to ~37 repos, so worth a quick look at one Kotlin service's PR run after merge (checkout should drop; gradlew sonar unchanged). This workflow already exposes sonar-non-blocking, so a hiccup won't hard-block a PR.
  • Revert is one line.

Opened as draft for CI/feedback before requesting review.

@JesperTerkelsen
JesperTerkelsen marked this pull request as ready for review August 17, 2026 11:06
@JesperTerkelsen
JesperTerkelsen requested a review from a team as a code owner August 17, 2026 11:06
@JesperTerkelsen
JesperTerkelsen requested review from chandrashekar-dhar and removed request for a team August 17, 2026 11:06
pull-request-kotlin.yml checks out with fetch-depth:0 (full history, needed
for SonarQube new-code blame) but no blob filter, so it downloads every
historical version of every file. Add filter: blob:none to both checkouts:
keeps all commits and trees (what blame needs) and fetches file blobs lazily
only when blame touches a changed file. This reusable workflow is called on
pull_request by ~37 repos, so the faster checkout benefits every caller.

Validated on monorepo-typescript (PR #7398): checkout -42% (19s->12s,
non-overlapping distributions, p~1e-5) with no SonarQube scan regression.
@JesperTerkelsen
JesperTerkelsen force-pushed the ci/sonar-checkout-blob-filter branch from 7373bf9 to 5ecb4f7 Compare August 17, 2026 11:09
@JesperTerkelsen
JesperTerkelsen merged commit 660d6cd into main Aug 17, 2026
2 checks passed
@JesperTerkelsen
JesperTerkelsen deleted the ci/sonar-checkout-blob-filter branch August 17, 2026 11:15
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