Skip to content

GROOVY-12019: Enable gradle configuration cache#2544

Open
daniellansun wants to merge 1 commit into
masterfrom
GROOVY-12019
Open

GROOVY-12019: Enable gradle configuration cache#2544
daniellansun wants to merge 1 commit into
masterfrom
GROOVY-12019

Conversation

@daniellansun
Copy link
Copy Markdown
Contributor

@daniellansun daniellansun commented May 18, 2026

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.6532%. Comparing base (5318145) to head (5cd5b7e).
⚠️ Report is 23 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2544        +/-   ##
==================================================
+ Coverage     68.1844%   68.6532%   +0.4687%     
- Complexity      33086      34621      +1535     
==================================================
  Files            1508       1508                
  Lines          126130     130297      +4167     
  Branches        22878      23721       +843     
==================================================
+ Hits            86001      89453      +3452     
- Misses          32490      33052       +562     
- Partials         7639       7792       +153     

see 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets GROOVY-12019 by making the build more compatible with Gradle’s configuration cache, primarily by removing task-graph based logic, avoiding execution-time Project access patterns that break CC, and conditionally applying documentation tooling that is not yet CC-compatible.

Changes:

  • Enables configuration cache by default (with CC problems downgraded to warnings) and refactors multiple build scripts/plugins to be CC-friendly.
  • Makes documentation-related plugins/tasks conditional to avoid CC-incompatible third-party plugins unless needed.
  • Reworks shaded-jar manifest generation to avoid capturing non-serializable Gradle state and improves task input modeling.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
subprojects/groovy-groovydoc/build.gradle Avoids Project.mkdir usage; uses File.mkdirs() for CC-safe directory creation.
subprojects/groovy-binary/build.gradle Gates Asciidoctor task configuration and distribution doc inclusion behind documentation-build detection.
subprojects/groovy-ant/build.gradle Makes external jar resolution CC-safe by capturing a FileCollection at configuration time.
gradle/verification-metadata.xml Updates dependency verification metadata for updated/added build dependencies.
gradle.properties Enables configuration cache by default and sets CC problems to warn.
build.gradle Removes task graph usage for the parallel/generateLicenseReport incompatibility check.
build-logic/src/main/groovy/org/apache/groovy/gradle/SharedConfiguration.groovy Replaces task-graph-based decisions with StartParameter-based booleans; adds documentation-build detection.
build-logic/src/main/groovy/org/apache/groovy/gradle/PerformanceTestsExtension.groovy Makes performance test task arguments CC-safe via CommandLineArgumentProvider and modeled inputs.
build-logic/src/main/groovy/org/apache/groovy/gradle/JarJarTask.groovy Refactors task properties for CC safety; switches OSGi manifest generation to BND Analyzer.
build-logic/src/main/groovy/org/apache/groovy/gradle/GroovydocAntPlugin.groovy Improves CC safety by avoiding project.ant and by modeling source dirs as task inputs.
build-logic/src/main/groovy/org.apache.groovy-tested.gradle Replaces direct System.properties access with Providers; removes task-graph hook; CC-safe logging and cleanup.
build-logic/src/main/groovy/org.apache.groovy-published-library.gradle Removes signing logic dependency on task graph; adds publish ordering constraint for local file repository publishes.
build-logic/src/main/groovy/org.apache.groovy-publish-validation.gradle Adjusts publish validation to reduce CC-unfriendly configuration-time captures.
build-logic/src/main/groovy/org.apache.groovy-library.gradle Migrates JarJar manifest configuration from Gradle OSGi DSL to BND instructions.
build-logic/src/main/groovy/org.apache.groovy-documented.gradle Simplifies Javadoc tag configuration using tags(...) in the options block.
build-logic/src/main/groovy/org.apache.groovy-distribution.gradle Applies Asciidoctor/PDF plugins only for documentation builds; avoids execution-time project.version access.
build-logic/src/main/groovy/org.apache.groovy-core.gradle Makes compile configuration CC-friendlier; refactors grammar output relocation to avoid configuration-time file operations.
build-logic/src/main/groovy/org.apache.groovy-base.gradle Applies Asciidoctor plugin only when needed; adds asciidocElements variant; makes JarJar task configuration CC-safe.
build-logic/src/main/groovy/org.apache.groovy-asciidoctor.gradle Marks Asciidoctor tasks as not CC-compatible (until upstream plugin supports CC).
build-logic/build.gradle Adds BND library and bumps JMH Gradle plugin version.

Comment thread build-logic/src/main/groovy/org/apache/groovy/gradle/SharedConfiguration.groovy Outdated
@paulk-asert
Copy link
Copy Markdown
Contributor

Claude's comments:

Review of PR #2544 (GROOVY-12019: Enable Gradle configuration cache)

Solid build-infra work. CI is green, BND migration is clean, and most of the refactors carry inline comments explaining the CC constraint they exist to satisfy. A few items worth a second look:

  1. PR description. I've added a summary to the Jira issue ([GROOVY-12019|https://issues.apache.org/jira/browse/GROOVY-12019]) capturing the motivation, the asciidoctor workaround, and the OSGi-DSL → BND migration. Could you check the contents and adjust anything I got wrong?

  2. SharedConfiguration.isDocumentationTask misses Gradle abbreviations. Verified that gradle.startParameter.taskNames holds request strings verbatim — Gradle's task selector expands abbreviations later, after configuration. So:

    User typed taskNames Resolved to
    prop [prop] :properties
    dI [dI, …] :dependencyInsight

    Consequence: ./gradlew jA (abbreviating javadocAll) leaves taskNames = [jA]isDocumentationBuild = false → asciidoctor plugin is not applied → later tasks.named('asciidoctor') in groovy-distribution.gradle fails with "task not found". This is a regression vs. master, where asciidoctor is always applied. Options: drop the gating heuristic (accept CC-warn cost for everyone), document that abbreviations aren't supported for doc builds, or match camelCase prefixes of the known doc task names.

    (The "unrelated user task ending in 'doc' / starting with 'dist'" angle I worried about initially is weaker — those would be self-inflicted from the user's CLI, not a real failure mode. Abbreviation is the real one.)

  3. gradle.startParameter.warningMode = WarningMode.None in groovy-base.gradle silences all Gradle warnings during documentation builds, not just the asciidoctor 4.0.5 deprecation. That hides legitimate Gradle 9 deprecations across the rest of the build. Consider scoping narrower (or filtering the specific known message) and adding a TODO to revert once asciidoctor 4.0.6+ ships.

  4. bndInstruction(k, v) accumulates with comma-separators. Correct for Require-Capability/Provide-Capability, but for single-valued headers a second call from a sub-plugin produces "old,new" instead of overriding. The defaults inside JarJarTask use analyzer.setProperty (replace), but user-side calls accumulate — that asymmetry will bite someone eventually. Worth a doc comment on bndInstruction() calling this out, or a separate setBndInstruction() for the override case.

  5. Main-Class: groovy.ui.GroovyMain added to every core jarjar manifest. The old withManifest block in groovy-core.gradle didn't set it. Tests pass, but worth confirming this isn't an unintended new header in the published groovy-N.N.N.jar manifest — easy to cross-check against the previous release's MANIFEST.MF.

  6. Signing.shouldSign() semantics change. Old code inspected the resolved task graph (taskGraph.hasTask(':artifactoryPublish')), which catches publish tasks reached via dependsOn. New code only inspects requested task names. If anything internally depends on :artifactoryPublish without naming it on the CLI, signing now silently skips. Probably no such caller exists, but the test suite doesn't exercise signing, so worth a manual sanity check before merging.

None of these are blocking — (2) is the only one I'd want addressed before merge.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

JMH summary — classic (commit 6b393a7)

Speedup vs trailing 90-day baseline on gh-pages. Higher = faster.
1.00 = in line with history. Per-benchmark ratio, geomean within group.
Time-per-op units inverted so direction is consistent.

Group Speedup n
bench 0.941 × 26
core 0.961 × 77
grails 0.952 × 80

Baseline: dev/bench/jmh/<part>/classic/data.js on gh-pages, trailing 90 days. Daily dashboard · Per-suite raw data

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: 5cd5b7e Previous: f1a4483 Ratio
org.apache.groovy.bench.dispatch.CallsiteBench.dispatch_1_monomorphic_java 35819.12888593179 ops/ms 23120.647629008003 ops/ms 1.55
org.apache.groovy.bench.StaticMethodCallIndyColdBench.staticSum_java ( {"n":"2000"} ) 52.189812499999995 us/op 33.07520000000001 us/op 1.58
org.apache.groovy.bench.StaticMethodCallIndyColdBench.staticSum_java ( {"n":"20000"} ) 439.77117500000014 us/op 262.498375 us/op 1.68

This comment was automatically generated by workflow using github-action-benchmark.

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

JMH summary — indy (commit 6b393a7)

Speedup vs trailing 90-day baseline on gh-pages. Higher = faster.
1.00 = in line with history. Per-benchmark ratio, geomean within group.
Time-per-op units inverted so direction is consistent.

Group Speedup n
bench 0.994 × 26
core 0.975 × 77
grails 1.006 × 80

Baseline: dev/bench/jmh/<part>/indy/data.js on gh-pages, trailing 90 days. Daily dashboard · Per-suite raw data

@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented May 27, 2026

✅ All tests passed ✅

🏷️ Commit: 5cd5b7e
▶️ Tests: 166775 executed
⚪️ Checks: 58/58 completed


Learn more about TestLens at testlens.app.

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.

4 participants