Skip to content

Support experimental project-entry caching (configuration-cache + build-logic) - #994

Merged
bigdaz merged 10 commits into
mainfrom
config-cache-support
Jun 16, 2026
Merged

Support experimental project-entry caching (configuration-cache + build-logic)#994
bigdaz merged 10 commits into
mainfrom
config-cache-support

Conversation

@bigdaz

@bigdaz bigdaz commented Jun 13, 2026

Copy link
Copy Markdown
Member

Pass develocityAccessToken and develocityServerUrl the gradle-actions-caching: required to support project-entry caching (build-logic + configuration-cache), which has experimental support in 'gradle-actions-cache@v0.8.0. This support is not yet released and will be available as a restricted trial.

@bigdaz
bigdaz force-pushed the config-cache-support branch 6 times, most recently from c484532 to 6289a6c Compare June 16, 2026 17:41
bigdaz and others added 10 commits June 16, 2026 12:09
Prepares the consumer for the gated project-entry caching feature in the
gradle-actions-caching library. Source-only; the vendored bundle is refreshed
in a later commit.

- cache-service.ts: add develocityAccessToken / develocityServerUrl to the
  local CacheOptions mirror; replace ConfigurationCacheStatus (4 values) with
  the 9-value ProjectCacheStatus (not-active retired); rename
  CacheReport.configurationCache to projectCache.
- caching-report.ts: PROJECT_CACHE_COPY is an exhaustive
  Record<ProjectCacheStatus, string> so a missed status fails compilation;
  not-enabled maps to '' (dropped by the existing .filter(Boolean)).
  renderConfigCacheLine becomes renderProjectCacheLine, reading
  report.projectCache.
- Tests updated for the renamed field and new copy, including a not-enabled
  case that renders nothing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolves the Develocity access key matching a given server URL, for threading
into the new develocityAccessToken cache option (next commit). Reuses
DevelocityAccessCredentials.parse and fails closed (returns undefined) when the
access key is empty/malformed, the server URL is empty/unparseable, or no key
matches the server host. Tolerates a bare hostname with no scheme.

Extends short-lived-token.test.ts with coverage for full URLs, bare hostnames,
host-only matching (ignoring scheme/port/path), multi-key selection, and the
fail-closed cases.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Supplies develocityAccessToken / develocityServerUrl to the gated
project-entry caching feature, on the save path only. Restore stays ungated,
so it keeps passing no DevelocityConfig and the credentials remain undefined.

- cacheOptionsFrom gains an optional develocityConfig; when present it sets
  develocityServerUrl from getDevelocityUrl() and resolves develocityAccessToken
  via resolveAccessKeyForServer (fail-closed when the URL or matching key is
  absent).
- complete() takes a DevelocityConfig and passes it through to cacheOptionsFrom
  at the save call; setup()/restore continues to call cacheOptionsFrom with no
  DevelocityConfig.
- Both post actions (setup-gradle, dependency-submission) pass
  new DevelocityConfig() to complete().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
At save time the Develocity access key has been swapped for a short-lived token
(host=<JWT>), whose value the strict DevelocityAccessCredentials parser rejects
(it requires host=\w+). Parse the host=value pairs leniently instead, so the
per-host token resolves for both long-lived keys and short-lived tokens.

Without this, threading credentials into the project-cache trial check fails
with trial-not-licensed on every real save (caught by the configuration-cache
integ-test). Adds a unit case for a JWT-shaped token value.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Have setupToken take the DevelocityConfig and return the short-lived JWT
matching the configured Develocity server, replacing resolveAccessKeyForServer
with resolveTokenForServer. Call setupToken directly from setup-gradle's
setup() (split out of buildScan.setup), persist the resolved token via
core.saveState, and read it back in complete(). cacheOptionsFrom now takes
the server URL and access token as parameters.

This ensures CacheOptions.develocityAccessToken is always the resolved
short-lived JWT on both restore and save, regardless of whether the access
key was supplied as an action input or env var.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bigdaz
bigdaz force-pushed the config-cache-support branch from 6289a6c to 578273a Compare June 16, 2026 18:09
@bigdaz bigdaz changed the title Support gated project-entry caching (configuration-cache + build-logic) Support experimental project-entry caching (configuration-cache + build-logic) Jun 16, 2026
@bigdaz
bigdaz enabled auto-merge (squash) June 16, 2026 18:10
@bigdaz
bigdaz merged commit 9c445f5 into main Jun 16, 2026
131 checks passed
@bigdaz
bigdaz deleted the config-cache-support branch June 16, 2026 18:14
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