Skip to content

Publish Kotlin Build Scans and cache to the OSS Community Develocity instance - #124

Merged
jamesarich merged 2 commits into
mainfrom
feat/develocity-oss
Aug 3, 2026
Merged

Publish Kotlin Build Scans and cache to the OSS Community Develocity instance#124
jamesarich merged 2 commits into
mainfrom
feat/develocity-oss

Conversation

@jamesarich

@jamesarich jamesarich commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Publishes Build Scans® and moves the remote build cache for the Kotlin
binding
to the OSS Community Develocity instance at
https://community.develocity.cloud under project ID meshtastic, matching the
Meshtastic-Android onboarding (meshtastic/Meshtastic-Android#6531) and the rest
of the org rollout:

The C, Swift, Python, C# and TypeScript bindings bring their own tooling and are
untouched — kotlin/ is the only Gradle build, so it is the only part
Develocity can see.

What changed

  • kotlin/gradle/develocity.settings.gradle replaces
    kotlin/gradle/build-cache.settings.gradle. The cache now comes from
    Develocity, so scan and cache configuration are one concern in one file.
  • The self-hosted HttpBuildCache is replaced by remote(develocity.buildCache).
  • A "Revved up by Develocity" badge in the README.

Two different CI wirings, because only ci.yml uses setup-gradle

Workflow Has setup-gradle? How the key gets in
ci.yml yes (×2) develocity-access-key action input
release.yml no DEVELOCITY_ACCESS_KEY workflow env
docs.yml no DEVELOCITY_ACCESS_KEY workflow env (block added)

release.yml and docs.yml invoke ./gradlew directly, so there is no action
input to carry the key — they read the environment variable the Develocity
plugin looks up itself. This matters: without it, those two workflows would have
lost their GRADLE_CACHE_* credentials and gained nothing, ending up with no
remote cache at all.

Behaviour

  • Scans publish only from authenticated builds (publishing.onlyIf { it.authenticated }).
    Fork PRs and developers who have not run
    ./gradlew provisionDevelocityAccessKey publish nothing rather than failing.
  • Only authenticated CI runs write to the cache, so unmerged and fork code
    cannot poison it. CI disables the local cache — runners are ephemeral and
    every hit comes from the remote anyway.
  • Scans carry no machine identity: usernames, hostnames, IP addresses and
    external process names are obfuscated to constants.

Verification

cd kotlin && ./gradlew spotlessCheck detekt apiCheck jvmTest --stacktrace
BUILD SUCCESSFUL, 44 tasks, scan published under root project name
takpacket-sdk.

On the kzstd pilot this same configuration measured a 59% build-time
avoidance ratio
on the second CI run, entirely from remote cache hits.

Note: jvmTest regenerates testdata/compression-report.md as a side effect.
Only its Generated: date line changed — no compression differences — so it is
deliberately excluded from this PR.

Note for reviewers

The GRADLE_CACHE_* repository secrets are now unused but deliberately not
deleted
— they are the rollback path.

Summary by CodeRabbit

  • Build & Release

    • Improved CI, documentation, and release build authentication and caching.
    • Added more reliable remote build caching for eligible CI builds.
    • Enabled enhanced build metadata and diagnostics through Develocity.
  • Documentation

    • Added a Develocity “Revved up by” badge and link to the README.

…instance

Replace the self-hosted HttpBuildCache with Develocity's remote cache at
community.develocity.cloud under project `meshtastic`, matching the
Meshtastic-Android onboarding (meshtastic/Meshtastic-Android#6531) and the rest
of the org rollout. This covers the Kotlin binding only — the C, Swift, Python,
C# and TypeScript bindings bring their own tooling and are untouched.

kotlin/gradle/develocity.settings.gradle replaces
kotlin/gradle/build-cache.settings.gradle. The cache now comes from Develocity,
so scan and cache configuration are one concern in one file.

The three workflows need two different wirings, because only ci.yml uses
setup-gradle. Its two call sites take the key as an action input. release.yml
and docs.yml invoke ./gradlew directly with no setup-gradle step, so there is no
input to carry the key — they get DEVELOCITY_ACCESS_KEY as workflow env, which
the Develocity plugin reads itself. docs.yml had no env block at all and needed
one added. Without this those two workflows would have lost their GRADLE_CACHE_*
credentials and gained nothing, leaving them with no remote cache.

Scans publish only from authenticated builds, so fork PRs and developers who
have not run `./gradlew provisionDevelocityAccessKey` publish nothing rather
than failing. Only authenticated CI runs write to the cache, so unmerged and
fork code cannot poison it. Scans record no machine identity: usernames,
hostnames, IP addresses and external process names are obfuscated to constants.

The GRADLE_CACHE_* secrets are no longer read but are deliberately left in place
as the rollback path.

Verified: spotlessCheck detekt apiCheck jvmTest, 44 tasks, scan published under
root project name takpacket-sdk.
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jamesarich, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5f31fa53-97c1-4140-88da-036b6226c370

📥 Commits

Reviewing files that changed from the base of the PR and between 2faaf90 and 80a2925.

📒 Files selected for processing (3)
  • .github/workflows/docs.yml
  • .github/workflows/release.yml
  • kotlin/gradle/develocity.settings.gradle
📝 Walkthrough

Walkthrough

The project replaces self-hosted Gradle cache settings with Develocity configuration. Gradle workflows now use the Develocity access key. The README includes a Develocity build-scan badge.

Changes

Develocity migration

Layer / File(s) Summary
Gradle Develocity configuration
kotlin/gradle/develocity.settings.gradle, kotlin/settings.gradle.kts, README.md
Gradle now applies Develocity plugins and configures build scans, identity obfuscation, and conditional remote caching. The README adds a build-scan badge.
CI access-key wiring
.github/workflows/ci.yml, .github/workflows/docs.yml, .github/workflows/release.yml
Workflows provide DEVELOCITY_ACCESS_KEY from GitHub Secrets and remove the previous Gradle cache credentials.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: thebentern

Poem

A rabbit checks the build cache bright,
Develocity scans take flight.
Keys flow safely through the gate,
Gradle hops to a faster state.
Badge gleams beneath the title’s light.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: publishing Kotlin Build Scans and using the OSS Community Develocity remote build cache.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docs.yml:
- Around line 46-50: Scope Develocity authentication to Gradle execution rather
than the entire workflow: in .github/workflows/docs.yml at lines 46-50, remove
the workflow-level DEVELOCITY_ACCESS_KEY and pass it through
gradle/actions/setup-gradle using develocity-access-key or expose it only on the
Gradle step; apply the same change in .github/workflows/release.yml at lines
18-20, ensuring non-Gradle steps do not receive the secret.

In `@kotlin/gradle/develocity.settings.gradle`:
- Around line 51-55: Update the Develocity cache configuration around
remote(develocityBuildCache) so anonymous writes are denied through the
project’s Develocity ACLs, and restrict DEVELOCITY_ACCESS_KEY availability to
trusted CI events rather than treating any non-empty key as sufficient. Keep
push enabled only for trusted CI runs with the approved credential, while
preserving read access for other builds.
- Around line 17-37: Update the buildScan publishing gate in the buildScan
configuration so publication is limited to authenticated CI builds, preventing
developer-local scans even when a Develocity access key is configured. Preserve
the existing unauthenticated behavior and leave the obfuscation configuration
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d92e2f21-a216-49e2-9975-6a282debc2d3

📥 Commits

Reviewing files that changed from the base of the PR and between 5271620 and 2faaf90.

📒 Files selected for processing (7)
  • .github/workflows/ci.yml
  • .github/workflows/docs.yml
  • .github/workflows/release.yml
  • README.md
  • kotlin/gradle/build-cache.settings.gradle
  • kotlin/gradle/develocity.settings.gradle
  • kotlin/settings.gradle.kts
💤 Files with no reviewable changes (1)
  • kotlin/gradle/build-cache.settings.gradle

Comment thread .github/workflows/docs.yml Outdated
Comment thread kotlin/gradle/develocity.settings.gradle
Comment thread kotlin/gradle/develocity.settings.gradle
…radle steps

Two review findings from the Develocity onboarding, both worth fixing.

Cache writes were gated only on CI plus a non-empty DEVELOCITY_ACCESS_KEY.
Same-repository pull requests DO receive repository secrets, so a PR build could
write entries into the shared cache. The self-hosted HttpBuildCache this
replaced gated on GITHUB_EVENT_NAME and excluded pull_request; that protection
was lost in the port and is restored here. Verified against a CI-shaped
environment:

    CI=true GITHUB_EVENT_NAME=pull_request  -> pull-only
    CI=true GITHUB_EVENT_NAME=push          -> writes enabled
    CI=true GITHUB_EVENT_NAME=merge_group   -> writes enabled

Local builds are still excluded by isCI, and fork PRs have no key at all.

The access key was also declared at workflow level in docs.yml and release.yml,
which exposed it to every step in those jobs — including the Swift, Python,
TypeScript and C# steps that have no use for it. Move it to step-level env on
the five ./gradlew invocations instead, merging into the existing env blocks
where the step already had one rather than adding a second (a duplicate `env:`
key is invalid YAML). All workflow files re-validated with yq.
@jamesarich
jamesarich added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit edd856a Aug 3, 2026
12 checks passed
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.

1 participant