Skip to content

Seed BeanRegistry adapter over BeanBuilder#15957

Open
jamesfredley wants to merge 1 commit into
8.0.xfrom
feat/beanbuilder-beanregistry-seed
Open

Seed BeanRegistry adapter over BeanBuilder#15957
jamesfredley wants to merge 1 commit into
8.0.xfrom
feat/beanbuilder-beanregistry-seed

Conversation

@jamesfredley

Copy link
Copy Markdown
Contributor

Description

What was found

Problem Impact
Spring 7 moves away from XML-centric registration Long-term BeanBuilder strategy is unclear
#15824 only keeps DSL independent of eager XML setup Compatibility fix, not the full BeanRegistrar future
Full rewrite is multi-week Needs a non-breaking adapter seed first

What changed

Area Change
Adapter SPI Add BeanRegistryAdapter
Implementation BeanBuilderBeanRegistryAdapter still uses BeanBuilder
Docs Upgrade note for Spring 7 BeanRegistrar path
Tests Adapter smoke coverage

Out of scope / follow-up

Topic Status
Full BeanRegistrar/BeanRegistry rewrite 8.1/9.0
Breaking BeanBuilder removal Not this PR
Plugin doWithSpring migration tooling Follow-up

Related MD topics

Source Topic
Google Doc 0.5 / Pre-release B1 BeanBuilder full programmatic future
Related PR #15824 compatibility slice

Contributor Checklist

Issue and Scope

  • Starter for strategic rewrite discussion.
  • Does not break existing BeanBuilder.
  • Single focused seed.
  • Targets 8.0.x.

Code Quality

  • Tests added.
  • Focused spring module tests run.
  • No mass reformatting.
  • AI starting point labeled.

Licensing and Attribution

  • Apache License 2.0.
  • Contributor rights confirmed.
  • ai-generated-starting-point label applied.

Documentation

  • Upgrade note added.
  • Scope explained.

Assisted-by: Sisyphus:xai/grok-4.5 [gpt-coding]

Add experimental BeanRegistryAdapter that still uses BeanBuilder while documenting Spring 7 BeanRegistrar path.

Assisted-by: Sisyphus:xai/grok-4.5 [gpt-coding]

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.

Pull request overview

This PR seeds a new adapter SPI in grails-spring to provide a non-breaking seam between the existing BeanBuilder DSL and Spring 7’s evolving registration APIs, while keeping current BeanBuilder-based behavior intact.

Changes:

  • Introduces a new grails.spring.BeanRegistryAdapter SPI plus a BeanBuilder-backed implementation.
  • Adds a JUnit smoke test validating that the adapter registers beans via the existing BeanBuilder path.
  • Updates the guide to document the intended migration strategy and wires grails-spring into the shared test Gradle config.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
grails-spring/src/main/groovy/grails/spring/BeanRegistryAdapter.java Adds the new adapter SPI surface for bean definition + registration.
grails-spring/src/main/groovy/grails/spring/BeanBuilderBeanRegistryAdapter.java Provides the initial adapter implementation by delegating to BeanBuilder.
grails-spring/src/test/groovy/grails/spring/BeanBuilderBeanRegistryAdapterTest.groovy Adds smoke coverage to ensure adapter-driven registration works end-to-end.
grails-spring/build.gradle Applies shared test configuration to ensure module-local JUnit Platform discovery/behavior.
grails-doc/src/en/guide/upgrading/beanRegistryAdapter.adoc Documents the new seam and the high-level migration approach.
grails-doc/src/en/guide/toc.yml Adds the new upgrading guide entry to the documentation TOC.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +43
public BeanBuilderBeanRegistryAdapter(BeanBuilder beanBuilder) {
this.beanBuilder = beanBuilder;
}
Comment on lines +29 to +33
* Experimental adapter seam for the BeanBuilder to Spring BeanRegistrar transition.
*
* @since 8.1
*/
public interface BeanRegistryAdapter {
Comment on lines +28 to +32
/**
* Experimental adapter seam for the BeanBuilder to Spring BeanRegistrar transition.
*
* @since 8.1
*/
Comment on lines +1 to +7
=== BeanBuilder to BeanRegistry strategy

Grails 8.1 introduces an experimental `grails.spring.BeanRegistryAdapter` seam as the first step toward the Spring 7 `BeanRegistrar` direction tracked in issue #15824.
The initial `BeanBuilderBeanRegistryAdapter` delegates to the existing `BeanBuilder`, so `resources.groovy`, plugin `doWithSpring`, and existing BeanBuilder APIs continue to work unchanged.

The intended migration path is to move call sites behind the adapter first, then add a Spring 7 BeanRegistrar-backed implementation once the framework integration points are ready.
BeanBuilder is not removed or behaviorally changed by this seed.
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 49.5691%. Comparing base (b00e83e) to head (ea082c6).
⚠️ Report is 8 commits behind head on 8.0.x.

Files with missing lines Patch % Lines
.../grails/spring/BeanBuilderBeanRegistryAdapter.java 90.9091% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #15957        +/-   ##
==================================================
+ Coverage     49.5403%   49.5691%   +0.0288%     
- Complexity      16922      16937        +15     
==================================================
  Files            1999       2000         +1     
  Lines           93754      93764        +10     
  Branches        16420      16419         -1     
==================================================
+ Hits            46446      46478        +32     
+ Misses          40145      40121        -24     
- Partials         7163       7165         +2     
Files with missing lines Coverage Δ
.../grails/spring/BeanBuilderBeanRegistryAdapter.java 90.9091% <90.9091%> (ø)

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

@testlens-app

testlens-app Bot commented Jul 10, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: ea082c6
▶️ Tests: 14824 executed
⚪️ Checks: 60/60 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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants