Skip to content

refactor: convert grails-bootstrap to Groovy - #16578

Open
borinquenkid wants to merge 16 commits into
refactor/java-to-groovy-core-leavesfrom
refactor/java-to-groovy-grails-bootstrap
Open

borinquenkid wants to merge 16 commits into
refactor/java-to-groovy-core-leavesfrom
refactor/java-to-groovy-grails-bootstrap

Conversation

@borinquenkid

Copy link
Copy Markdown
Member

What

Converts the remaining Java sources of grails-bootstrap to Groovy: 28 .java files removed, 29 .groovy files added (29 files changed, 1668 insertions(+), 1612 deletions(-)).

Why

The maintainers asked on #16351 for the Java-to-Groovy migration to land one Gradle project at a time as a stack of PRs, bottom-up in dependency order. #16572 did grails-data-hibernate7; this PR is 3 of 30 in the next stack (base: refactor/java-to-groovy-core-leaves). The end state of every file is taken from the 9.0.x-java-to-groovy branch, which already carries the regression fixes found by CI.

Commits:

  • 078853d fix: keep the Java-facing API of the converted grails-bootstrap classes
  • 3a317b6 refactor: convert grails-bootstrap to Groovy

Changed outside the converted sources

  • nothing

Java-facing API sweep

Every deleted .java was compared with its Groovy twin via javap -v -protected (class declaration, public/protected fields, constructors, methods incl. modifiers/throws/generics, interface default methods, nested class modifiers, and the annotations callers see). Result:

  • grails-bootstrap: 28 deleted .java, 2 difference(s) found and fixed in this PR (see the fix: commit), 0 left

See also the notes below. Remaining informational entries (widened visibility, e.g. Groovy property accessors): 3.

Verification

  • classes and testClasses (plus ast/cli/testFixtures source sets where present) of the converted project(s) and of their direct dependents compile: ['grails-core', 'grails-datamapping-support', 'grails-shell-cli', 'grails-spring', 'grails-spring-security', 'grails-spring-security-oauth2', 'grails-startup-progress', 'grails-test-suite-base', 'grails-test-suite-persistence', 'grails-views-core']
  • No test suites were run locally (the umbrella branch was verified; CI runs them). codeStyle, rat and a whole-repo build -PskipTests are run once on the tip of the stack.

