Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/presto-release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 <name> 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 "<name>[^<]" "$POM_FILE"; then
echo "ERROR: $POM_FILE is missing <name> field or has empty <name>" | 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 <name> field"

echo "Checking all plugins for Java files..."

PLUGIN_DIRS=$(find . -name "pom.xml" -type f -exec \
grep -l "<packaging>presto-plugin</packaging>" {} \; \
| 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 <name> 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 <name>"
echo "- All $TOTAL_PLUGIN_COUNT plugins have Java files"
fi

- name: Set presto release version
run: |
unset MAVEN_CONFIG && ./mvnw versions:set -DremoveSnapshot -ntp
Expand Down Expand Up @@ -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 }}
30 changes: 13 additions & 17 deletions .github/workflows/release-notes-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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<<EOF" >> $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
1 change: 1 addition & 0 deletions presto-lance/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<version>0.297-SNAPSHOT</version>
</parent>

<name>presto-lance</name>
<artifactId>presto-lance</artifactId>
<description>Presto - LanceDB Connector</description>
<packaging>presto-plugin</packaging>
Expand Down
7 changes: 5 additions & 2 deletions src/release/release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading