From 112ca42df135a9e532a692a1f6c9fd545223f2c6 Mon Sep 17 00:00:00 2001 From: ZelinWang Date: Wed, 10 Sep 2025 12:39:53 +0800 Subject: [PATCH 1/3] Add workflow to trigger Test Extension Release Pipeline on main branch push --- .../workflows/TestTriggerExtensionRelease.yml | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/TestTriggerExtensionRelease.yml diff --git a/.github/workflows/TestTriggerExtensionRelease.yml b/.github/workflows/TestTriggerExtensionRelease.yml new file mode 100644 index 00000000000..1a34a6e42b7 --- /dev/null +++ b/.github/workflows/TestTriggerExtensionRelease.yml @@ -0,0 +1,98 @@ +name: Trigger ADO OneBranch Extension Release Pipeline + +# Run this workflow every time a commit gets pushed to main +# This triggers the ADO OneBranch Extension Release Pipeline +on: + push: + branches: + - main + +permissions: + contents: read + id-token: write + +jobs: + build: + name: Trigger Extension Release Pipeline + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + with: + egress-policy: audit + - name: Azure login + uses: azure/login@v2 + with: + client-id: ${{ secrets.ADO_SP_ClientID }} + tenant-id: ${{ secrets.ADO_SP_TenantID }} + allow-no-subscriptions: true + - name: Trigger ADO Pipeline and Wait for Completion + uses: azure/cli@v2 + env: + ado-org: ${{secrets.ADO_ORGANIZATION}} + ado-project: ${{secrets.ADO_PROJECT}} + ado-pipeline-id: ${{secrets.ADO_PIPELINE_ID}} + commit-id: ${{ github.sha }} + with: + inlineScript: | + # Trigger the pipeline and capture the build ID + echo "Triggering ADO pipeline..." + BUILD_RESULT=$(az pipelines build queue \ + --definition-id ${{ env.ado-pipeline-id }} \ + --organization ${{ env.ado-org }} \ + --project ${{ env.ado-project }} \ + --variables commit_id=${{ env.commit-id }} \ + --output json) + + BUILD_ID=$(echo $BUILD_RESULT | jq -r '.id') + echo "Pipeline triggered with Build ID: $BUILD_ID" + + if [ "$BUILD_ID" = "null" ] || [ -z "$BUILD_ID" ]; then + echo "Failed to get build ID from pipeline trigger" + exit 1 + fi + + # Wait for the build to complete + echo "Waiting for build $BUILD_ID to complete..." + while true; do + BUILD_STATUS=$(az pipelines build show \ + --id $BUILD_ID \ + --organization ${{ env.ado-org }} \ + --project ${{ env.ado-project }} \ + --output json | jq -r '.status') + + BUILD_RESULT_STATUS=$(az pipelines build show \ + --id $BUILD_ID \ + --organization ${{ env.ado-org }} \ + --project ${{ env.ado-project }} \ + --output json | jq -r '.result // "none"') + + echo "Current status: $BUILD_STATUS, Result: $BUILD_RESULT_STATUS" + + # Check if build is completed + if [ "$BUILD_STATUS" = "completed" ]; then + echo "Build completed with result: $BUILD_RESULT_STATUS" + + # Check if the build was successful + if [ "$BUILD_RESULT_STATUS" = "succeeded" ]; then + echo "✅ ADO pipeline build succeeded!" + exit 0 + elif [ "$BUILD_RESULT_STATUS" = "partiallySucceeded" ]; then + echo "⚠️ ADO pipeline build partially succeeded" + exit 1 + else + echo "❌ ADO pipeline build failed with result: $BUILD_RESULT_STATUS" + exit 1 + fi + fi + + # Check for other terminal states + if [ "$BUILD_STATUS" = "cancelling" ] || [ "$BUILD_STATUS" = "cancelled" ]; then + echo "❌ ADO pipeline build was cancelled" + exit 1 + fi + + # Wait 30 seconds before checking again + echo "Build still running... waiting 30 seconds" + sleep 30 + done From 8bb8bad878a72d08e55b00af6a1499e01d02c555 Mon Sep 17 00:00:00 2001 From: ZelinWang Date: Fri, 12 Sep 2025 15:14:15 +0800 Subject: [PATCH 2/3] Add a test pipeline to perform a dry run release of new external extension wheel packages to the unified AME storage account. --- .github/workflows/TestTriggerExtensionRelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestTriggerExtensionRelease.yml b/.github/workflows/TestTriggerExtensionRelease.yml index 1a34a6e42b7..e3648aa212a 100644 --- a/.github/workflows/TestTriggerExtensionRelease.yml +++ b/.github/workflows/TestTriggerExtensionRelease.yml @@ -31,7 +31,7 @@ jobs: env: ado-org: ${{secrets.ADO_ORGANIZATION}} ado-project: ${{secrets.ADO_PROJECT}} - ado-pipeline-id: ${{secrets.ADO_PIPELINE_ID}} + ado-pipeline-id: 396380 commit-id: ${{ github.sha }} with: inlineScript: | From 5c81c327dcb1b3a2f2eea345145ea89cdb68c37f Mon Sep 17 00:00:00 2001 From: ZelinWang Date: Mon, 15 Sep 2025 17:09:21 +0800 Subject: [PATCH 3/3] Update .github/workflows/TestTriggerExtensionRelease.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/TestTriggerExtensionRelease.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/TestTriggerExtensionRelease.yml b/.github/workflows/TestTriggerExtensionRelease.yml index e3648aa212a..d5cd7c7f42b 100644 --- a/.github/workflows/TestTriggerExtensionRelease.yml +++ b/.github/workflows/TestTriggerExtensionRelease.yml @@ -55,17 +55,14 @@ jobs: # Wait for the build to complete echo "Waiting for build $BUILD_ID to complete..." while true; do - BUILD_STATUS=$(az pipelines build show \ + BUILD_JSON=$(az pipelines build show \ --id $BUILD_ID \ --organization ${{ env.ado-org }} \ --project ${{ env.ado-project }} \ - --output json | jq -r '.status') + --output json) - BUILD_RESULT_STATUS=$(az pipelines build show \ - --id $BUILD_ID \ - --organization ${{ env.ado-org }} \ - --project ${{ env.ado-project }} \ - --output json | jq -r '.result // "none"') + BUILD_STATUS=$(echo "$BUILD_JSON" | jq -r '.status') + BUILD_RESULT_STATUS=$(echo "$BUILD_JSON" | jq -r '.result // "none"') echo "Current status: $BUILD_STATUS, Result: $BUILD_RESULT_STATUS"