Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
14 changes: 11 additions & 3 deletions .github/workflows/maven-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ jobs:
uses: "actions/upload-artifact@v4"
with:
name: "presto-server"
path: "presto-server/target/presto-server-0.293.tar.gz"
path: "presto-server/target/presto-server-*.tar.gz"
if-no-files-found: "error"
retention-days: 1
- name: "Upload presto-cli"
if: matrix.java == '8.0.442'
uses: "actions/upload-artifact@v4"
with:
name: "presto-cli"
path: "presto-cli/target/presto-cli-0.293-executable.jar"
path: "presto-cli/target/presto-cli-*-executable.jar"
if-no-files-found: "error"
retention-days: 1
- name: "Clean Maven output"
Expand Down Expand Up @@ -100,12 +100,20 @@ jobs:
images: "ghcr.io/${{github.repository}}/coordinator"
tags: "type=raw,value=dev"

- name: Get presto release version
id: get-version
run: |
PRESTO_DEVELOP_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
-Dexpression=project.version -q -ntp -DforceStdout | tail -n 1)
echo "PRESTO_DEVELOP_VERSION=$PRESTO_DEVELOP_VERSION" >> $GITHUB_ENV
echo "PRESTO_DEVELOP_VERSION=$PRESTO_DEVELOP_VERSION"

- name: "Build and push"
uses: "docker/build-push-action@v6"
with:
build-args: |-
JMX_PROMETHEUS_JAVA_AGENT_VERSION=0.20.0
PRESTO_VERSION=0.293
PRESTO_VERSION=${{ env.PRESTO_DEVELOP_VERSION }}
context: "./docker"
file: "./docker/Dockerfile"
push: >-
Expand Down
107 changes: 107 additions & 0 deletions .github/workflows/presto-release-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: YScope Presto - CLP Connector Stable Release - Prepare

on:
workflow_dispatch:
inputs:
prepare_release:
description: 'Prepare release branch and tag'
type: boolean
default: true
required: false

env:
JAVA_VERSION: ${{ vars.JAVA_VERSION || '17.0.13' }}
JAVA_DISTRIBUTION: ${{ vars.JAVA_DISTRIBUTION || 'temurin' }}
MAVEN_OPTS: ${{ vars.MAVEN_OPTS }}
GIT_CI_USER: ${{ github.actor }}
GIT_CI_EMAIL: "${{ github.actor }}@users.noreply.github.com"

jobs:
prepare-release-branch:
if: ${{ inputs.prepare_release }}
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout presto source
uses: actions/checkout@v4
with:
show-progress: false
fetch-depth: 5

- name: Ensure checkout latest code
run: |
git fetch origin ${{ github.ref_name }}
if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/${{ github.ref_name }})" ]; then
echo "Branch ${{ github.ref_name }} has new commits. Resetting to latest."
git reset --hard origin/${{ github.ref_name }}
else
echo "Branch ${{ github.ref_name }} is already up to date."
fi

- name: Set up JDK ${{ env.JAVA_DISTRIBUTION }}/${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}

- name: Configure git
run: |
git config --global --add safe.directory ${{github.workspace}}
git config --global user.email "${{ env.GIT_CI_EMAIL }}"
git config --global user.name "${{ env.GIT_CI_USER }}"
git config --global alias.ls 'log --pretty=format:"%cd %h %ce: %s" --date=short --no-merges'
git config pull.rebase false

- name: Set presto release version
run: |
unset MAVEN_CONFIG && ./mvnw versions:set -DremoveSnapshot -ntp

- name: Get presto release version
id: get-version
run: |
PRESTO_RELEASE_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
-Dexpression=project.version -q -ntp -DforceStdout | tail -n 1)
echo "PRESTO_RELEASE_VERSION=$PRESTO_RELEASE_VERSION" >> $GITHUB_ENV
echo "PRESTO_RELEASE_VERSION=$PRESTO_RELEASE_VERSION"

- name: Prepare release tag and commits and push the preparation PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "In case this job failed, please delete the branch release-preparation-${{ env.PRESTO_RELEASE_VERSION }}, and re-run the job"
git reset --hard
git switch -c release-preparation-${{ env.PRESTO_RELEASE_VERSION }}
unset MAVEN_CONFIG && ./mvnw release:prepare --batch-mode \
-DskipTests \
-DautoVersionSubmodules \
-DdevelopmentVersion=${{ env.PRESTO_RELEASE_VERSION }} \
-DreleaseVersion=${{ env.PRESTO_RELEASE_VERSION }}
grep -m 2 "<version>" pom.xml
Comment on lines +78 to +83
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix development version passed to mvn release:prepare.

-DdevelopmentVersion=${{ env.PRESTO_RELEASE_VERSION }} sets the next development cycle to the release version without the required -SNAPSHOT suffix. The Maven Release Plugin will either fail (because the development version must end with -SNAPSHOT) or leave the release-preparation branch stuck on the release version instead of bumping to the expected 0.293.1-yscope-SNAPSHOT. Compute and pass the actual next snapshot (e.g., 0.293.1-yscope-SNAPSHOT) or let the plugin pick it automatically so the follow-up PR matches the documented flow.

🤖 Prompt for AI Agents
.github/workflows/presto-release-prepare.yml around lines 78 to 83: the workflow
passes the release version as -DdevelopmentVersion which lacks the required
-SNAPSHOT suffix, causing the Maven Release Plugin to fail or leave the branch
at the release version; change the step to either omit -DdevelopmentVersion so
the plugin computes the next snapshot automatically, or compute and pass a
proper snapshot value (append -SNAPSHOT to the intended next development
version, e.g., 0.293.1-yscope-SNAPSHOT) before invoking ./mvnw release:prepare.

echo "Pushing branch release-preparation-${{ env.PRESTO_RELEASE_VERSION }}"
git ls -5
git push origin release-preparation-${{ env.PRESTO_RELEASE_VERSION }}
echo "Creating PR for branch release-preparation-${{ env.PRESTO_RELEASE_VERSION }}"
NEXT_PRESTO_RELEASE_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
-Dexpression=project.version -q -ntp -DforceStdout | tail -n 1)
gh pr create \
--base release-0.293-clp-connector \
--head "release-preparation-${{ env.PRESTO_RELEASE_VERSION }}" \
--title "feat: Bump version to \`$NEXT_PRESTO_RELEASE_VERSION\` for next development cycle." \
--body "Automated pull request to bump the project version for the next development cycle."

- name: Push release tag, and branch
run: |
echo "In case this job failed, please delete the tag ${{ env.PRESTO_RELEASE_VERSION }} and the branch release-${{ env.PRESTO_RELEASE_VERSION }}, and re-run the job"
git checkout ${{ env.PRESTO_RELEASE_VERSION }}
git switch -c release-${{ env.PRESTO_RELEASE_VERSION }}
echo "Pushing release branch release-${{ env.PRESTO_RELEASE_VERSION }} and tag ${{ env.PRESTO_RELEASE_VERSION }}"

echo "commits on release-${{ env.PRESTO_RELEASE_VERSION }} branch"
git ls -4
git push origin release-${{ env.PRESTO_RELEASE_VERSION }} --tags
echo -e "\nPushed release tag to: ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ env.PRESTO_RELEASE_VERSION }}"
echo "Pushed release branch to: ${{ github.server_url }}/${{ github.repository }}/tree/release-${{ env.PRESTO_RELEASE_VERSION }}"
Loading
Loading