Skip to content

Extract shared BOM build conventions#15827

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

Extract shared BOM build conventions#15827
jamesfredley wants to merge 3 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.3636%. Comparing base (05393b3) to head (23714e7).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #15827        +/-   ##
==================================================
+ Coverage     49.3625%   49.3636%   +0.0011%     
- Complexity      16777      16778         +1     
==================================================
  Files            1986       1986                
  Lines           93336      93336                
  Branches        16337      16337                
==================================================
+ Hits            46073      46074         +1     
- Misses          40134      40136         +2     
+ Partials         7129       7126         -3     

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 9, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 23714e7
▶️ Tests: 6611 executed
⚪️ Checks: 59/59 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