Skip to content

Filter all-modules aggregate to only published modules#637

Merged
cbb330 merged 1 commit into
linkedin:mainfrom
cbb330:chbush/all-modules-published-filter
Jun 22, 2026
Merged

Filter all-modules aggregate to only published modules#637
cbb330 merged 1 commit into
linkedin:mainfrom
cbb330:chbush/all-modules-published-filter

Conversation

@cbb330

@cbb330 cbb330 commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

The all-modules aggregate referenced every leaf module, including client/common — a codegen-only helper consumed at build time via apply from: that is never published to Maven. ELR reads the all-modules POM and walks its <dependencies> transitively to mirror artifacts into the internal artifactory, so referencing an unpublished coordinate breaks the mirror (and collides on artifactId common with the published services/common).

This restricts the aggregate to leaf modules that apply maven-publish, so the published POM lists only resolvable coordinates. The member list now tracks publish status automatically — a module that stops publishing drops out of the POM with no manual upkeep.

Changes

  • Client-facing API Changes
  • Internal API Changes
  • Bug Fixes
  • New Features
  • Performance Improvements
  • Code Style
  • Refactoring
  • Documentation
  • Tests

For all the boxes checked, please include additional details of the changes made in this pull request.

all-modules/build.gradle now evaluates each leaf module and includes it only if it applies maven-publish:

-  rootProject.subprojects.each { subproject ->
-    if (subproject.path != project.path && subproject.subprojects.isEmpty()) {
-      implementation project(subproject.path)
+def publishedMembers = []
+rootProject.subprojects.each { subproject ->
+  if (subproject.path != project.path && subproject.subprojects.isEmpty()) {
+    evaluationDependsOn(subproject.path)
+    if (subproject.pluginManager.hasPlugin('maven-publish')) {
+      publishedMembers << subproject
     }
   }
 }
+
+dependencies {
+  publishedMembers.each { member ->
+    implementation project(member.path)
+  }
+}

Kept as a real-dependency aggregate, not a BOM: ELR walks <dependencies>, and a BOM publishes only lazy <dependencyManagement> constraints, which would leave nothing to mirror.

Testing Done

  • Manually Tested on local docker setup. Please include commands ran, and their output.
  • Added new tests for the changes made.
  • Updated existing tests to reflect the changes made.
  • No tests added or updated. Please explain why. If unsure, please feel free to ask for help.
  • Some other form of testing like staging or soak time in production. Please explain.

For all the boxes checked, include a detailed description of the testing done for the changes made in this pull request.

Build-config change, verified by generating and inspecting the published POM locally:

./gradlew :all-modules:generatePomFileForMavenJavaPublication
  • Generated POM lists 35 published OpenHouse modules as real implementation dependencies; the single unpublished leaf (client/common) is absent.
  • Regression check: temporarily removed maven-publish from apps/optimizer/analyzerapp, regenerated the POM → analyzerapp dropped out (35 → 34) while the still-published analyzer library it wraps stayed in. Reverted.

Additional Information

  • Breaking Changes
  • Deprecations
  • Large PR broken into smaller PRs, and PR plan linked in the description.

For all the boxes checked, include additional details of the changes made in this pull request.

No breaking changes — downstream ELR consumers continue to depend on the single all-modules coordinate.

The all-modules aggregate referenced every leaf module, including
client/common — a codegen-only helper consumed at build time via
`apply from:` that is never published to Maven. ELR reads the
all-modules POM and walks its dependencies transitively to mirror
artifacts into the internal artifactory, so referencing an unpublished
coordinate breaks the mirror (and collides on artifactId `common` with
the published services/common).

Restrict the aggregate to leaf modules that apply maven-publish, so the
published POM lists only resolvable coordinates. The member list now
tracks publish status automatically: a module that stops publishing
drops out of the POM with no manual upkeep.

Kept as a real-dependency aggregate, not a BOM — ELR walks <dependencies>,
and a BOM's lazy <dependencyManagement> would leave nothing to mirror.
@cbb330 cbb330 merged commit 5fa4a97 into linkedin:main Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants