jason810496 commented on code in PR #69582:
URL: https://github.com/apache/airflow/pull/69582#discussion_r3544077700


##########
java-sdk/bom/build.gradle.kts:
##########
@@ -48,3 +53,45 @@ publishing {
         }
     }
 }
+
+// What the BOM currently constrains (group org.apache.airflow).
+val bomArtifacts =
+    configurations["api"].dependencyConstraints
+        .filter { it.group == "org.apache.airflow" }
+        .map { it.name }
+        .toSet()
+
+val publishedArtifacts =
+    rootProject.subprojects
+        .filter { it.path != project.path }
+        .flatMap { sub ->
+            evaluationDependsOn(sub.path)
+            sub.extensions.findByType(PublishingExtension::class.java)
+                ?.publications
+                ?.withType(MavenPublication::class.java)
+                ?.filter { it.groupId == "org.apache.airflow" }
+                ?.map { it.artifactId }
+                ?: emptyList()
+        }
+        .toSet()
+
+val verifyBomCoverage by tasks.registering {
+    group = "verification"
+    description = "Fail if airflow-sdk-bom does not constrain the same set of 
published Java SDK artifacts."
+    doLast {
+        val missing = (publishedArtifacts - bomArtifacts).sorted()
+        val stale = (bomArtifacts - publishedArtifacts).sorted()
+        if (missing.isNotEmpty() || stale.isNotEmpty()) {
+            throw GradleException(
+                buildString {
+                    appendLine("airflow-sdk-bom is out of sync with the 
published Java SDK artifacts:")
+                    if (missing.isNotEmpty()) appendLine("  published but 
missing from the BOM: $missing")
+                    if (stale.isNotEmpty()) appendLine("  listed in the BOM 
but not published: $stale")
+                    append("Update constraints in bom/build.gradle.kts to 
match.")
+                },
+            )
+        }
+    }
+}
+
+tasks.named("check") { dependsOn(verifyBomCoverage) }

Review Comment:
   Sure, but I will do this in follow-up as this is non-blocking and Jarek 
approve the PR so I think we can start the RC3.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to