This is an automated email from the ASF dual-hosted git repository.
voonhous pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new d62850ee908a chore(ci): path-filter Trino CI on pull requests (#20376)
d62850ee908a is described below
commit d62850ee908acf00877d21ea12d0207e126e00f5
Author: voonhous <[email protected]>
AuthorDate: Mon Oct 19 21:50:45 2026 +0800
chore(ci): path-filter Trino CI on pull requests (#20376)
Every PR started detect-trino-changes plus a test-hudi-trino-plugin
job whose steps all skipped. test-hudi-trino-plugin is no longer a
required context, so the pull_request trigger can reuse the push
paths filter and start no runner on PRs that miss it.
---
.github/workflows/hudi_trino_ci.yml | 99 +++++++++----------------------------
1 file changed, 24 insertions(+), 75 deletions(-)
diff --git a/.github/workflows/hudi_trino_ci.yml
b/.github/workflows/hudi_trino_ci.yml
index dde37ec8a986..046724654772 100644
--- a/.github/workflows/hudi_trino_ci.yml
+++ b/.github/workflows/hudi_trino_ci.yml
@@ -11,7 +11,7 @@ on:
- 'scripts/trino/**'
# Upstream modules the connector build installs (the -am closure of the
JDK 17
# install step) plus the poms that own trino.version and the dependency
pins.
- # Keep in sync with the case patterns in detect-trino-changes below.
+ # Keep in sync with the pull_request paths below.
- 'pom.xml'
- 'hudi-tests-common/**'
- 'hudi-io/**'
@@ -24,16 +24,31 @@ on:
- 'hudi-client/hudi-java-client/**'
- 'hudi-sync/hudi-sync-common/**'
- 'hudi-sync/hudi-hive-sync/**'
- # No `paths:` filter here on purpose. A path-filtered workflow is never
instantiated on
- # PRs that miss the filter, so any run of this workflow that a reviewer or a
required
- # status check expects to see would sit permanently pending. Run on every PR
instead and
- # skip the expensive steps via the detect-trino-changes job below.
(test-hudi-trino-plugin
- # is no longer a required check: the .asf.yaml contexts list was reset when
the CI matrix
- # was trimmed. Restoring the filter here is an option if runner time gets
tight again.)
+ # Path-filtered like push. test-hudi-trino-plugin is not a required check,
so a PR the filter
+ # skips simply does not show it; it must not be added to the .asf.yaml
contexts list.
pull_request:
branches:
- master
- 'release-*'
+ paths:
+ - 'hudi-trino/**'
+ - '.github/workflows/hudi_trino_ci.yml'
+ - 'scripts/trino/**'
+ # Upstream modules the connector build installs (the -am closure of the
JDK 17
+ # install step) plus the poms that own trino.version and the dependency
pins.
+ # Keep in sync with the push paths above.
+ - 'pom.xml'
+ - 'hudi-tests-common/**'
+ - 'hudi-io/**'
+ - 'hudi-common/**'
+ - 'hudi-hadoop-common/**'
+ - 'hudi-timeline-service/**'
+ - 'hudi-hadoop-mr/**'
+ - 'hudi-client/pom.xml'
+ - 'hudi-client/hudi-client-common/**'
+ - 'hudi-client/hudi-java-client/**'
+ - 'hudi-sync/hudi-sync-common/**'
+ - 'hudi-sync/hudi-hive-sync/**'
workflow_dispatch:
concurrency:
@@ -44,72 +59,14 @@ env:
MVN_ARGS: -e -ntp -B -V -Dgpg.skip -Djacoco.skip -Pwarn-log
jobs:
- changes:
- name: detect-trino-changes
- runs-on: ubuntu-latest
- outputs:
- trino: ${{ steps.filter.outputs.trino }}
- steps:
- - name: Detect hudi-trino changes
- id: filter
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- REPO: ${{ github.repository }}
- EVENT: ${{ github.event_name }}
- PR_NUMBER: ${{ github.event.pull_request.number }}
- BEFORE_SHA: ${{ github.event.before }}
- AFTER_SHA: ${{ github.sha }}
- run: |
- set -euo pipefail
- TRINO=false
- if [ "$EVENT" = "pull_request" ]; then
- FILES=$(gh api --paginate "repos/$REPO/pulls/$PR_NUMBER/files"
--jq '.[].filename')
- elif [ "$EVENT" = "push" ]; then
- FILES=$(gh api "repos/$REPO/compare/$BEFORE_SHA...$AFTER_SHA" --jq
'.files[].filename')
- else
- # workflow_dispatch and anything else: always run the full build.
- FILES=""
- TRINO=true
- fi
- echo "Changed files:"
- printf '%s\n' "$FILES"
- while IFS= read -r f; do
- [ -z "$f" ] && continue
- case "$f" in
- hudi-trino/*) TRINO=true ;;
- .github/workflows/hudi_trino_ci.yml) TRINO=true ;;
- scripts/trino/*) TRINO=true ;;
- # Upstream modules the connector build installs (the -am closure
of the JDK 17
- # install step) plus the poms that own trino.version and the
dependency pins.
- # Keep in sync with the push paths above.
- pom.xml) TRINO=true ;;
- hudi-tests-common/*) TRINO=true ;;
- hudi-io/*) TRINO=true ;;
- hudi-common/*) TRINO=true ;;
- hudi-hadoop-common/*) TRINO=true ;;
- hudi-timeline-service/*) TRINO=true ;;
- hudi-hadoop-mr/*) TRINO=true ;;
- hudi-client/pom.xml) TRINO=true ;;
- hudi-client/hudi-client-common/*) TRINO=true ;;
- hudi-client/hudi-java-client/*) TRINO=true ;;
- hudi-sync/hudi-sync-common/*) TRINO=true ;;
- hudi-sync/hudi-hive-sync/*) TRINO=true ;;
- esac
- done <<< "$FILES"
- echo "trino=$TRINO"
- echo "trino=$TRINO" >> "$GITHUB_OUTPUT"
-
build-and-test:
name: test-hudi-trino-plugin
runs-on: ubuntu-latest
- needs: changes
steps:
- name: Checkout repository
- if: needs.changes.outputs.trino == 'true'
uses: actions/checkout@v5
- name: Read Trino pin
id: trino-pin
- if: needs.changes.outputs.trino == 'true'
run: |
set -euo pipefail
TRINO_SHA=$(sed -n 's|.*<trino.sha>\(.*\)</trino.sha>.*|\1|p'
pom.xml)
@@ -126,26 +83,22 @@ jobs:
# Build the upstream modules hudi-trino depends on under JDK 17 first,
# install them into the local m2, then build the connector itself under
JDK 25.
- name: Set up JDK 17
- if: needs.changes.outputs.trino == 'true'
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Install upstream Hudi modules (JDK 17)
- if: needs.changes.outputs.trino == 'true'
# hudi-client-common and hudi-java-client are pulled in here for the
test stage;
# they live behind the hudi-trino-tests profile but the test step
needs them.
run: mvn $MVN_ARGS install -pl
:hudi-common,:hudi-hive-sync,:hudi-io,:hudi-sync-common,:hudi-client-common,:hudi-java-client
-am -Dmaven.test.skip=true -Drat.skip -Dcheckstyle.skip
- name: Set up JDK 25
- if: needs.changes.outputs.trino == 'true'
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
cache: maven
- name: Purge Trino artifacts from the local m2
- if: needs.changes.outputs.trino == 'true'
# Artifacts an older pin left behind carry the same SNAPSHOT
coordinates as the current ones.
run: rm -rf ~/.m2/repository/io/trino
# Trino publishes neither SNAPSHOT artifacts nor the trino-spi /
trino-filesystem /
@@ -153,7 +106,6 @@ jobs:
# pinned trinodb/trino commit and cached under that commit.
- name: Restore Trino artifacts for the pinned commit
id: trino-m2
- if: needs.changes.outputs.trino == 'true'
uses: actions/cache@v4
with:
path: ~/.m2/repository/io/trino
@@ -161,24 +113,21 @@ jobs:
# No restore-keys on purpose: a partial restore from another pin
collides on the
# same SNAPSHOT coordinates and poisons the build.
- name: Checkout trinodb/trino at the pinned commit
- if: needs.changes.outputs.trino == 'true' &&
steps.trino-m2.outputs.cache-hit != 'true'
+ if: steps.trino-m2.outputs.cache-hit != 'true'
uses: actions/checkout@v5
with:
repository: trinodb/trino
ref: ${{ steps.trino-pin.outputs.trino_sha }}
path: trino-src
- name: Build Trino artifacts from source (JDK 25)
- if: needs.changes.outputs.trino == 'true' &&
steps.trino-m2.outputs.cache-hit != 'true'
+ if: steps.trino-m2.outputs.cache-hit != 'true'
run: scripts/trino/bootstrap_trino.sh trino-src --skip-checkout
- name: Build connector (JDK 25)
- if: needs.changes.outputs.trino == 'true'
run: mvn $MVN_ARGS -Phudi-trino -pl hudi-trino install
-Dmaven.test.skip=true
# The release deploy (-DdeployArtifacts=true) runs javadoc:jar with
doclint=none,
# and the module pom keeps failOnError=true. Reproduce that exact
configuration here
# so a javadoc break fails the PR instead of surfacing during the
staging deploy.
- name: Javadoc check (JDK 25)
- if: needs.changes.outputs.trino == 'true'
run: mvn $MVN_ARGS -Phudi-trino -pl hudi-trino javadoc:jar
-Ddoclint=none
- name: Test connector (JDK 25)
- if: needs.changes.outputs.trino == 'true'
run: mvn $MVN_ARGS -Phudi-trino,hudi-trino-tests -pl hudi-trino test