From e5857b8ffa5a47d74e9563a3022afea7d569f997 Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Thu, 11 Jun 2026 23:05:19 -0600 Subject: [PATCH] Tweak caching report title and provider note wording MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Title now reads "Gradle State Caching — ()", 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) --- sources/src/caching-report.ts | 16 ++++++---------- sources/test/jest/caching-report.test.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/sources/src/caching-report.ts b/sources/src/caching-report.ts index 548b60ee..6105cf39 100644 --- a/sources/src/caching-report.ts +++ b/sources/src/caching-report.ts @@ -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 `

Gradle Caching — ${label}

` + return `

Gradle State Caching — ${label}

` } - const icon = providerNote?.kind === 'basic' ? '🛡️ ' : providerNote?.kind === 'enhanced' ? '⚡ ' : '' - const provider = - providerNote?.kind === 'basic' - ? ' — Basic Provider' - : providerNote?.kind === 'enhanced' - ? ' — Enhanced Provider' - : '' - return `

${icon}Gradle Caching${provider}

` + 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 `

Gradle State Caching — ${icon} ${provider}${suffix}

` } 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.` } diff --git a/sources/test/jest/caching-report.test.ts b/sources/test/jest/caching-report.test.ts index 091175dd..49ef7050 100644 --- a/sources/test/jest/caching-report.test.ts +++ b/sources/test/jest/caching-report.test.ts @@ -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('

⚡ Gradle Caching — Enhanced Provider

') + expect(md).toContain('

Gradle State Caching — ⚡ Enhanced (read-only)

') 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('

⚡ Gradle Caching — Enhanced Provider

') + expect(md).toContain('

Gradle State Caching — ⚡ Enhanced

') // status and cleanup messages are within the expando, after the summary const detailsBody = md.slice(md.indexOf('')) expect(detailsBody).toContain('Cache was enabled') @@ -68,7 +68,7 @@ describe('renderCachingReport', () => { } const md = renderCachingReport(report, BASIC) - expect(md).toContain('

🛡️ Gradle Caching — Basic Provider

') + expect(md).toContain('

Gradle State Caching — 🛡️ Basic (read-only)

') 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('

Gradle Caching — Disabled

') + expect(md).toContain('

Gradle State Caching — Disabled

') expect(md).toContain('Caching was disabled') expect(md).not.toContain('
') 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('

Gradle Caching — Skipped

') + expect(md).toContain('

Gradle State Caching — Skipped

') expect(md).toContain('pre-existing Gradle User Home') expect(md).not.toContain('
') // 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('

Gradle Caching — Unavailable

') + expect(md).toContain('

Gradle State Caching — Unavailable

') expect(md).not.toContain('
') }) })