The GitHub Actions job "Code Style" on 
grails-core.git/feat/beans-dsl-diagnostics-8.0.x has failed.
Run started by GitHub user codeconsole (triggered by codeconsole).

Head commit for run:
6509f299291968f951311e2dc7396da9f9380aad / Scott Murphy Heiberg 
<[email protected]>
Fail a stray beans statement on a plugin descriptor too

The previous commit split the severity: a compile error on an application
class, a warning on a plugin descriptor, on the grounds that a descriptor's
`beans` property might predate the DSL. Three things are wrong with that.

The warning is not a warning. GrailsASTUtils.warning is a System.err.println -
it never reaches the ErrorCollector, so there is no IDE marker, no Gradle
problem, and no record at all on the next build, which is UP-TO-DATE and prints
nothing while the descriptor still registers zero beans. Against a failure whose
whole problem is that it surfaces far from its cause, that is still silence.

The compatibility being protected has no population. No Grails version has ever
read a `beans` property off a descriptor - plugin loading reads doWithSpring,
watchedResources, onChange and friends; the only "beans" in DefaultGrailsPlugin,
on 8.0.x and 7.0.x alike, is BeanBuilder's own beans() method being handed the
doWithSpring closure. So the descriptor this spared has to be dead code that
also happens to contain a top-level bean(...) call.

And a descriptor is the case where loudness matters more, not less: it is
compiled by the plugin's author, but the missing beans are felt by every
downstream application, whose developers never see the plugin's build output.

Worse, isGrailsPluginDescriptorClass is a name-suffix test, so the split made
severity depend on the class name - moving an identical block from
Application.groovy into FooGrailsPlugin.groovy silently downgraded a build
failure to a line of stderr.

One rule now, host-independent: a `beans` closure containing any top-level
bean/field/method call is the DSL and must be entirely the DSL; one containing
none is not the DSL and is left alone. The message gains the way out for a
property that genuinely is not the DSL - rename it - which is the escape the
warning was standing in for.

Report URL: https://github.com/apache/grails-core/actions/runs/33561623792

With regards,
GitHub Actions via GitBox

Reply via email to