You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "codeconsole (via GitHub)" <gi...@apache.org> on 2026/08/25 08:10:41 UTC
[PR] Let autoConfigurationName name a package as well as a class [grails-core]
codeconsole opened a new pull request, #16221:
URL: https://github.com/apache/grails-core/pull/16221
`@GrailsBeans(autoConfigurationName = "...")` sets only the *simple* name of the generated sibling; the package is always the plugin descriptor's own. Its documented purpose, though, is preserving the identity of an auto-configuration class a descriptor is being converted from:
> Set this when converting an existing public `@AutoConfiguration` class whose name doesn't follow that convention and **whose class identity must be preserved** (e.g. for `exclude =` references, `before=`/`after=` ordering from other modules, or tests that import it by name).
Every one of those references names the *qualified* name. And a plugin descriptor conventionally sits in the package its implementation classes sit **beneath** rather than alongside them, so the class being converted is usually in a different package — which means identity changed anyway and the attribute could not prevent it.
This came up converting `asset-pipeline`, whose descriptor is `asset.pipeline.AssetPipelineGrailsPlugin` while its hand-written auto-configuration is `asset.pipeline.grails.AssetPipelineAutoConfiguration`. There is no value of `autoConfigurationName` that keeps that name today.
## The change
`siblingSimpleName()` becomes `siblingName()` and returns the qualified name, so `createAutoConfigurationSibling` no longer prepends the descriptor's package unconditionally. Validation moves from `SourceVersion.isIdentifier` to `SourceVersion.isName`, which accepts a dotted sequence and rejects any part that is a keyword.
```java
return name.indexOf('.') < 0 ? qualify(packageName, name) : name;
```
```groovy
package com.example
@GrailsBeans(autoConfigurationName = 'com.example.web.ExampleAutoConfiguration')
@AutoConfiguration
class ExampleGrailsPlugin extends Plugin { def beans = { /* ... */ } }
```
**Backward compatible.** A dot was rejected outright before this, so every value that compiles today is a bare identifier and still resolves in the plugin's package. The non-literal and blank error paths are untouched; only the "is not a valid name" message extends to mention qualified names.
I deliberately did **not** restrict the package to one the plugin already owns — that would block legitimate conversions such as a descriptor at `com.foo.plugins.BarGrailsPlugin` replacing `com.foo.bar.BarAutoConfiguration`. Instead the javadoc and the guide both warn that generating into a package the plugin does not otherwise own splits that package across two jars, which modular and native-image consumers pay for. Happy to enforce rather than document it if you would prefer.
## Tests
Eight cases added to `GrailsBeansASTTransformationSpec`:
- a qualified name generates the sibling in the package it names, and **not** in the plugin's
- a qualified name still carries the annotations that move to the sibling (`@AutoConfiguration`, `@ConditionalOnWebApplication`), and they still leave the plugin class
- a bare name still names the sibling in the plugin's own package
- five `@Unroll`ed rejections: keyword package part, leading dot, trailing dot, empty part, space in a part
173 specs in `grails-beans-dsl`, 0 failures. Every module consuming the DSL was also run: `grails-core`, `grails-i18n`, `grails-domain-class`, `grails-sitemesh3`, and both `beans-dsl` test-example applications. `./gradlew codeStyle` is clean.
## Docs
`GrailsBeans.java`'s javadoc no longer promises identity preservation it could not deliver, and `hookingIntoRuntimeConfiguration.adoc` had an explicit "(still generated in the plugin's own package)" that is replaced with the qualified-name form and a worked example.
Targets `8.0.x`, where `@GrailsBeans` is new and unreleased. No ticket — happy to file one if you want it for the change log.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Let autoConfigurationName name a package as well as a class [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16221:
URL: https://github.com/apache/grails-core/pull/16221#issuecomment-5408689049
## ✅ All tests passed ✅
🏷️ Commit: ae65d133c9e30e90030ea0c58d19bafcfb6727df
▶️ Tests: 69408 executed
⚪️ Checks: 83/83 completed
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Let autoConfigurationName name a package as well as a class [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16221:
URL: https://github.com/apache/grails-core/pull/16221#issuecomment-5473998186
## 🚨 TestLens detected 1 failed test 🚨
Here is what you can do:
1) Inspect the test failures carefully.
2) If you are convinced that some of the tests are flaky, you can mute them below.
3) Finally, trigger a rerun by checking the rerun checkbox.
### Test Summary
#### [CI / Functional Tests \(Java 21, indy\=true\)](https://github.com/apache/grails-core/actions/runs/33356699859/job/99380144688?pr=16221) > :grails-test-examples-scaffolding:integrationTest
| Test | Runs | Flakiness |
|---|---|--:|
| UserControllerSpec > User list | ❌ | [3% 🟡](https://github.com/apache/grails-core/issues/16030) |
🏷️ Commit: 10d7c84632cdba2515235c63570f159462877fe4
▶️ Tests: 59387 executed
🟡 Checks: 56/84 completed
### Test Failures
<details>
<summary><strong>UserControllerSpec > User list</strong> (:grails-test-examples-scaffolding:integrationTest in <a href="https://github.com/apache/grails-core/actions/runs/33356699859/job/99380144688?pr=16221">CI / Functional Tests (Java 21, indy=true)</a>)</summary>
```
geb.waiting.WaitTimeoutException: condition did not pass in 30 seconds (failed with exception)
at geb.waiting.Wait.waitFor(Wait.groovy:128)
at geb.waiting.DefaultWaitingSupport.doWaitFor(DefaultWaitingSupport.groovy:55)
at geb.waiting.DefaultWaitingSupport.waitFor(DefaultWaitingSupport.groovy:41)
at geb.Page.waitFor(Page.groovy:120)
at com.example.pages.LoginPage.login(LoginPage.groovy:39)
at com.example.UserControllerSpec.User list(UserControllerSpec.groovy:48)
Caused by: Assertion failed:
title != pageTitle && $('input', name: 'username').empty
| | | |
| | | false
| | 'Please sign in'
| false
'Please sign in'
at com.example.pages.LoginPage.login_closure1(LoginPage.groovy:39)
at com.example.pages.LoginPage.login_closure1(LoginPage.groovy)
at geb.waiting.Wait.waitFor(Wait.groovy:117)
... 5 more
```
</details>
### Rerun Controls
> [!NOTE]
> Checks are currently running using the configuration below.
Select tests to mute in this pull request:
🔲 UserControllerSpec > User list <!-- uniqueId=[engine:spock]/[spec:com.example.UserControllerSpec]/[feature:$spock_feature_1_0] -->
Reuse successful test results:
🔲 ♻️ Only rerun the tests that failed or were muted before
Click the checkbox to trigger a rerun:
🔲 **Rerun jobs**
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Let autoConfigurationName name a package as well as a class [grails-core]
Posted by "codeconsole (via GitHub)" <gi...@apache.org>.
codeconsole merged PR #16221:
URL: https://github.com/apache/grails-core/pull/16221
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Let autoConfigurationName name a package as well as a class [grails-core]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #16221:
URL: https://github.com/apache/grails-core/pull/16221#issuecomment-5407988724
## [Codecov](https://app.codecov.io/gh/apache/grails-core/pull/16221?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `85.71429%` with `1 line` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 54.1267%. Comparing base ([`27b6097`](https://app.codecov.io/gh/apache/grails-core/commit/27b60974896e6716a3ac0fbb05870f75b4f23a59?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`ae65d13`](https://app.codecov.io/gh/apache/grails-core/commit/ae65d133c9e30e90030ea0c58d19bafcfb6727df?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/grails-core/pull/16221?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...s/compiler/beans/GrailsBeansASTTransformation.java](https://app.codecov.io/gh/apache/grails-core/pull/16221?src=pr&el=tree&filepath=grails-beans-dsl%2Fsrc%2Fmain%2Fjava%2Forg%2Fgrails%2Fcompiler%2Fbeans%2FGrailsBeansASTTransformation.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWJlYW5zLWRzbC9zcmMvbWFpbi9qYXZhL29yZy9ncmFpbHMvY29tcGlsZXIvYmVhbnMvR3JhaWxzQmVhbnNBU1RUcmFuc2Zvcm1hdGlvbi5qYXZh) | 85.7143% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/grails-core/pull/16221?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/grails-core/pull/16221?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## 8.0.x #16221 +/- ##
==================================================
+ Coverage 54.1129% 54.1267% +0.0138%
- Complexity 20301 20312 +11
==================================================
Files 2107 2107
Lines 101146 101146
Branches 17922 17922
==================================================
+ Hits 54733 54747 +14
+ Misses 38605 38595 -10
+ Partials 7808 7804 -4
```
| [Files with missing lines](https://app.codecov.io/gh/apache/grails-core/pull/16221?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...s/compiler/beans/GrailsBeansASTTransformation.java](https://app.codecov.io/gh/apache/grails-core/pull/16221?src=pr&el=tree&filepath=grails-beans-dsl%2Fsrc%2Fmain%2Fjava%2Forg%2Fgrails%2Fcompiler%2Fbeans%2FGrailsBeansASTTransformation.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWJlYW5zLWRzbC9zcmMvbWFpbi9qYXZhL29yZy9ncmFpbHMvY29tcGlsZXIvYmVhbnMvR3JhaWxzQmVhbnNBU1RUcmFuc2Zvcm1hdGlvbi5qYXZh) | `86.2559% <85.7143%> (ø)` | |
... and [4 files with indirect coverage changes](https://app.codecov.io/gh/apache/grails-core/pull/16221/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org