voonhous commented on code in PR #19642:
URL: https://github.com/apache/hudi/pull/19642#discussion_r3793860697


##########
.github/workflows/hudi_trino_compat.yml:
##########
@@ -59,18 +68,61 @@ jobs:
           echo "trino_version=$VERSION" >> "$GITHUB_OUTPUT"
           echo "Detected Trino version: $VERSION"
       - name: Install Trino modules from master (JDK 25)
-        working-directory: trino
-        # hudi-trino compiles against these plus their transitive modules 
(spi, cache, metastore,
-        # hive-formats, memory-context). They must come from the master 
checkout -- resolving from
-        # Maven Central would defeat the point of the drift check.
-        run: mvn $MVN_ARGS install -pl 
:trino-hive,:trino-filesystem-manager,:trino-parquet,:trino-plugin-toolkit -am 
-DskipTests -Dair.check.skip-all=true
+        # Same module set the pinned build uses, so a green compile here is a 
promotable pin. The
+        # script purges ~/.m2/repository/io/trino itself and only warns when 
master's version has
+        # rolled past the pinned trino.version.
+        env:
+          HEAD_SHA: ${{ steps.trino-head.outputs.head_sha }}
+        run: hudi/scripts/trino/bootstrap_trino.sh trino --skip-checkout --ref 
"$HEAD_SHA"
       - name: Compile hudi-trino against current Trino SPI (JDK 25)
         id: compile
         working-directory: hudi
         run: |
           mvn $MVN_ARGS -Phudi-trino \
             -Dtrino.version=${{ steps.trino-version.outputs.trino_version }} \
             -pl hudi-trino compile
+      - name: Save Trino artifacts under the candidate pin
+        # Pre-seeds the gating CI cache, which keys on the sha, so the pin 
advance below does not
+        # make every PR rebuild Trino from source.
+        if: steps.compile.outcome == 'success'
+        uses: actions/cache/save@v4
+        with:
+          path: ~/.m2/repository/io/trino
+          key: trino-m2-v1-${{ steps.trino-head.outputs.head_sha }}
+      - name: Propose pin advance
+        # Pin PRs are human-merged by policy. Org settings may forbid 
GITHUB_TOKEN from creating
+        # PRs; the branch still lands and the PR is then opened by hand.
+        working-directory: hudi
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          HEAD_SHA: ${{ steps.trino-head.outputs.head_sha }}
+          TRINO_VERSION: ${{ steps.trino-version.outputs.trino_version }}
+          BASE_BRANCH: ${{ github.ref_name }}
+        run: |
+          set -euo pipefail
+          PINNED_VERSION=$(sed -n 
's|.*<trino.version>\(.*\)</trino.version>.*|\1|p' pom.xml)
+          git config user.name 'github-actions[bot]'
+          git config user.email 
'41898282+github-actions[bot]@users.noreply.github.com'
+          git checkout -B bot/trino-pin
+          sed -i 
"s|<trino.sha>.*</trino.sha>|<trino.sha>${HEAD_SHA}</trino.sha>|" pom.xml
+          if [ "$TRINO_VERSION" != "$PINNED_VERSION" ]; then
+            # Version rollover: the shim's parent tracks trino.version.
+            sed -i 
"s|<trino.version>.*</trino.version>|<trino.version>${TRINO_VERSION}</trino.version>|"
 pom.xml
+            sed -i "/<parent>/,/<\/parent>/ 
s|<version>.*</version>|<version>${TRINO_VERSION}</version>|" 
docker/trino/shim/pom.xml
+          fi
+          if git diff --quiet; then
+            echo "Pin is already at ${HEAD_SHA}; nothing to propose."
+            exit 0
+          fi
+          TITLE="build(trino): advance trino master pin to ${HEAD_SHA:0:12}"
+          git commit -am "$TITLE"
+          git push --force origin bot/trino-pin
+          if [ -n "$(gh pr list --head bot/trino-pin --state open --json 
number --jq '.[].number')" ]; then
+            echo "Open pin PR picked up the force-push."
+            exit 0
+          fi
+          gh pr create --base "$BASE_BRANCH" --head bot/trino-pin --title 
"$TITLE" \

Review Comment:
   Right on both counts. Dropped `gh pr create` entirely in 00c42eebfa51: the 
job only force-pushes `bot/trino-pin` and writes a ready-to-run `gh pr create` 
one-liner to the step summary for a committer, and the commit/PR title is now 
`chore(trino): ...`.
   



##########
.github/workflows/hudi_trino_e2e.yml:
##########
@@ -16,9 +16,9 @@ on:
       #                         which compiles the whole module, so a break
       #                         anywhere in it fails this pipeline -- not just
       #                         under integ2/.
-      #   pom.xml               owns trino.version, which the shim pom's 
parent,
-      #                         the Dockerfile TRINO_VERSION arg and the
-      #                         hardcoded 481 paths below all track by hand.
+      #   pom.xml               owns trino.version / trino.sha / 
trino.e2e.version:
+      #                         the shim pom's parent, the plugin dir path and 
the
+      #                         server image version below are all derived 
from them.

Review Comment:
   Added `scripts/trino/**` to both paths lists in 00c42eebfa51.
   



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