Notes

  • Informational sweep entries that are not regressions: Groovy enums gain MIN_VALUE/MAX_VALUE/next()/previous(), property accessors appear for formerly package-private members, nested static classes with implicit constructors become public (they were protected), and generic type parameters that Groovy erases in constructors/methods (descriptors identical).
  • Groovy gotchas that applied (see build: migrate remaining Java sources to Groovy #16351): static final without public creates a property; == calls equals(); Closure/SAM coercions; @CompileStatic with nested classes. All CI regression fixes found on the umbrella branch are included in the end state.

🤖 Generated with Claude Code

borinquenkid and others added 2 commits October 10, 2026 12:07
Converts the Java sources of grails-bootstrap to Groovy.
Part of the per-project split requested by the maintainers on #16351; end state taken from the
9.0.x-java-to-groovy branch (origin/9.0.x..e55fd9e).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
GrailsEclipseConsole lost the 'throws IOException' of its public constructor in the conversion (the implicit Groovy default constructor declares none), so Java callers catching IOException would stop compiling. Declare it explicitly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@borinquenkid
borinquenkid requested review from jamesfredley and jdaugherty and a balanced review from Copilot October 10, 2026 19:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.06240% with 256 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.0987%. Comparing base (98e5136) to head (083e4fc).

Files with missing lines Patch % Lines
.../io/watch/MacOsWatchServiceDirectoryWatcher.groovy 0.0000% 55 Missing ⚠️
...roovy/org/grails/io/support/ResourceLocator.groovy 14.2857% 53 Missing and 1 partial ⚠️
...org/grails/io/watch/PollingDirectoryWatcher.groovy 0.0000% 37 Missing ⚠️
...support/PathMatchingResourcePatternResolver.groovy 71.0000% 21 Missing and 8 partials ⚠️
...rails/io/watch/WatchServiceDirectoryWatcher.groovy 63.4615% 18 Missing and 1 partial ⚠️
...groovy/org/grails/io/watch/DirectoryWatcher.groovy 63.1579% 12 Missing and 2 partials ⚠️
...eptions/reporting/DefaultStackTraceFilterer.groovy 71.0526% 6 Missing and 5 partials ⚠️
...ails/build/support/MetaClassRegistryCleaner.groovy 80.3922% 4 Missing and 6 partials ⚠️
...groovy/org/grails/io/support/AntPathMatcher.groovy 94.8864% 3 Missing and 6 partials ⚠️
...rg/grails/io/watch/AbstractDirectoryWatcher.groovy 56.2500% 3 Missing and 4 partials ⚠️
... and 4 more
Additional details and impacted files

Impacted file tree graph

@@                              Coverage Diff                              @@
##             refactor/java-to-groovy-core-leaves     #16578        +/-   ##
=============================================================================
+ Coverage                                64.0887%   64.0987%   +0.0100%     
- Complexity                                 29082      29173        +91     
=============================================================================
  Files                                       2259       2259                
  Lines                                     112015     111932        -83     
  Branches                                   20362      20362                
=============================================================================
- Hits                                       71789      71747        -42     
+ Misses                                     31031      30977        -54     
- Partials                                    9195       9208        +13     
Files with missing lines Coverage Δ
.../org/grails/io/support/StaticResourceLoader.groovy 60.0000% <50.0000%> (ø)
...oovy/grails/plugins/InvalidVersionException.groovy 25.0000% <25.0000%> (ø)
...y/grails/plugins/exceptions/PluginException.groovy 25.0000% <25.0000%> (ø)
.../grails/io/support/FileSystemResourceLoader.groovy 0.0000% <0.0000%> (ø)
...rg/grails/io/watch/AbstractDirectoryWatcher.groovy 48.2759% <56.2500%> (ø)
...groovy/org/grails/io/support/AntPathMatcher.groovy 93.5622% <94.8864%> (ø)
...ails/build/support/MetaClassRegistryCleaner.groovy 79.4520% <80.3922%> (ø)
...eptions/reporting/DefaultStackTraceFilterer.groovy 67.3077% <71.0526%> (ø)
...groovy/org/grails/io/watch/DirectoryWatcher.groovy 60.7843% <63.1579%> (ø)
...rails/io/watch/WatchServiceDirectoryWatcher.groovy 58.6667% <63.4615%> (ø)
... and 4 more

... and 6 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.

@borinquenkid borinquenkid added this to the grails:9.0.0-M1 milestone Oct 11, 2026
borinquenkid and others added 5 commits October 15, 2026 21:46
…y-grails-bootstrap

AntPathMatcher.groovy takes upstream c471280 (combine patterns and extract
template variables as AntPathMatcher documents), ported into the Groovy file.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@borinquenkid
borinquenkid marked this pull request as draft October 19, 2026 21:01
@borinquenkid
borinquenkid marked this pull request as ready for review October 19, 2026 21:20
@borinquenkid

borinquenkid commented Oct 19, 2026 •

Copy link
Copy Markdown
Member Author

SUPERSEDED: the skipTests/skipCodeStyle flag described below was removed. See the newer comment about the CHANGEME FOR ACCEPTANCE workflow-trigger commit, which is the only temporary CI change on this branch.

Temporary CI flag on this stacked branch (BLOCKER before merge).

This Java-to-Groovy chain is a stack of PRs, and every push to any of them starts the full CI matrix, which is more runner time than the ASF allows us. Every PR in the stack except the one closest to its release branch (#16576) therefore carries one temporary commit, CHANGEME FOR ACCEPTANCE, that adds this to the root gradle.properties:

skipTests=true
skipCodeStyle=true

With it, CI on this PR compiles but does not run tests or code style. The full build runs on #16576 (closest to 10.0.x), and each PR gets it when the PR below it has merged.

Condition for merging this PR: that gradle.properties block (and the CHANGEME FOR ACCEPTANCE commit) must be dropped from this branch first, and CI must then be green with the tests running. A green check on this PR as it stands does not mean the tests ran. Rollout of the commit is branch by branch, so a branch may not carry it yet.

@borinquenkid

Copy link
Copy Markdown
Member Author

Update: this branch now carries a different temporary CI commit (BLOCKER before merge).

The earlier skipTests/skipCodeStyle flag in gradle.properties did not help enough: the functional jobs still compile the whole repository (about 57 minutes each) on every push, so it only saved around a fifth of the time. It has been removed.

In its place, every PR in this stack except #16576 (the one closest to 10.0.x) carries one temporary commit, CHANGEME FOR ACCEPTANCE: disable PR workflow triggers. It changes the pull_request: trigger of each workflow to branches: ['CHANGEME-FOR-ACCEPTANCE'], a branch that does not exist, so pushing, rebasing or force-pushing this branch starts no jobs.

Condition for merging this PR: that commit must be reverted on this branch first (git revert of the CHANGEME FOR ACCEPTANCE commit), and CI must then run and be green. The absence of CI checks on this PR is deliberate and does not mean the code was tested. The full build runs on #16576, and each PR gets it when the PR below it has merged.

@testlens-app

testlens-app Bot commented Oct 22, 2026

Copy link
Copy Markdown

🔎 No tests executed 🔎

🏷️ Commit: b72e22b
▶️ Tests: 0 executed
⚪️ Checks: 42/42 completed


Learn more about TestLens at testlens.app/docs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants