Skip to content

Extract shared BOM build conventions#15827

Open
jamesfredley wants to merge 2 commits into
8.0.xfrom
fix/bom-build-script-cleanups
Open

Extract shared BOM build conventions#15827
jamesfredley wants to merge 2 commits into
8.0.xfrom
fix/bom-build-script-cleanups

Conversation

@jamesfredley

@jamesfredley jamesfredley commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR reduces duplicated Gradle BOM build logic by moving the shared publication, POM customization, constraint extraction, and release snapshot validation conventions into org.apache.grails.buildsrc.bom-conventions.

The BOM build scripts now keep only BOM-specific inputs such as descriptions, dependency declarations, and variant-specific dependency sets. The shared plugin owns the common task wiring and POM mutation behavior used by the seven Grails BOM projects.

Changes

  • Add BomConventionsPlugin in build-logic/plugins and register it as org.apache.grails.buildsrc.bom-conventions.
  • Apply the shared plugin in all seven BOM projects.
  • Preserve BOM-specific dependency and platform declarations in each BOM script.
  • Reduce duplicated Groovy module override maps in dependencies.gradle while leaving one literal coordinate list for Dependabot visibility.
  • Remove unreachable BOM override branches for Micronaut/Hibernate variants.
  • Address Copilot feedback by using the configured gradleBuildProjects group mapping when registering Gradle-build artifacts for POM property replacement.
  • Add TestKit coverage for shared BOM plugin wiring and Gradle-build artifact POM property generation.

Verification

  • JAVA_HOME=/tmp/opencode/jdk21 ./gradlew :build-logic-root:build-logic:compileGroovy :build-logic-root:build-logic:test
  • JAVA_HOME=/tmp/opencode/jdk21 ./gradlew :build-logic-root:build-logic:test --tests org.apache.grails.buildsrc.BomConventionsPluginSpec
  • Generated all seven BOM POMs with -PincludeMicronautProjects.
  • Ran extractConstraints for all seven BOMs with -PincludeMicronautProjects.
  • Compared generated constraints against a clean origin/8.0.x baseline: no differences.
  • Compared generated POMs against the baseline: only the intended base BOM improvement differs, where Gradle-build artifacts now use generated version properties instead of inline 8.0.0-SNAPSHOT versions.

Notes

  • LSP diagnostics are unavailable locally for .groovy / .gradle because no Groovy/Gradle LSP is configured.
  • The full aggregate gate currently has unrelated baseline failures on origin/8.0.x (GraphQL static compile errors and MongoDB timeout flakes), reproduced in a clean baseline worktree.

Centralize duplicated BOM publication, constraint extraction, and POM customization logic in a build-logic convention plugin. Apply it across the BOM modules while keeping generated POM and constraints output byte-identical to the current 8.0.x baseline.

Assisted-by: Hephaestus:openai/gpt-5.5 codex-review
Copilot AI review requested due to automatic review settings July 5, 2026 00:21

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 pull request extracts repeated Grails BOM build logic into a shared build-logic Gradle plugin, then applies it across the various BOM subprojects to reduce duplication and centralize publication / POM / constraints behavior.

Changes:

  • Add org.apache.grails.buildsrc.bom-conventions plugin to encapsulate common BOM conventions (publication hooks, constraints extraction wiring, snapshot validation, POM customization).
  • Update Grails BOM subprojects (default/base/hibernate*/micronaut*) to use the shared plugin and remove duplicated build script logic.
  • Refactor dependencies.gradle to generate Groovy module dependency maps via a shared helper and remove now-unreachable override branches.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
grails-bom/micronaut/build.gradle Switch Micronaut BOM to shared bom-conventions plugin; remove duplicated publication/constraints logic.
grails-bom/hibernate7/build.gradle Switch Hibernate 7 BOM to shared bom-conventions plugin; remove duplicated publication/constraints logic.
grails-bom/hibernate7-micronaut/build.gradle Switch Hibernate 7 + Micronaut BOM to shared bom-conventions plugin; remove duplicated publication/constraints logic.
grails-bom/hibernate5/build.gradle Switch Hibernate 5 BOM to shared bom-conventions plugin; remove duplicated publication/constraints logic.
grails-bom/hibernate5-micronaut/build.gradle Switch Hibernate 5 + Micronaut BOM to shared bom-conventions plugin; remove duplicated publication/constraints logic.
grails-bom/default/build.gradle Switch default BOM to shared bom-conventions plugin; remove duplicated publication/constraints logic.
grails-bom/base/build.gradle Switch base BOM to shared bom-conventions plugin; remove duplicated publication/constraints logic.
dependencies.gradle Extract Groovy module dependency map generation into a helper and simplify override branching.
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/BomConventionsPlugin.groovy New shared BOM conventions plugin implementing extracted common logic.
build-logic/plugins/build.gradle Register the new plugin and add required module dependency for BOM task classes.

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

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.5622%. Comparing base (9702f00) to head (206a4b6).
⚠️ Report is 16 commits behind head on 8.0.x.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #15827        +/-   ##
==================================================
- Coverage     49.5680%   49.5622%   -0.0059%     
+ Complexity      16689      16688         -1     
==================================================
  Files            1947       1947                
  Lines           92598      92611        +13     
  Branches        16179      16182         +3     
==================================================
+ Hits            45899      45900         +1     
- Misses          39598      39610        +12     
  Partials         7101       7101                

see 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.

Use the configured Gradle-build project group mappings when registering POM property replacements, and add focused TestKit coverage for the shared BOM conventions plugin.

Assisted-by: Hephaestus:openai/gpt-5.5 codex-review
@testlens-app

testlens-app Bot commented Jul 5, 2026

Copy link
Copy Markdown

🚨 TestLens detected 5 failed tests 🚨

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 - Groovy Joint Validation Build / build_grails > :grails-test-examples-gorm:integrationTest

Test Runs
DirtyCheckBindingSpec > an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP

CI / Build Grails-Core (windows-latest, 25) > :grails-shell-cli:test

Test Runs
RunningApplicationProcessSpec > stop terminates a running process and removes the PID file

CI / Functional Tests (Java 21, indy=false) > :grails-test-examples-gorm:integrationTest

Test Runs
DirtyCheckBindingSpec > an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP

CI / Functional Tests (Java 21, indy=true) > :grails-test-examples-gorm:integrationTest

Test Runs
DirtyCheckBindingSpec > an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP

CI / Functional Tests (Java 25, indy=false) > :grails-test-examples-gorm:integrationTest

Test Runs
DirtyCheckBindingSpec > an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP

🏷️ Commit: 206a4b6
▶️ Tests: 27345 executed
⚪️ Checks: 44/44 completed

Test Failures

RunningApplicationProcessSpec > stop terminates a running process and removes the PID file (:grails-shell-cli:test in CI / Build Grails-Core (windows-latest, 25))
Condition not satisfied:

!process.isAlive()
||       |
||       true
|Process[pid=3760, exitValue=1]
false

	at org.grails.cli.gradle.RunningApplicationProcessSpec.stop terminates a running process and removes the PID file(RunningApplicationProcessSpec.groovy:217)
DirtyCheckBindingSpec > an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP (:grails-test-examples-gorm:integrationTest in CI / Functional Tests (Java 21, indy=false))
groovy.lang.MissingPropertyException: No such property: FORM for class: gorm.DirtyCheckBindingSpec
	at gorm.DirtyCheckBindingSpec.an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP(DirtyCheckBindingSpec.groovy:83)
DirtyCheckBindingSpec > an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP (:grails-test-examples-gorm:integrationTest in CI / Functional Tests (Java 21, indy=true))
groovy.lang.MissingPropertyException: No such property: FORM for class: gorm.DirtyCheckBindingSpec
	at gorm.DirtyCheckBindingSpec.an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP(DirtyCheckBindingSpec.groovy:83)
DirtyCheckBindingSpec > an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP (:grails-test-examples-gorm:integrationTest in CI / Functional Tests (Java 25, indy=false))
groovy.lang.MissingPropertyException: No such property: FORM for class: gorm.DirtyCheckBindingSpec
	at gorm.DirtyCheckBindingSpec.an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP(DirtyCheckBindingSpec.groovy:83)
DirtyCheckBindingSpec > an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP (:grails-test-examples-gorm:integrationTest in CI - Groovy Joint Validation Build / build_grails)
groovy.lang.MissingPropertyException: No such property: FORM for class: gorm.DirtyCheckBindingSpec
	at gorm.DirtyCheckBindingSpec.an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP(DirtyCheckBindingSpec.groovy:83)

Muted Tests

Select tests to mute in this pull request:

  • DirtyCheckBindingSpec > an explicit bindable:true id constraint declared on a @DirtyCheck base is inherited and binds over HTTP
  • RunningApplicationProcessSpec > stop terminates a running process and removes the PID file

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.

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants