mirror of
https://github.com/gradle/actions.git
synced 2026-06-16 16:40:39 +00:00
Tweak caching report title and provider note wording
- Title now reads "Gradle State Caching — <icon> <Provider> (<status>)", consistent across all variants, with the status qualifier restored. - Make both provider notes parallel: "Enhanced Caching uses the proprietary ..." / "Basic Caching uses the basic open-source ...". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -56,17 +56,13 @@ function renderHeading(status: CacheStatus, providerNote?: ProviderNote): string
|
||||
if (!isActive(status)) {
|
||||
const label =
|
||||
status === 'disabled-existing-home' ? 'Skipped' : status === 'not-available' ? 'Unavailable' : 'Disabled'
|
||||
return `<h4>Gradle Caching — ${label}</h4>`
|
||||
return `<h4>Gradle State Caching — ${label}</h4>`
|
||||
}
|
||||
|
||||
const icon = providerNote?.kind === 'basic' ? '🛡️ ' : providerNote?.kind === 'enhanced' ? '⚡ ' : ''
|
||||
const provider =
|
||||
providerNote?.kind === 'basic'
|
||||
? ' — Basic Provider'
|
||||
: providerNote?.kind === 'enhanced'
|
||||
? ' — Enhanced Provider'
|
||||
: ''
|
||||
return `<h4>${icon}Gradle Caching${provider}</h4>`
|
||||
const icon = providerNote?.kind === 'basic' ? '🛡️' : '⚡'
|
||||
const provider = providerNote?.kind === 'basic' ? 'Basic' : 'Enhanced'
|
||||
const suffix = status === 'read-only' ? ' (read-only)' : status === 'write-only' ? ' (write-only)' : ''
|
||||
return `<h4>Gradle State Caching — ${icon} ${provider}${suffix}</h4>`
|
||||
}
|
||||
|
||||
function renderCleanupLine(cleanup?: CacheCleanupStatus): string | undefined {
|
||||
@@ -78,7 +74,7 @@ function renderProviderNote(providerNote?: ProviderNote): string | undefined {
|
||||
return undefined
|
||||
}
|
||||
if (providerNote.kind === 'enhanced') {
|
||||
return `**[Enhanced Caching](${DOCS}#enhanced-caching)** is provided by the proprietary \`gradle-actions-caching\` provider. See [DISTRIBUTION.md](${DISTRIBUTION}) for terms of use and opt-out instructions.`
|
||||
return `**[Enhanced Caching](${DOCS}#enhanced-caching)** uses the proprietary \`gradle-actions-caching\` provider. See [DISTRIBUTION.md](${DISTRIBUTION}) for terms of use and opt-out instructions.`
|
||||
}
|
||||
return `**[Basic Caching](${DOCS}#basic-caching)** uses the basic open-source provider. For faster builds and advanced features, consider the **[Enhanced Caching](${DOCS}#enhanced-caching)** provider. See [DISTRIBUTION.md](${DISTRIBUTION}) for details.`
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ describe('renderCachingReport', () => {
|
||||
const report: CacheReport = {status: 'read-only', cleanup: 'disabled-readonly', entries: [entry()]}
|
||||
const md = renderCachingReport(report, ENHANCED)
|
||||
|
||||
expect(md).toContain('<h4>⚡ Gradle Caching — Enhanced Provider</h4>')
|
||||
expect(md).toContain('<h4>Gradle State Caching — ⚡ Enhanced (read-only)</h4>')
|
||||
expect(md).toContain('[Enhanced Caching]')
|
||||
expect(md).toContain('`gradle-actions-caching`')
|
||||
expect(md).toContain('DISTRIBUTION.md')
|
||||
@@ -43,7 +43,7 @@ describe('renderCachingReport', () => {
|
||||
const report: CacheReport = {status: 'enabled', cleanup: 'enabled', entries: [entry()]}
|
||||
const md = renderCachingReport(report, ENHANCED)
|
||||
|
||||
expect(md).toContain('<h4>⚡ Gradle Caching — Enhanced Provider</h4>')
|
||||
expect(md).toContain('<h4>Gradle State Caching — ⚡ Enhanced</h4>')
|
||||
// status and cleanup messages are within the expando, after the summary
|
||||
const detailsBody = md.slice(md.indexOf('</summary>'))
|
||||
expect(detailsBody).toContain('Cache was enabled')
|
||||
@@ -68,7 +68,7 @@ describe('renderCachingReport', () => {
|
||||
}
|
||||
const md = renderCachingReport(report, BASIC)
|
||||
|
||||
expect(md).toContain('<h4>🛡️ Gradle Caching — Basic Provider</h4>')
|
||||
expect(md).toContain('<h4>Gradle State Caching — 🛡️ Basic (read-only)</h4>')
|
||||
expect(md).toContain('[Basic Caching]')
|
||||
expect(md).toContain('[Enhanced Caching]')
|
||||
expect(md).toContain('DISTRIBUTION.md')
|
||||
@@ -82,7 +82,7 @@ describe('renderCachingReport', () => {
|
||||
const report: CacheReport = {status: 'disabled', entries: []}
|
||||
const md = renderCachingReport(report, undefined)
|
||||
|
||||
expect(md).toContain('<h4>Gradle Caching — Disabled</h4>')
|
||||
expect(md).toContain('<h4>Gradle State Caching — Disabled</h4>')
|
||||
expect(md).toContain('Caching was disabled')
|
||||
expect(md).not.toContain('<details>')
|
||||
expect(md).not.toContain('DISTRIBUTION.md')
|
||||
@@ -92,7 +92,7 @@ describe('renderCachingReport', () => {
|
||||
const report: CacheReport = {status: 'disabled-existing-home', entries: []}
|
||||
const md = renderCachingReport(report, ENHANCED)
|
||||
|
||||
expect(md).toContain('<h4>Gradle Caching — Skipped</h4>')
|
||||
expect(md).toContain('<h4>Gradle State Caching — Skipped</h4>')
|
||||
expect(md).toContain('pre-existing Gradle User Home')
|
||||
expect(md).not.toContain('<details>')
|
||||
// no provider note for non-active states
|
||||
@@ -103,7 +103,7 @@ describe('renderCachingReport', () => {
|
||||
const report: CacheReport = {status: 'not-available', entries: []}
|
||||
const md = renderCachingReport(report, ENHANCED)
|
||||
|
||||
expect(md).toContain('<h4>Gradle Caching — Unavailable</h4>')
|
||||
expect(md).toContain('<h4>Gradle State Caching — Unavailable</h4>')
|
||||
expect(md).not.toContain('<details>')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user