uranusjr commented on code in PR #69527:
URL: https://github.com/apache/airflow/pull/69527#discussion_r3534681384


##########
java-sdk/sdk/build.gradle.kts:
##########
@@ -150,16 +155,69 @@ abstract class GenerateDiscriminatorTask : DefaultTask() {
     }
 }
 
+abstract class SyncSupervisorSchemaTask : DefaultTask() {
+    @get:Input
+    abstract val schemaVersion: Property<String>
+
+    @get:Input
+    abstract val baseUrl: Property<String>
+
+    @get:Internal
+    abstract val schemaFile: RegularFileProperty
+
+    private fun apiVersionOf(file: File): String =
+        if (file.exists()) {
+            com.fasterxml.jackson.databind
+                .ObjectMapper()
+                .readTree(file)
+                .path("api_version")
+                .asText()
+        } else {
+            ""
+        }
+
+    @TaskAction
+    fun sync() {
+        val file = schemaFile.get().asFile
+        val version = schemaVersion.get()
+        if (apiVersionOf(file) == version) {
+            logger.lifecycle("Supervisor Schema is up-to-date 
(api_version=$version).")
+            return
+        }

Review Comment:
   Also I think generally the approach should be to only depend on a version 
that is frozen and will not change. So the SDK shouldn’t bump too eagerly—it 
should stay on 2026-06-16 (the current latest) until Airflow 3.4 if cut, or at 
least we are relatively sure the version’s content will not change in-place. 
This should generally work since we have the migrations ready.
   
   In edge cases where a new change in the API is urgently needed, we can 
manually fix the schema file and regenerate.



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