Seed BeanRegistry adapter over BeanBuilder#15957
Conversation
Add experimental BeanRegistryAdapter that still uses BeanBuilder while documenting Spring 7 BeanRegistrar path. Assisted-by: Sisyphus:xai/grok-4.5 [gpt-coding]
There was a problem hiding this comment.
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.BeanRegistryAdapterSPI plus aBeanBuilder-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-springinto 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.
| public BeanBuilderBeanRegistryAdapter(BeanBuilder beanBuilder) { | ||
| this.beanBuilder = beanBuilder; | ||
| } |
| * Experimental adapter seam for the BeanBuilder to Spring BeanRegistrar transition. | ||
| * | ||
| * @since 8.1 | ||
| */ | ||
| public interface BeanRegistryAdapter { |
| /** | ||
| * Experimental adapter seam for the BeanBuilder to Spring BeanRegistrar transition. | ||
| * | ||
| * @since 8.1 | ||
| */ |
| === 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 Report❌ Patch coverage is
Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
✅ All tests passed ✅🏷️ Commit: ea082c6 Learn more about TestLens at testlens.app. |
Description
What was found
What changed
BeanRegistryAdapterBeanBuilderBeanRegistryAdapterstill uses BeanBuilderOut of scope / follow-up
doWithSpringmigration toolingRelated MD topics
Contributor Checklist
Issue and Scope
8.0.x.Code Quality
Licensing and Attribution
ai-generated-starting-pointlabel applied.Documentation
Assisted-by: Sisyphus:xai/grok-4.5 [gpt-coding]