From bf5bdfd36b50e3bd40d6b8f6675f1f93452bbc10 Mon Sep 17 00:00:00 2001 From: unidevel Date: Mon, 30 Mar 2026 11:18:00 +0100 Subject: [PATCH] fix(ci): Update location of presto-release-tools with new version --- .github/workflows/presto-release-prepare.yml | 68 ++++++++++++++++++++ .github/workflows/release-notes-check.yml | 30 ++++----- presto-lance/pom.xml | 1 + src/release/release-notes.sh | 7 +- 4 files changed, 87 insertions(+), 19 deletions(-) diff --git a/.github/workflows/presto-release-prepare.yml b/.github/workflows/presto-release-prepare.yml index 0b07355bcf3aa..a72e28d8ff4dc 100644 --- a/.github/workflows/presto-release-prepare.yml +++ b/.github/workflows/presto-release-prepare.yml @@ -20,6 +20,7 @@ env: MAVEN_OPTS: ${{ vars.MAVEN_OPTS }} GIT_CI_USER: ${{ vars.GIT_CI_USER || 'prestodb-ci' }} GIT_CI_EMAIL: ${{ vars.GIT_CI_EMAIL || 'ci@lists.prestodb.io' }} + RELEASE_TOOLS_VERSION: ${{ vars.RELEASE_TOOLS_VERSION || '0.14' }} jobs: prepare-release-branch: @@ -67,6 +68,71 @@ jobs: git config --global alias.ls 'log --pretty=format:"%cd %h %ce: %s" --date=short --no-merges' git config pull.rebase false + - name: Validate Maven publishing requirements + run: | + echo "=== Validating Maven plugins ===" + + ERROR_FILE=$(mktemp) + MISSING_NAME_COUNT=0 + EMPTY_PLUGIN_COUNT=0 + TOTAL_POM_COUNT=0 + TOTAL_PLUGIN_COUNT=0 + + echo "Checking all pom.xml files for field..." + + POM_FILES=$(find . -name "pom.xml" -type f \ + | grep -v "target/" \ + | grep -v "node_modules" \ + | grep -v ".vscode" \ + | sort) + + for POM_FILE in $POM_FILES; do + TOTAL_POM_COUNT=$((TOTAL_POM_COUNT + 1)) + if ! grep -q "[^<]" "$POM_FILE"; then + echo "ERROR: $POM_FILE is missing field or has empty " | tee -a "$ERROR_FILE" + MISSING_NAME_COUNT=$((MISSING_NAME_COUNT + 1)) + fi + done + + echo "Found $TOTAL_POM_COUNT pom.xml files, $MISSING_NAME_COUNT missing field" + + echo "Checking all plugins for Java files..." + + PLUGIN_DIRS=$(find . -name "pom.xml" -type f -exec \ + grep -l "presto-plugin" {} \; \ + | xargs -I{} dirname {}) + + for PLUGIN_DIR in $PLUGIN_DIRS; do + TOTAL_PLUGIN_COUNT=$((TOTAL_PLUGIN_COUNT + 1)) + + JAVA_FILES=$(find "$PLUGIN_DIR/src/main/java" -name "*.java" -type f 2>/dev/null | wc -l) + + if [ "$JAVA_FILES" -eq 0 ]; then + echo "ERROR: Plugin $PLUGIN_DIR has no Java files in src/main/java" | tee -a "$ERROR_FILE" + EMPTY_PLUGIN_COUNT=$((EMPTY_PLUGIN_COUNT + 1)) + else + echo "Plugin $PLUGIN_DIR has $JAVA_FILES Java files" + fi + done + + echo "Found $TOTAL_PLUGIN_COUNT Maven plugins, $EMPTY_PLUGIN_COUNT without Java files" + + if [ -s "$ERROR_FILE" ]; then + echo "=== Validation failed! ===" + echo "Summary:" + echo "- $MISSING_NAME_COUNT/$TOTAL_POM_COUNT pom.xml files missing field" + echo "- $EMPTY_PLUGIN_COUNT/$TOTAL_PLUGIN_COUNT plugins without Java files" + echo "" + echo "Errors:" + cat "$ERROR_FILE" + exit 1 + else + echo "=== All validations passed! ===" + echo "Summary:" + echo "- All $TOTAL_POM_COUNT pom.xml files have " + echo "- All $TOTAL_PLUGIN_COUNT plugins have Java files" + fi + - name: Set presto release version run: | unset MAVEN_CONFIG && ./mvnw versions:set -DremoveSnapshot -ntp @@ -156,6 +222,8 @@ jobs: - name: Create release notes pull request env: JVM_OPTS: ${{ env.MAVEN_OPTS }} + RELEASE_TOOLS_VERSION: ${{ env.RELEASE_TOOLS_VERSION }} + REPO_OWNER: ${{ github.repository_owner }} run: | echo "In case this job failed, please delete the release notes branch(e.g. release-notes-0.292) in repository ${{ github.repository }}, and re-run the job" ./src/release/release-notes.sh ${{ github.repository_owner }} ${{ secrets.PRESTODB_CI_TOKEN }} diff --git a/.github/workflows/release-notes-check.yml b/.github/workflows/release-notes-check.yml index 57d547757e286..920dce0bc856d 100644 --- a/.github/workflows/release-notes-check.yml +++ b/.github/workflows/release-notes-check.yml @@ -5,7 +5,7 @@ on: types: [opened, edited, reopened] env: - RELEASE_TOOLS_VERSION: "0.11" + RELEASE_TOOLS_VERSION: ${{ vars.RELEASE_TOOLS_VERSION || '0.14' }} jobs: check_release_note: @@ -28,36 +28,32 @@ jobs: cache: maven - name: Get presto-release-tools run: | - ./mvnw \ - -B \ - -DgroupId=com.facebook.presto \ - -DartifactId=presto-release-tools -Dversion=${RELEASE_TOOLS_VERSION} \ - -Dpackaging=jar \ - -Dclassifier=executable \ - dependency:get + curl -L -o /tmp/presto_release "https://github.com/${{ github.repository_owner }}/presto-release-tools/releases/download/${RELEASE_TOOLS_VERSION}/presto-release-tools-${RELEASE_TOOLS_VERSION}-executable.jar" + chmod 755 /tmp/presto_release - name: Get PR body from GraphQL API id: graphql_query env: GH_TOKEN: ${{ github.token }} + REPO_OWNER: ${{ github.repository_owner }} + REPO_NAME: ${{ github.event.repository.name }} + PR_NUMBER: ${{ github.event.pull_request.number }} run: | echo "pr_bodytext<> $GITHUB_OUTPUT gh api graphql -f query=' - query { - repository(owner: "prestodb", name: "presto") { - pullRequest(number: ${{ github.event.pull_request.number }}) { - bodyText - } + query($owner: String!, $name: String!, $number: Int!) { + repository(owner: $owner, name: $name) { + pullRequest(number: $number) { + bodyText + } } } - ' --jq '.data.repository.pullRequest.bodyText' >> $GITHUB_OUTPUT + ' -f owner="$REPO_OWNER" -f name="$REPO_NAME" -F number="$PR_NUMBER" --jq '.data.repository.pullRequest.bodyText' >> $GITHUB_OUTPUT echo 'EOF' >> $GITHUB_OUTPUT - name: Echo PR Text env: PR_BODY: ${{ steps.graphql_query.outputs.pr_bodytext }} run: echo "${PR_BODY}" - - name: Set presto-release-tools as executable - run: chmod +x ~/.m2/repository/com/facebook/presto/presto-release-tools/${RELEASE_TOOLS_VERSION}/presto-release-tools-${RELEASE_TOOLS_VERSION}-executable.jar - name: Check release notes env: PR_BODY: ${{ steps.graphql_query.outputs.pr_bodytext }} - run: echo "${PR_BODY}" | ~/.m2/repository/com/facebook/presto/presto-release-tools/${RELEASE_TOOLS_VERSION}/presto-release-tools-${RELEASE_TOOLS_VERSION}-executable.jar check-release-notes + run: echo "${PR_BODY}" | /tmp/presto_release check-release-notes diff --git a/presto-lance/pom.xml b/presto-lance/pom.xml index 33918c2d04f38..03ae4f894da91 100644 --- a/presto-lance/pom.xml +++ b/presto-lance/pom.xml @@ -7,6 +7,7 @@ 0.297-SNAPSHOT + presto-lance presto-lance Presto - LanceDB Connector presto-plugin diff --git a/src/release/release-notes.sh b/src/release/release-notes.sh index 576652d82880a..0c08c08f797ac 100755 --- a/src/release/release-notes.sh +++ b/src/release/release-notes.sh @@ -5,6 +5,9 @@ if [[ "$#" -ne 2 ]]; then exit 1 fi -curl -L -o /tmp/presto_release "https://oss.sonatype.org/service/local/artifact/maven/redirect?g=com.facebook.presto&a=presto-release-tools&v=RELEASE&r=releases&c=executable&e=jar" +RELEASE_TOOLS_VERSION=${RELEASE_TOOLS_VERSION:-"0.14"} +REPO_OWNER=${REPO_OWNER:-"prestodb"} + +curl -L -o /tmp/presto_release "https://github.com/${REPO_OWNER}/presto-release-tools/releases/download/${RELEASE_TOOLS_VERSION}/presto-release-tools-${RELEASE_TOOLS_VERSION}-executable.jar" chmod 755 /tmp/presto_release -java ${JVM_OPTS} -jar /tmp/presto_release release-notes --github-user $1 --github-access-token $2 +java ${JVM_OPTS} -jar /tmp/presto_release release-notes --github-user $1 --github-access-token $2 \ No newline at end of file