FANNG1 commented on code in PR #10424:
URL: https://github.com/apache/gravitino/pull/10424#discussion_r2944082971


##########
.github/workflows/build.yml:
##########
@@ -64,10 +65,52 @@ jobs:
               - spark-connector/**
             mcp_server_changes:
               - mcp-server/**
+            maintenance_source_changes:
+              - 'maintenance/**'
+            maintenance_changes:
+              - '.github/**'
+              - 'maintenance/**'
+              - 'api/**'
+              - 'common/**'
+              - 'core/**'
+              - 'catalogs/catalog-common/**'
+              - 'clients/client-java/**'
+              - 'integration-test-common/**'
+              - 'server/**'
+              - 'server-common/**'
+              - 'build.gradle.kts'
+              - 'gradle.properties'
+              - 'gradlew'
+              - 'settings.gradle.kts'
+              - 'gradle/**'
+      - name: Determine maintenance-only source changes
+        id: maintenance_only
+        env:
+          SOURCE_CHANGE_FILES: ${{ steps.filter.outputs.source_changes_files }}
+        run: |
+          python3 - <<'PY'
+          import json
+          import os
+
+          source_files = json.loads(os.environ.get("SOURCE_CHANGE_FILES") or 
"[]")
+          maintenance_only = bool(source_files) and all(
+            path.startswith("maintenance/") for path in source_files
+          )
+
+          with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as 
output:
+            output.write(
+              "maintenance_only_source_changes="
+              + ("true" if maintenance_only else "false")
+              + "\n"
+            )
+          PY
     outputs:
       source_changes: ${{ steps.filter.outputs.source_changes }}
       spark_connector_changes: ${{ 
steps.filter.outputs.spark_connector_changes }}
       mcp_server_changes: ${{ steps.filter.outputs.mcp_server_changes }}
+      maintenance_source_changes: ${{ 
steps.filter.outputs.maintenance_source_changes }}
+      maintenance_changes: ${{ steps.filter.outputs.maintenance_changes }}
+      maintenance_only_source_changes: ${{ 
steps.maintenance_only.outputs.maintenance_only_source_changes }}

Review Comment:
   Follow-up update: this part has been simplified in the latest change, so the 
previous explanation is outdated now.
   
   We no longer keep three different maintenance change flags in the workflow. 
The latest version keeps only one routing flag: `maintenance_only_changes`.
   
   Its meaning is now straightforward:
   - `maintenance_only_changes = true`: all effective source changes in the PR 
are under `maintenance/**`, so we run only the targeted maintenance build/test 
path
   - otherwise: we run the normal full build flow
   
   I also kept a comment in the workflow to explain that this flag is derived 
from `source_changes_files`, so non-source changes such as markdown files do 
not break the maintenance-only path.
   
   The reason for this change is maintainability. The previous version 
optimized more cases, but the routing logic was harder to understand. This 
version intentionally trades some fine-grained CI optimization for a much 
simpler and easier-to-maintain rule.



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