mirror of
https://github.com/gradle/actions.git
synced 2026-06-27 05:48:28 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f1fc55330 |
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=bafc141b619ad6350fd975fc903156dd5c151998cc8b058e8c1044ab5f7b031f
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
|
||||
distributionSha256Sum=9c0f7faeeb306cb14e4279a3e084ca6b596894089a0638e68a07c945a32c9e14
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
# ksh gradlew
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem gradlew startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@@ -72,7 +72,7 @@ echo location of your Java installation. 1>&2
|
||||
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
+93
-93
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+118
-118
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
Vendored
+92
-92
File diff suppressed because one or more lines are too long
Vendored
+3
-3
File diff suppressed because one or more lines are too long
Vendored
+129
-129
File diff suppressed because one or more lines are too long
Vendored
+3
-3
File diff suppressed because one or more lines are too long
@@ -32,9 +32,9 @@ export type CacheCleanupStatus =
|
||||
export type ProjectCacheStatus =
|
||||
| 'not-enabled' // the hidden opt-in env var was not set (rendered as nothing)
|
||||
| 'trial-expired' // past the hard trial expiry
|
||||
| 'not-registered' // neither entitlement path satisfied (no Develocity trial token, repo not registered)
|
||||
| 'trial-not-licensed' // Develocity trial token missing or invalid
|
||||
| 'no-encryption-key' // Cannot store due to missing encryption key
|
||||
| 'enabled' // Entitled: will attempt to save project state
|
||||
| 'enabled' // Trial in effect: will attempt to save project state
|
||||
|
||||
export interface CacheEntryReport {
|
||||
entryName: string
|
||||
|
||||
@@ -2,7 +2,6 @@ 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
|
||||
@@ -32,7 +31,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.`,
|
||||
'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\`.`,
|
||||
'trial-not-licensed': `Project state (build-logic and configuration cache) was not cached - a develocity-access-key and develocity-server-url is required.`,
|
||||
'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.`
|
||||
}
|
||||
@@ -83,22 +82,6 @@ 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
|
||||
|
||||
@@ -9,7 +9,6 @@ import {setupToken} from './develocity/short-lived-token'
|
||||
|
||||
import {loadBuildResults, markBuildResultsProcessed} from './build-results'
|
||||
import {getCacheService, getProviderNote} from './cache-service-loader'
|
||||
import {renderProjectCacheNotice} from './caching-report'
|
||||
import {CacheOptions} from './cache-service'
|
||||
import {
|
||||
DevelocityConfig,
|
||||
@@ -86,14 +85,6 @@ export async function complete(
|
||||
buildResults,
|
||||
cacheOptionsFrom(cacheConfig, develocityServerUrl, cacheToken)
|
||||
)
|
||||
|
||||
// Surface a prominent notice (with the /register link) only when advanced caching was withheld
|
||||
// because the repo is not registered; stay quiet when enabled by either path.
|
||||
const registrationNotice = renderProjectCacheNotice(cacheReport.projectCache)
|
||||
if (registrationNotice) {
|
||||
core.notice(registrationNotice)
|
||||
}
|
||||
|
||||
await jobSummary.generateJobSummary(buildResults, cacheReport, getProviderNote(cacheConfig), summaryConfig)
|
||||
|
||||
markBuildResultsProcessed()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {describe, expect, it} from '@jest/globals'
|
||||
|
||||
import {CacheReport} from '../../src/cache-service'
|
||||
import {renderCachingReport, renderProjectCacheNotice} from '../../src/caching-report'
|
||||
import {renderCachingReport} from '../../src/caching-report'
|
||||
|
||||
const ENHANCED = {kind: 'enhanced'} as const
|
||||
const BASIC = {kind: 'basic'} as const
|
||||
@@ -114,20 +114,6 @@ describe('renderCachingReport', () => {
|
||||
expect(md).not.toContain('Project state')
|
||||
})
|
||||
|
||||
it('renders the not-registered status with a /register link inside the details', () => {
|
||||
const report: CacheReport = {
|
||||
status: 'enabled',
|
||||
cleanup: 'enabled',
|
||||
projectCache: 'not-registered',
|
||||
entries: [entry()]
|
||||
}
|
||||
const md = renderCachingReport(report, ENHANCED)
|
||||
|
||||
const detailsBody = md.slice(md.indexOf('</summary>'))
|
||||
expect(detailsBody).toContain('not registered for advanced caching')
|
||||
expect(detailsBody).toContain('/register')
|
||||
})
|
||||
|
||||
it('renders a compact disabled report with no note and no details', () => {
|
||||
const report: CacheReport = {status: 'disabled', entries: []}
|
||||
const md = renderCachingReport(report, undefined)
|
||||
@@ -157,20 +143,3 @@ describe('renderCachingReport', () => {
|
||||
expect(md).not.toContain('<details>')
|
||||
})
|
||||
})
|
||||
|
||||
describe('renderProjectCacheNotice', () => {
|
||||
it('returns a notice with the /register link for the not-registered status', () => {
|
||||
const notice = renderProjectCacheNotice('not-registered')
|
||||
expect(notice).toBeDefined()
|
||||
expect(notice).toContain('not registered')
|
||||
expect(notice).toContain('/register')
|
||||
})
|
||||
|
||||
it('is silent for every other status', () => {
|
||||
expect(renderProjectCacheNotice('enabled')).toBeUndefined()
|
||||
expect(renderProjectCacheNotice('not-enabled')).toBeUndefined()
|
||||
expect(renderProjectCacheNotice('trial-expired')).toBeUndefined()
|
||||
expect(renderProjectCacheNotice('no-encryption-key')).toBeUndefined()
|
||||
expect(renderProjectCacheNotice(undefined)).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
||||
+3
-3
@@ -56,12 +56,12 @@ export declare type CacheStatus = 'enabled' | 'read-only' | 'write-only' | 'disa
|
||||
|
||||
/**
|
||||
* Status of project-entry caching (build-logic artifacts + configuration-cache data) for a run.
|
||||
* Set as the gate is evaluated: opt-in, then trial expiry, then entitlement (Develocity trial
|
||||
* license OR repo registration), then encryption key. Still beta.
|
||||
* The first three are set on restore (always ungated); the rest are set on save and reflect the
|
||||
* two-tier gate (opt-in + Develocity trial, then encryption key + Gradle version). Still beta.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
declare type ProjectCacheStatus = 'not-enabled' | 'trial-expired' | 'not-registered' | 'no-encryption-key' | 'enabled';
|
||||
declare type ProjectCacheStatus = 'not-enabled' | 'trial-expired' | 'trial-not-licensed' | 'no-encryption-key' | 'enabled';
|
||||
|
||||
/** @public */
|
||||
export declare function restore(gradleUserHome: string, cacheOptions: CacheOptions): Promise<void>;
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gradle-actions-caching",
|
||||
"version": "0.9.1",
|
||||
"version": "0.9.0",
|
||||
"type": "module",
|
||||
"main": "./index.js",
|
||||
"types": "./index.d.ts",
|
||||
|
||||
Reference in New Issue
Block a user