mirror of
https://github.com/gradle/actions.git
synced 2026-09-10 19:28:33 +08:00
Support repo-registration as a second enablement path for project-entry caching
Configuration-cache store/restore is now enabled when EITHER a valid Develocity JWT OR per-repo registration (a GitHub App installation that accepted the T&C) is present. The gate itself lives in the vendored gradle-actions-caching library (refreshed to 0.9.1); this repo wires up the reporting and notice. - ProjectCacheStatus: 'trial-not-licensed' -> 'not-registered'. - caching-report: render the 'not-registered' line with a /register link, and add renderProjectCacheNotice() for a prominent core.notice. - setup-gradle: emit the notice from complete() only when withheld via the registration path; quiet when enabled by either path. - Refresh vendored gradle-actions-caching to 0.9.1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
b128da9bf0
commit
bc54cf57d1
@@ -2,6 +2,7 @@ import {CacheCleanupStatus, CacheEntryReport, CacheReport, CacheStatus, ProjectC
|
||||
|
||||
const DOCS = 'https://github.com/gradle/actions/blob/main/docs/setup-gradle.md'
|
||||
const DISTRIBUTION = 'https://github.com/gradle/actions/blob/main/DISTRIBUTION.md'
|
||||
const REGISTER = 'https://gradle-actions-caching-registration.vercel.app/register'
|
||||
|
||||
/**
|
||||
* Identifies the caching provider in use, so the report can attribute the cache
|
||||
@@ -31,7 +32,7 @@ const CLEANUP_COPY: Record<CacheCleanupStatus, string> = {
|
||||
const PROJECT_CACHE_COPY: Record<ProjectCacheStatus, string> = {
|
||||
'not-enabled': ``,
|
||||
'trial-expired': `Project state (build-logic and configuration cache) was not cached - the Develocity caching trial has expired.`,
|
||||
'trial-not-licensed': `Project state (build-logic and configuration cache) was not cached - a develocity-access-key and develocity-server-url is required.`,
|
||||
'not-registered': `Project state (build-logic and configuration cache) was not cached - this repository is not registered for advanced caching. [Register this repository](${REGISTER}), or provide a \`develocity-access-key\` and \`develocity-server-url\`.`,
|
||||
'no-encryption-key': `Project state (build-logic and configuration cache) was not cached - a [cache-encryption-key](${DOCS}#cache-encryption-key) is required.`,
|
||||
enabled: `Caching of project state (build-logic and configuration cache) was enabled.`
|
||||
}
|
||||
@@ -82,6 +83,22 @@ function renderProjectCacheLine(projectCache?: ProjectCacheStatus): string | und
|
||||
return projectCache ? PROJECT_CACHE_COPY[projectCache] : undefined
|
||||
}
|
||||
|
||||
/**
|
||||
* A plain-text log notice (no markdown) surfaced when advanced caching was withheld because the
|
||||
* repository is not registered. Returns `undefined` for every other status, so callers stay quiet
|
||||
* when the feature is enabled, disabled, or simply not opted in.
|
||||
*/
|
||||
export function renderProjectCacheNotice(projectCache?: ProjectCacheStatus): string | undefined {
|
||||
if (projectCache !== 'not-registered') {
|
||||
return undefined
|
||||
}
|
||||
return (
|
||||
'Advanced caching (build-logic and configuration cache) was not enabled: this repository ' +
|
||||
`is not registered. Register it at ${REGISTER}, or provide a develocity-access-key and ` +
|
||||
'develocity-server-url.'
|
||||
)
|
||||
}
|
||||
|
||||
function renderProviderNote(providerNote?: ProviderNote): string | undefined {
|
||||
if (!providerNote) {
|
||||
return undefined
|
||||
|
||||
Reference in New Issue
Block a user