Skip to content

Redesign the caching Job Summary - #985

Merged
bigdaz merged 9 commits into
mainfrom
dd/issue-966
Jun 12, 2026
Merged

bigdaz merged 9 commits into
mainfrom
dd/issue-966

Conversation

@bigdaz

@bigdaz bigdaz commented Jun 10, 2026 •

Copy link
Copy Markdown
Member

Redesigns the caching section of the Job Summary into a single, consistent layout across every cache provider and state, and integrates the provider message into the report rather than appending it disconnected at the bottom.

Motivation

The caching report was produced by three divergent code paths (NoOp / basic / enhanced), each rendering its own markdown:

  • Explicitly disabled → a one-line message, no expand, no provider note.
  • Enhanced (incl. skipped-due-to-existing-home) → a full <details> block.
  • Basic → a one-line message with no expandable details at all.

The Enhanced/Basic provider note floated at the very bottom, disconnected from the report.

What changed

save() now returns structured CacheReport data instead of pre-rendered HTML, and a single renderer (caching-report.ts) produces one unified layout for all variants:

  • Section heading: #### <icon> Gradle Caching — <Provider> (<status>)
  • Status line explaining what the cache did
  • Integrated provider note woven in under the heading — now shown unconditionally (no longer gated on license acceptance)
  • Expandable cache-entry details when there are entries — basic caching now gets this too

The two disabled variants (explicitly disabled, and skipped due to a pre-existing Gradle User Home) render as compact callouts with no expandable section.

Main repo

  • caching-report.ts (new): central renderer + all framing copy + entry table/<pre> helpers.
  • cache-service.ts: CacheReport / CacheEntryReport / status types; save() returns CacheReport.
  • cache-service-loader.ts: NoOp returns a report; LicenseWarningCacheService removed; new getProviderNote().
  • cache-service-basic.ts: builds a CacheReport.
  • job-summary.ts / setup-gradle.ts: thread CacheReport + ProviderNote.
  • configuration.ts: remove now-unused isCacheLicenseAccepted().

Vendored library

The structured contract requires gradle-actions-caching v0.7.0 (gradle/actions-caching#74). This PR updates the vendored library to that release — the official Update gradle-actions-caching library to v0.7.0 vendor commit is included here, so merging this PR ships the redesign together with the library it depends on.

Testing

  • Both repos build; prettier + eslint clean.
  • gradle/actions: 363/363 Jest tests pass, including new caching-report.test.ts covering every variant.
  • gradle-actions-caching: 74/74 pass under JDK 17.
  • Rendered markdown verified for all five variants (enhanced/basic enabled & read-only, disabled, skipped).

🤖 Generated with Claude Code

@bigdaz bigdaz changed the title Reduce the visual impact of caching info messages Redesign the caching Job Summary Jun 12, 2026
bot-githubaction and others added 9 commits June 12, 2026 15:13
Render the caching report from structured CacheReport data using a
single unified layout, replacing the three divergent code paths
(NoOp / basic / enhanced) that previously each rendered their own
markdown.

Every variant now shares one skeleton: a section heading
(`#### <icon> Gradle Caching — <Provider> (<status>)`), a status line,
an integrated provider note, and an expandable cache-entry-details
section. The Enhanced/Basic provider note is woven into the report
under the heading and is now shown unconditionally (no longer gated on
license acceptance). The two disabled variants (explicitly disabled,
and skipped due to a pre-existing Gradle User Home) render as compact
callouts with no expandable section.

- caching-report.ts: new central renderer + all framing copy.
- cache-service.ts: CacheReport/CacheEntryReport/status types; save()
  returns CacheReport.
- cache-service-loader.ts: NoOp returns a CacheReport, drop
  LicenseWarningCacheService, add getProviderNote().
- cache-service-basic.ts: build a CacheReport, so basic caching now
  also gets expandable entry details.
- job-summary.ts / setup-gradle.ts: thread CacheReport + ProviderNote.
- configuration.ts: remove now-unused isCacheLicenseAccepted().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Render the heading as <h4> so it displays as a heading (markdown
  ATX headings were rendered literally in the Job Summary).
- Heading reads "Gradle Caching — <Enhanced|Basic> Provider"; drop the
  status suffix since status now lives inside the details expando.
- Provider note: lead with a linked "Enhanced Caching" / "Basic Caching"
  to the docs; the proprietary provider name is now inline code.
- Move the status and cache-cleanup messages inside the details expando.
  The clickable summary now reads "Entries: N restored, M saved
  (expand for more details)".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 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>
The terms-of-use / opt-out link is only relevant to the proprietary
Enhanced provider, so the Basic note now ends after the upgrade
suggestion.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Use a hyphen rather than an em-dash in the report title.
- Basic note reads "uses the basic open-source caching provider".
- Details summary now reports restored/saved sizes when available:
  "Entries: 10 restored (120Mb), 1 saved (10Mb) - Expand for more
  details". Size is omitted when no metrics are available (basic
  caching), consistent with the metrics table.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bigdaz
bigdaz enabled auto-merge (squash) June 12, 2026 15:20
@bigdaz
bigdaz merged commit 97715a2 into main Jun 12, 2026
131 checks passed
@bigdaz
bigdaz deleted the dd/issue-966 branch June 12, 2026 15:21
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.

2 participants