Skip to content
Open
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
10 changes: 5 additions & 5 deletions .github/workflows/TestTriggerExtensionRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:

jobs:
build:
name: Trigger Extension Release Pipeline
name: Test Trigger Extension Release Pipeline
runs-on: ubuntu-latest
steps:
- name: Harden Runner
Expand All @@ -26,7 +26,7 @@ jobs:
client-id: ${{ secrets.ADO_SP_ClientID }}
tenant-id: ${{ secrets.ADO_SP_TenantID }}
allow-no-subscriptions: true
- name: Trigger ADO Pipeline and Wait for Completion
- name: Test Trigger ADO Pipeline and Wait for Completion
uses: azure/cli@v2
env:
ado-org: ${{secrets.ADO_ORGANIZATION}}
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
exit 1
fi

# Wait 30 seconds before checking again
echo "Build still running... waiting 30 seconds"
sleep 30
# Wait 60 seconds before checking again
echo "Build still running... waiting 60 seconds"
sleep 60
done
61 changes: 59 additions & 2 deletions .github/workflows/TriggerExtensionRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
client-id: ${{ secrets.ADO_SP_ClientID }}
tenant-id: ${{ secrets.ADO_SP_TenantID }}
allow-no-subscriptions: true
- name: Azure CLI
- name: Trigger ADO Pipeline and Wait for Completion
uses: azure/cli@v2
env:
ado-org: ${{secrets.ADO_ORGANIZATION}}
Expand All @@ -35,4 +35,61 @@ jobs:
commit-id: ${{ github.sha }}
with:
inlineScript: |
az pipelines build queue --definition-id ${{ env.ado-pipeline-id }} --organization ${{ env.ado-org }} --project ${{ env.ado-project }} --variables commit_id=${{ env.commit-id }}
# 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
Copy link
Preview

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The infinite while loop lacks a timeout mechanism. Consider adding a maximum wait time or iteration limit to prevent the workflow from running indefinitely if the ADO pipeline becomes stuck or unresponsive.

Copilot uses AI. Check for mistakes.

BUILD_JSON=$(az pipelines build show \
--id $BUILD_ID \
--organization ${{ env.ado-org }} \
--project ${{ env.ado-project }} \
--output json)
Comment on lines +58 to +62
Copy link
Preview

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The Azure CLI command lacks error handling. If the API call fails (network issues, authentication problems, etc.), the script will continue with potentially invalid JSON, leading to unexpected behavior in subsequent jq operations.

Copilot uses AI. Check for mistakes.


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"

# 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 60 seconds before checking again
echo "Build still running... waiting 60 seconds"
sleep 60
done
141 changes: 0 additions & 141 deletions scripts/ci/find_extension_upgraded.py

This file was deleted.

Loading