Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4fcdc09
Migrate Spring update workflows to azure-sdk-for-java
rujche Jul 1, 2026
cd0a5a2
Enable PR path-based triggers for migrated workflows
rujche Jul 1, 2026
4debc5f
Address PR review feedback for Spring workflow migration
rujche Jul 1, 2026
8cdc57f
Fix Spring version source detection in generator
rujche Jul 1, 2026
3ad4064
Fix shellcheck quoting in Spring workflows
rujche Jul 1, 2026
b28564b
Harden workflow triggers and version comparison
rujche Jul 1, 2026
7a63afb
Run Spring update workflows from main ref
rujche Jul 1, 2026
d6b71fb
Fix Copilot review issues in Spring update automation
rujche Jul 1, 2026
12d7d9e
Add Spring Initializr terms to cspell dictionary
rujche Jul 1, 2026
b82f8ad
Fix RC workflow checkout for branch dispatch
rujche Jul 1, 2026
e392b76
Fix update workflows for branch dispatch scripts
rujche Jul 1, 2026
f81f713
Add force-update test mode for RC workflow
rujche Jul 1, 2026
52e0000
Harden PR body construction in Spring workflows
rujche Jul 1, 2026
7854810
Remove RC workflow test inputs and adjust current spring baseline
rujche Jul 1, 2026
4658b08
Revert temporary spring support matrix baseline
rujche Jul 1, 2026
28cb2bf
Support configurable base branch in Spring workflows
rujche Jul 1, 2026
d3fca62
Run support-file generation after base checkout
rujche Jul 1, 2026
e25768d
Harden Spring workflow env handling and BOM selection
rujche Jul 1, 2026
0237316
Preserve support matrix JSON spacing style
rujche Jul 1, 2026
f76c171
Fix RC target selection and support file robustness
rujche Jul 1, 2026
2889881
Tighten workflow permissions and document legacy support
rujche Jul 1, 2026
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
159 changes: 159 additions & 0 deletions .github/workflows/test-spring-boot-rc-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Test Spring Boot RC Version
on:
workflow_dispatch:
inputs:
base_branch:
description: 'Base branch for update branch and PR target. Defaults to trigger branch.'
required: false
type: string

env:
BASE_BRANCH: ${{ github.event.inputs.base_branch || github.ref_name }}

permissions:
contents: write
pull-requests: write
issues: write

Comment thread
rujche marked this conversation as resolved.
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Version File
run: |
python ./sdk/spring/scripts/generate_spring_versions_and_pr_description.py --prefer-prerelease
- name: Generate Spring Cloud Azure Support File
run: |
python ./sdk/spring/scripts/generate_spring_cloud_azure_support_file.py --include-rc
Comment on lines +29 to +31
- name: Confirm Whether to Update
run: |
if [[ ! -f 'spring-versions.txt' ]]; then
echo "No new Spring Boot version, no updates!"
elif grep -q -- "-RC" spring-versions.txt; then
echo "Has RC version, create PR to test!"
mapfile -t versions < spring-versions.txt
{
echo "need_update_version=true"
printf 'update_branch=update-spring-dependencies-%s-%s\n' "$(date +%Y%m%d)" "${GITHUB_RUN_ID}"
printf 'spring_boot_version=%s\n' "${versions[0]}"
printf 'spring_cloud_version=%s\n' "${versions[1]}"
printf 'PR_TITLE=Test Spring Boot RC version %s and Spring Cloud %s\n' "${versions[0]}" "${versions[1]}"
echo 'pr_descriptions<<EOF'
cat pr-descriptions.txt
echo 'EOF'
} >> "$GITHUB_ENV"
else
echo "No RC version, cancel update!"
fi
- name: Generate spring_boot_managed_external_dependencies.txt
if: ${{ env.need_update_version == 'true' }}
run: |
echo "Updating Spring Boot Dependencies Version: ${{ env.spring_boot_version }}"
echo "Updating Spring Cloud Dependencies Version: ${{ env.spring_cloud_version }}"
git fetch origin "${{ env.BASE_BRANCH }}"
git checkout -B "${{ env.update_branch }}" "origin/${{ env.BASE_BRANCH }}"
pip install termcolor
python ./sdk/spring/scripts/get_spring_boot_managed_external_dependencies.py -b "${{ env.spring_boot_version }}" -c "${{ env.spring_cloud_version }}"
- name: Update external_dependencies.txt
if: ${{ env.need_update_version == 'true' }}
run: |
pip install termcolor
pip install in_place
python ./sdk/spring/scripts/sync_external_dependencies.py -b "${{ env.spring_boot_version }}" -sbmvn 4
- name: Update Versions
if: ${{ env.need_update_version == 'true' }}
run: |
python ./eng/versioning/update_versions.py --sr
- name: Update ChangeLog
if: ${{ env.need_update_version == 'true' }}
run: |
python ./sdk/spring/scripts/update_changelog.py -b "${{ env.spring_boot_version }}" -c "${{ env.spring_cloud_version }}"
- name: Push Commit
if: ${{ env.need_update_version == 'true' }}
run: |
git config --global user.email github-actions@github.com
git config --global user.name github-actions
git add -A
git commit -m "Upgrade external dependencies to align with Spring Boot ${{ env.spring_boot_version }}"
python - <<'PY'
import json
from pathlib import Path

