This is an automated email from the ASF dual-hosted git repository.
jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new dabbce4fd5 [#10115] improvement(ci): Optimize build workflow for
maintenance changes (#10424)
dabbce4fd5 is described below
commit dabbce4fd5ab4a14142a5f6de651834a41b01730
Author: FANNG <[email protected]>
AuthorDate: Fri Mar 20 16:14:29 2026 +0900
[#10115] improvement(ci): Optimize build workflow for maintenance changes
(#10424)
### What changes were proposed in this pull request?
This PR updates the `build` workflow to handle maintenance changes
without introducing a separate maintenance workflow.
It adds maintenance-aware routing in the existing `build` job:
- pure `maintenance/**` source changes run only the targeted maintenance
module build path
- mixed changes still run the normal root build and then run maintenance
unit tests
- upstream dependency changes for maintenance also keep maintenance
validation enabled
### Why are the changes needed?
Maintenance-only changes do not need the full root build and release
flow.
This change reduces unnecessary CI work for those changes while keeping
maintenance validation enabled when maintenance sources or their
dependencies are affected.
Fix: #10115
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Verified locally with YAML validation and Gradle dry-run for:
- the maintenance-only build path
- the normal root build path with maintenance tests excluded
- the maintenance unit test path
Validated with temporary upstream CI runs for:
- maintenance-only changes
- maintenance and common mixed changes
- common-only changes
- web-only changes
---
.github/workflows/build.yml | 67 +++++++++++++++++++++++++++++++++++++++++----
1 file changed, 62 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e7a4386c3d..bd0ba9b2ef 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -31,6 +31,7 @@ jobs:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: filter
with:
+ list-files: shell
filters: |
source_changes:
- '.github/**'
@@ -64,10 +65,39 @@ jobs:
- spark-connector/**
mcp_server_changes:
- mcp-server/**
+ - name: Determine maintenance-module-only changes
+ id: maintenance_module_only
+ env:
+ SOURCE_CHANGE_FILES: ${{ steps.filter.outputs.source_changes_files }}
+ run: |
+ # Route to the maintenance-only build path only when every source
+ # change in the PR is under maintenance/. Non-source changes are
+ # already filtered out by source_changes_files.
+ source_files=()
+ if [ -n "${SOURCE_CHANGE_FILES}" ]; then
+ eval "source_files=(${SOURCE_CHANGE_FILES})"
+ fi
+
+ maintenance_module_only=false
+ if [ "${#source_files[@]}" -gt 0 ]; then
+ maintenance_module_only=true
+ for path in "${source_files[@]}"; do
+ case "$path" in
+ maintenance/*) ;;
+ *)
+ maintenance_module_only=false
+ break
+ ;;
+ esac
+ done
+ fi
+
+ echo "maintenance_module_only_changes=${maintenance_module_only}" >>
"${GITHUB_OUTPUT}"
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_module_only_changes: ${{
steps.maintenance_module_only.outputs.maintenance_module_only_changes }}
compile-check:
runs-on: ubuntu-latest
@@ -153,12 +183,39 @@ jobs:
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
- name: Build with Gradle
- if: needs.changes.outputs.mcp_server_changes == 'true'
- run: ./gradlew build -PskipITs -PskipDockerTests=false -x
:clients:client-python:build
+ run: |
+ if [ "${{ needs.changes.outputs.maintenance_module_only_changes }}"
= "true" ]; then
+ ./gradlew \
+ :maintenance:optimizer-api:build \
+ :maintenance:updaters:build \
+ :maintenance:optimizer:build \
+ :maintenance:jobs:build \
+ -PskipITs \
+ -PskipDockerTests=false
+ exit 0
+ fi
+
+ gradle_args=(
+ build
+ -PskipITs
+ -PskipDockerTests=false
+ -x :clients:client-python:build
+ )
+
+ if [ "${{ needs.changes.outputs.mcp_server_changes }}" != "true" ];
then
+ gradle_args+=(
+ -x :mcp-server:build
+ -x :mcp-server:test
+ -x :mcp-server:pylint
+ -x :web-v2:web:build
+ )
+ fi
+
+ printf './gradlew'
+ printf ' %q' "${gradle_args[@]}"
+ printf '\n'
- - name: Build with Gradle (skip mcp-server tests)
- if: needs.changes.outputs.mcp_server_changes != 'true'
- run: ./gradlew build -PskipITs -PskipDockerTests=false -x
:clients:client-python:build -x :mcp-server:build -x :mcp-server:test -x
:mcp-server:pylint -x :web-v2:web:build
+ ./gradlew "${gradle_args[@]}"
- name: Fetch base branch for coverage diff
if: github.event_name == 'pull_request'