-
Notifications
You must be signed in to change notification settings - Fork 860
chore: Add release tag orchestrator workflows #2540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,111 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Release Tag — Spark Branch Tags | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Triggers when a release rebase PR is merged into spark4.0 or spark4.1. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Creates the spark and python derivative tags automatically. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Part of the SynapseML Fabric Release Guide (Steps 1.4–1.5). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # See also: release-tag.yml (triggers the rebase PR). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types: [closed] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - spark4.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - spark4.1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| create-spark-tags: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Create spark & python tags | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: >- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| github.event.pull_request.merged == true && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| startsWith(github.event.pull_request.head.ref, 'release/') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Extract version and target | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: info | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BRANCH="${{ github.event.pull_request.head.ref }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TARGET="${{ github.event.pull_request.base.ref }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Extract version from branch name: release/v1.1.2-spark4.0 → 1.1.2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VERSION=$(echo "$BRANCH" | sed -E 's|release/v([0-9]+\.[0-9]+\.[0-9]+)-.*|\1|') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "target=$TARGET" >> "$GITHUB_OUTPUT" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "❌ Could not extract version from branch '$BRANCH'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Map branch to python version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "$TARGET" in | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spark4.0) echo "python_ver=3.12" >> "$GITHUB_OUTPUT" ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spark4.1) echo "python_ver=3.13" >> "$GITHUB_OUTPUT" ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *) echo "❌ Unknown target: $TARGET"; exit 1 ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| esac | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "📦 Version: $VERSION, Target: $TARGET" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ref: ${{ github.event.pull_request.base.ref }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Configure git | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git config user.name "github-actions[bot]" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Create and push tags | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VERSION="${{ steps.info.outputs.version }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TARGET="${{ steps.info.outputs.target }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PYTHON_VER="${{ steps.info.outputs.python_ver }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SPARK_TAG="v${VERSION}-${TARGET}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PYTHON_TAG="v${VERSION}-python${PYTHON_VER}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for TAG in "$SPARK_TAG" "$PYTHON_TAG"; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if git rev-parse "$TAG" >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "⚠️ $TAG already exists — skipping" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git tag "$TAG" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "🏷️ Created $TAG" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git push origin "$SPARK_TAG" "$PYTHON_TAG" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "✅ Tags pushed" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+75
to
+84
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if git rev-parse "$TAG" >/dev/null 2>&1; then | |
| echo "⚠️ $TAG already exists — skipping" | |
| else | |
| git tag "$TAG" | |
| echo "🏷️ Created $TAG" | |
| fi | |
| done | |
| git push origin "$SPARK_TAG" "$PYTHON_TAG" 2>/dev/null || true | |
| echo "✅ Tags pushed" | |
| if git ls-remote --exit-code --tags origin "refs/tags/$TAG" >/dev/null 2>&1; then | |
| echo "⚠️ $TAG already exists on origin — skipping" | |
| continue | |
| fi | |
| if git rev-parse "$TAG" >/dev/null 2>&1; then | |
| echo "🏷️ $TAG already exists locally" | |
| else | |
| git tag "$TAG" | |
| echo "🏷️ Created $TAG" | |
| fi | |
| git push origin "refs/tags/$TAG" | |
| echo "✅ Pushed $TAG" | |
| done | |
| echo "✅ Tag processing complete" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,125 @@ | ||||||||||||||||||||||||||
| name: Release Tag Orchestrator | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Triggers when a primary version tag (v1.1.2) is pushed to master. | ||||||||||||||||||||||||||
| # Creates the python3.11 tag and opens a PR to rebase spark4.0. | ||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||
| # Part of the SynapseML Fabric Release Guide (Steps 1.4–1.5). | ||||||||||||||||||||||||||
| # See also: release-tag-spark.yml (creates spark/python tags after PR merge). | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||||
| - "v[0-9]+.[0-9]+.[0-9]+" | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| - "v[0-9]+.[0-9]+.[0-9]+" | |
| - "v[0-9]*.[0-9]*.[0-9]*" |
Copilot
AI
Apr 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step claims to create the tag "on master", but it never checks out master (the workflow is triggered from a tag ref, so HEAD will be detached at the pushed tag’s commit). As written, git tag \"$TAG\" will tag the current HEAD, which might not be master. Fix by explicitly targeting origin/master (e.g., checkout/switch to master or create the tag at the origin/master commit SHA).
| git tag "$TAG" | |
| git tag "$TAG" origin/master |
Copilot
AI
Apr 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git checkout spark4.0 can fail even when the remote branch exists, because a local spark4.0 branch may not exist in the runner clone. Prefer checking out explicitly from the remote (e.g., fetch and create/reset a local branch from origin/spark4.0). This makes the workflow reliable across clean runners.
| if ! git checkout spark4.0 2>/dev/null; then | |
| echo "⚠️ spark4.0 branch doesn't exist — skipping" | |
| exit 0 | |
| fi | |
| git fetch origin spark4.0 | |
| if ! git show-ref --verify --quiet refs/remotes/origin/spark4.0; then | |
| echo "⚠️ spark4.0 branch doesn't exist — skipping" | |
| exit 0 | |
| fi | |
| git checkout -B spark4.0 origin/spark4.0 |
Copilot
AI
Apr 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow is described as idempotent, but reruns can fail or create duplicates: git checkout -b fails if the branch already exists, and gh pr create can error or open a second PR for the same head/base. Consider making this section rerun-safe by reusing/updating an existing branch (or skipping if it exists) and querying for an existing open PR for the same head/base before creating a new one.
Copilot
AI
Apr 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow is described as idempotent, but reruns can fail or create duplicates: git checkout -b fails if the branch already exists, and gh pr create can error or open a second PR for the same head/base. Consider making this section rerun-safe by reusing/updating an existing branch (or skipping if it exists) and querying for an existing open PR for the same head/base before creating a new one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This checkout uses the default shallow fetch (depth 1) and may not fetch tags. That makes the later
git rev-parse \"$TAG\"existence checks unreliable (it may think tags don’t exist locally), and increases the chance of push conflicts. Setfetch-depth: 0(and ensure tags are fetched) so tag existence checks reflect the remote state.