spring_boot_version = "${{ env.spring_boot_version }}"
spring_cloud_version = "${{ env.spring_cloud_version }}"
placeholder = "NONE_SUPPORTED_SPRING_CLOUD_VERSION"
matrix_path = Path("./sdk/spring/pipeline/spring-cloud-azure-supported-spring.json")

with matrix_path.open("r", encoding="utf-8") as f:
entries = json.load(f)

updated = False
for entry in entries:
if (
entry.get("spring-boot-version") == spring_boot_version
and entry.get("spring-cloud-version") == placeholder
):
entry["spring-cloud-version"] = spring_cloud_version
updated = True
break

if not updated:
print(
"No RC support-matrix placeholder entry found; "
"skipping support-file patch as a no-op."
)
raise SystemExit(0)

with matrix_path.open("w", encoding="utf-8") as f:
json.dump(entries, f, indent=2)
f.write("\n")
PY
git add ./sdk/spring/pipeline/spring-cloud-azure-supported-spring.json
if [[ -n "$(git diff --cached -- ./sdk/spring/pipeline/spring-cloud-azure-supported-spring.json)" ]]; then
git commit -m "Upgrade spring-cloud-azure-supported-spring"
else
echo "No support matrix changes detected, skip commit."
fi
git push origin "HEAD:${{ env.update_branch }}"
- name: Create Pull Request
id: create_pr
if: ${{ env.need_update_version == 'true' }}
uses: actions/github-script@v7
with:
script: |
const body = [
`Test Spring Boot RC version [${process.env.spring_boot_version}](https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies/${process.env.spring_boot_version}/spring-boot-dependencies-${process.env.spring_boot_version}.pom) and Spring Cloud version [${process.env.spring_cloud_version}](https://repo1.maven.org/maven2/org/springframework/cloud/spring-cloud-dependencies/${process.env.spring_cloud_version}/spring-cloud-dependencies-${process.env.spring_cloud_version}.pom).`,
process.env.pr_descriptions || '',
'',
`This PR is created by GitHub Actions: https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`
].join('\n');
const pr = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: process.env.PR_TITLE,
head: process.env.update_branch,
base: process.env.BASE_BRANCH,
body,
draft: true
});
core.setOutput('pull_request_number', String(pr.data.number));
- name: Comment on Pull Request
if: ${{ env.need_update_version == 'true' }}
uses: actions/github-script@v7
with:
script: |
const prNumber = Number('${{ steps.create_pr.outputs.pull_request_number }}');
if (!prNumber) {
console.log('No pull request was created, nothing to comment on.');
return;
}
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: '/azp run java - spring - tests'
});
157 changes: 157 additions & 0 deletions .github/workflows/update-spring-cloud-azure-support-file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Update Spring Cloud Azure Support File
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
base_branch:
description: 'Base branch for update branch and PR target. Defaults to trigger branch.'
required: false
type: string

env:
BASE_BRANCH: ${{ github.event.inputs.base_branch || github.ref_name }}
PR_TITLE: "Update Spring Boot and Spring Cloud versions for the Spring compatibility tests"

permissions:
contents: read
pull-requests: read
issues: read

Comment thread
rujche marked this conversation as resolved.
jobs:
check-open-pr:
name: Check Open Pull Request
runs-on: ubuntu-latest
outputs:
has_open_pr: ${{ steps.check.outputs.has_open_pr }}
steps:
- uses: actions/checkout@v4
- name: Check for Existing Open Pull Request
id: check
uses: actions/github-script@v7
with:
script: |
const prTitle = process.env.PR_TITLE;
const pullRequests = await github.paginate(github.rest.pulls.list, {
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
per_page: 100
});

const openPRs = pullRequests.filter(pr => pr.title === prTitle);
core.setOutput('has_open_pr', openPRs.length > 0 ? 'true' : 'false');

update:
name: Update Support File and Create PR
needs: check-open-pr
if: ${{ needs.check-open-pr.outputs.has_open_pr == 'false' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Branch Name with Timestamp
run: |
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
GITHUB_ACTION_URL="https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"

{
echo "BRANCH_NAME=update-spring-cloud-azure-support-file-${TIMESTAMP}"
echo "COMMIT_MESSAGE<<EOF"
echo "${PR_TITLE}."
echo "This commit is created by GitHub Action: ${GITHUB_ACTION_URL}"
echo "EOF"
echo "PULL_REQUEST_BODY<<EOF"
echo "${PR_TITLE}."
echo "This commit is created by GitHub Action: ${GITHUB_ACTION_URL}"
echo "EOF"
} >> "$GITHUB_ENV"
- name: Make Decision Based on Git Diff
run: |
git fetch origin "${{ env.BASE_BRANCH }}"
git checkout -B "${{ env.BRANCH_NAME }}" "origin/${{ env.BASE_BRANCH }}"
python ./sdk/spring/scripts/generate_spring_cloud_azure_support_file.py
if [[ -n "$(git status -s)" ]]; then
echo "NEED_UPDATE_FILE=true" >> "$GITHUB_ENV"
else
echo "No file changes, no commits."
fi
- name: Update Spring Cloud Azure Timeline
if: ${{ env.NEED_UPDATE_FILE == 'true' }}
run: |
TODAY=$(date +%Y-%m-%d)
TIMELINE_FILE=docs/spring/Spring-Cloud-Azure-Timeline.md
SUPPORT_FILE=sdk/spring/pipeline/spring-cloud-azure-supported-spring.json

OLD_4X=$(git show "HEAD:${SUPPORT_FILE}" | jq -Sc '[.[] | select(."spring-boot-version" | startswith("4."))] | sort_by([."spring-boot-version", ."spring-cloud-version", .supportStatus, .current])')
NEW_4X=$(jq -Sc '[.[] | select(."spring-boot-version" | startswith("4."))] | sort_by([."spring-boot-version", ."spring-cloud-version", .supportStatus, .current])' "${SUPPORT_FILE}")

if [[ "${OLD_4X}" == "${NEW_4X}" ]]; then
echo "No Spring Boot 4.x changes detected, skip timeline update."
exit 0
fi

SUPPORTED_LINES=$(jq -r '
.[]
| select(.supportStatus == "SUPPORTED")
| select(.["spring-boot-version"] | startswith("4."))
| " - spring-boot-dependencies:\(.["spring-boot-version"]) and spring-cloud-dependencies:\(.["spring-cloud-version"])."
' "${SUPPORT_FILE}")

if [[ -z "${SUPPORTED_LINES}" ]]; then
echo "No supported Spring Boot 4.x entries found, skip timeline update."
exit 0
fi

NEW_ENTRY=$(printf ' - **%s**: In "java - spring - compatibility - tests" pipeline, run unit tests:\n%s' "$TODAY" "$SUPPORTED_LINES")
awk -v entry="$NEW_ENTRY" '
{ print }
/^## Timeline$/ && !inserted { print entry; inserted=1 }
' "$TIMELINE_FILE" > "$TIMELINE_FILE.tmp"
mv "$TIMELINE_FILE.tmp" "$TIMELINE_FILE"
- name: Push Commit
if: ${{ env.NEED_UPDATE_FILE == 'true' }}
run: |
git config --global user.email github-actions@github.com
git config --global user.name github-actions
git add sdk/spring/pipeline/spring-cloud-azure-supported-spring.json
git add docs/spring/Spring-Cloud-Azure-Timeline.md
git commit -m "$COMMIT_MESSAGE"
git push origin "${{ env.BRANCH_NAME }}"
- name: Create Pull Request
id: create_pr
if: ${{ env.NEED_UPDATE_FILE == 'true' }}
uses: actions/github-script@v7
with:
script: |
const pr = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: process.env.PR_TITLE,
head: process.env.BRANCH_NAME,
base: process.env.BASE_BRANCH,
body: process.env.PULL_REQUEST_BODY
});
core.setOutput('pull_request_number', String(pr.data.number));
- name: Comment on Pull Request
if: ${{ env.NEED_UPDATE_FILE == 'true' }}
uses: actions/github-script@v7
with:
script: |
const prNumber = Number('${{ steps.create_pr.outputs.pull_request_number }}');
if (!prNumber) {
console.log('No pull request was created, nothing to comment on.');
return;
}

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: '/azp run java - spring - tests'
});
Loading
Loading