diff --git a/.github/workflows/deploy-orchestrator.yml b/.github/workflows/deploy-orchestrator.yml index 97c7a6ca..27ac055c 100644 --- a/.github/workflows/deploy-orchestrator.yml +++ b/.github/workflows/deploy-orchestrator.yml @@ -102,10 +102,25 @@ jobs: TEST_SUITE: ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }} secrets: inherit - send-notification: - if: "!cancelled()" + cleanup-deployment: + if: "always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)" needs: [docker-build, deploy, e2e-test] + uses: ./.github/workflows/job-cleanup-deployment.yml + with: + runner_os: ${{ inputs.runner_os }} + trigger_type: ${{ inputs.trigger_type }} + cleanup_resources: ${{ inputs.cleanup_resources }} + existing_webapp_url: ${{ inputs.existing_webapp_url }} + RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }} + AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }} + AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }} + ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }} + IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }} + secrets: inherit + send-notification: + if: "!cancelled()" + needs: [docker-build, deploy, e2e-test, cleanup-deployment] uses: ./.github/workflows/job-send-notification.yml with: trigger_type: ${{ inputs.trigger_type }} @@ -120,21 +135,5 @@ jobs: QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }} TEST_SUCCESS: ${{ needs.e2e-test.outputs.TEST_SUCCESS }} TEST_REPORT_URL: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }} - secrets: inherit - - cleanup-deployment: - if: "always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)" - needs: [docker-build, deploy, e2e-test] - - uses: ./.github/workflows/job-cleanup-deployment.yml - with: - runner_os: ${{ inputs.runner_os }} - trigger_type: ${{ inputs.trigger_type }} - cleanup_resources: ${{ inputs.cleanup_resources }} - existing_webapp_url: ${{ inputs.existing_webapp_url }} - RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }} - AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }} - AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }} - ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }} - IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }} + cleanup_result: ${{ needs.cleanup-deployment.result }} secrets: inherit diff --git a/.github/workflows/job-deploy-linux.yml b/.github/workflows/job-deploy-linux.yml index 3829bf36..09adace3 100644 --- a/.github/workflows/job-deploy-linux.yml +++ b/.github/workflows/job-deploy-linux.yml @@ -241,7 +241,7 @@ jobs: # Set additional parameters azd env set AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}" - azd env set AZURE_ENV_AI_SERVICE_LOCATION="$INPUT_AZURE_ENV_OPENAI_LOCATION" + azd env set AZURE_ENV_OPENAI_LOCATION="$INPUT_AZURE_ENV_OPENAI_LOCATION" azd env set AZURE_LOCATION="$INPUT_AZURE_LOCATION" azd env set AZURE_RESOURCE_GROUP="$INPUT_RESOURCE_GROUP_NAME" azd env set AZURE_ENV_IMAGETAG="$INPUT_IMAGE_TAG" @@ -409,15 +409,19 @@ jobs: # Navigate to workspace root cd $GITHUB_WORKSPACE - # Run the data upload script (it will pull parameters from azd env and install its own requirements) - bash ./infra/scripts/data_scripts/run_upload_data_scripts.sh - - if [[ $? -eq 0 ]]; then - echo "✅ Data upload completed successfully" - else - echo "❌ Data upload failed" - exit 1 - fi + MAX_RETRIES=3 + RETRY_DELAY=30 + for attempt in $(seq 1 $MAX_RETRIES); do + echo "🔄 Attempt $attempt of $MAX_RETRIES..." + bash ./infra/scripts/data_scripts/run_upload_data_scripts.sh && break + if [[ $attempt -eq $MAX_RETRIES ]]; then + echo "❌ Data upload failed after $MAX_RETRIES attempts" + exit 1 + fi + echo "⚠️ Attempt $attempt failed. Retrying in ${RETRY_DELAY}s..." + sleep $RETRY_DELAY + done + echo "✅ Data upload completed successfully" - name: Run Agent Creation Scripts shell: bash run: | @@ -426,15 +430,19 @@ jobs: # Navigate to workspace root cd $GITHUB_WORKSPACE - # Run the agent creation script (it will pull parameters from azd env and install its own requirements) - bash ./infra/scripts/agent_scripts/run_create_agents_scripts.sh - - if [[ $? -eq 0 ]]; then - echo "✅ Agent creation completed successfully" - else - echo "❌ Agent creation failed" - exit 1 - fi + MAX_RETRIES=3 + RETRY_DELAY=30 + for attempt in $(seq 1 $MAX_RETRIES); do + echo "🔄 Attempt $attempt of $MAX_RETRIES..." + bash ./infra/scripts/agent_scripts/run_create_agents_scripts.sh && break + if [[ $attempt -eq $MAX_RETRIES ]]; then + echo "❌ Agent creation failed after $MAX_RETRIES attempts" + exit 1 + fi + echo "⚠️ Attempt $attempt failed. Retrying in ${RETRY_DELAY}s..." + sleep $RETRY_DELAY + done + echo "✅ Agent creation completed successfully" - name: Wait for Data Propagation shell: bash diff --git a/.github/workflows/job-deploy-windows.yml b/.github/workflows/job-deploy-windows.yml index 175ddeb1..6353275c 100644 --- a/.github/workflows/job-deploy-windows.yml +++ b/.github/workflows/job-deploy-windows.yml @@ -245,7 +245,7 @@ jobs: # Set additional parameters azd env set AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}" - azd env set AZURE_ENV_AI_SERVICE_LOCATION="$env:INPUT_AZURE_ENV_OPENAI_LOCATION" + azd env set AZURE_ENV_OPENAI_LOCATION="$env:INPUT_AZURE_ENV_OPENAI_LOCATION" azd env set AZURE_LOCATION="$env:INPUT_AZURE_LOCATION" azd env set AZURE_RESOURCE_GROUP="$env:INPUT_RESOURCE_GROUP_NAME" azd env set AZURE_ENV_IMAGETAG="$env:INPUT_IMAGE_TAG" diff --git a/.github/workflows/job-deploy.yml b/.github/workflows/job-deploy.yml index 98cf0a2d..22a04167 100644 --- a/.github/workflows/job-deploy.yml +++ b/.github/workflows/job-deploy.yml @@ -90,12 +90,12 @@ on: value: ${{ jobs.azure-setup.outputs.QUOTA_FAILED }} env: - GPT_MIN_CAPACITY: 150 + GPT_MIN_CAPACITY: 50 BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.head_ref || github.ref_name }} WAF_ENABLED: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.waf_enabled || false) || false }} EXP: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.EXP || false) || false }} CLEANUP_RESOURCES: ${{ inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources }} - # RUN_E2E_TESTS: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.run_e2e_tests || 'GoldenPath-Testing') || 'GoldenPath-Testing' }} + RUN_E2E_TESTS: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.run_e2e_tests || 'GoldenPath-Testing') || 'GoldenPath-Testing' }} BUILD_DOCKER_IMAGE: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.build_docker_image || false) || false }} jobs: @@ -121,7 +121,7 @@ jobs: INPUT_EXP: ${{ inputs.EXP }} INPUT_WAF_ENABLED: ${{ inputs.waf_enabled }} INPUT_CLEANUP_RESOURCES: ${{ inputs.cleanup_resources }} - # INPUT_RUN_E2E_TESTS: ${{ inputs.run_e2e_tests }} + INPUT_RUN_E2E_TESTS: ${{ inputs.run_e2e_tests }} INPUT_AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }} INPUT_AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }} INPUT_DOCKER_IMAGE_TAG: ${{ inputs.docker_image_tag }} @@ -176,16 +176,16 @@ jobs: echo "✅ cleanup_resources: '$INPUT_CLEANUP_RESOURCES' is valid" fi - # # Validate run_e2e_tests (specific allowed values) - # if [[ -n "$INPUT_RUN_E2E_TESTS" ]]; then - # ALLOWED_VALUES=("None" "GoldenPath-Testing" "Smoke-Testing") - # if [[ ! " ${ALLOWED_VALUES[@]} " =~ " ${INPUT_RUN_E2E_TESTS} " ]]; then - # echo "❌ ERROR: run_e2e_tests '$INPUT_RUN_E2E_TESTS' is invalid. Allowed values: ${ALLOWED_VALUES[*]}" - # VALIDATION_FAILED=true - # else - # echo "✅ run_e2e_tests: '$INPUT_RUN_E2E_TESTS' is valid" - # fi - # fi + # Validate run_e2e_tests (specific allowed values) + if [[ -n "$INPUT_RUN_E2E_TESTS" ]]; then + ALLOWED_VALUES=("None" "GoldenPath-Testing" "Smoke-Testing") + if [[ ! " ${ALLOWED_VALUES[@]} " =~ " ${INPUT_RUN_E2E_TESTS} " ]]; then + echo "❌ ERROR: run_e2e_tests '$INPUT_RUN_E2E_TESTS' is invalid. Allowed values: ${ALLOWED_VALUES[*]}" + VALIDATION_FAILED=true + else + echo "✅ run_e2e_tests: '$INPUT_RUN_E2E_TESTS' is valid" + fi + fi # Validate AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID (Azure Resource ID format) if [[ -n "$INPUT_AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID" ]]; then @@ -393,14 +393,14 @@ jobs: echo "Current branch: $BRANCH_NAME" if [[ "$BRANCH_NAME" == "main" ]]; then - IMAGE_TAG="latest" + IMAGE_TAG="latest_v2" elif [[ "$BRANCH_NAME" == "dev" ]]; then IMAGE_TAG="dev" elif [[ "$BRANCH_NAME" == "demo" ]]; then IMAGE_TAG="demo" else - IMAGE_TAG="latest" - echo "Using default for branch '$BRANCH_NAME' - image tag: latest" + IMAGE_TAG="latest_v2" + echo "Using default for branch '$BRANCH_NAME' - image tag: latest_v2" fi echo "Using existing Docker image tag: $IMAGE_TAG" fi diff --git a/.github/workflows/job-send-notification.yml b/.github/workflows/job-send-notification.yml index 477a7566..941c0056 100644 --- a/.github/workflows/job-send-notification.yml +++ b/.github/workflows/job-send-notification.yml @@ -61,9 +61,14 @@ on: required: false default: '' type: string + cleanup_result: + description: 'Cleanup job result (success, failure, skipped)' + required: false + default: 'skipped' + type: string env: - GPT_MIN_CAPACITY: 100 + GPT_MIN_CAPACITY: 50 BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.head_ref || github.ref_name }} WAF_ENABLED: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.waf_enabled || false) || false }} EXP: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.EXP || false) || false }} @@ -74,181 +79,48 @@ jobs: runs-on: ubuntu-latest continue-on-error: true env: - accelerator_name: "customer-chatbot-solution-accelerator" + accelerator_name: "BYOCC" steps: - - name: Validate Workflow Input Parameters + - name: Determine Test Suite Display Name + id: test_suite shell: bash env: - INPUT_TRIGGER_TYPE: ${{ inputs.trigger_type }} - INPUT_WAF_ENABLED: ${{ inputs.waf_enabled }} - INPUT_EXP: ${{ inputs.EXP }} - # INPUT_RUN_E2E_TESTS: ${{ inputs.run_e2e_tests }} - INPUT_EXISTING_WEBAPP_URL: ${{ inputs.existing_webapp_url }} - INPUT_DEPLOY_RESULT: ${{ inputs.deploy_result }} - # INPUT_E2E_TEST_RESULT: ${{ inputs.e2e_test_result }} - INPUT_CONTAINER_WEB_APPURL: ${{ inputs.CONTAINER_WEB_APPURL }} - INPUT_RESOURCE_GROUP_NAME: ${{ inputs.RESOURCE_GROUP_NAME }} - INPUT_QUOTA_FAILED: ${{ inputs.QUOTA_FAILED }} - INPUT_TEST_SUCCESS: ${{ inputs.TEST_SUCCESS }} - INPUT_TEST_REPORT_URL: ${{ inputs.TEST_REPORT_URL }} + RUN_E2E_TESTS: ${{ env.RUN_E2E_TESTS }} run: | - echo "🔍 Validating workflow input parameters..." - VALIDATION_FAILED=false - - # Validate trigger_type (required - alphanumeric with underscores) - if [[ -z "$INPUT_TRIGGER_TYPE" ]]; then - echo "❌ ERROR: trigger_type is required but was not provided" - VALIDATION_FAILED=true - elif [[ ! "$INPUT_TRIGGER_TYPE" =~ ^[a-zA-Z0-9_]+$ ]]; then - echo "❌ ERROR: trigger_type '$INPUT_TRIGGER_TYPE' is invalid. Must contain only alphanumeric characters and underscores" - VALIDATION_FAILED=true - else - echo "✅ trigger_type: '$INPUT_TRIGGER_TYPE' is valid" - fi - - # Validate waf_enabled (boolean) - if [[ "$INPUT_WAF_ENABLED" != "true" && "$INPUT_WAF_ENABLED" != "false" ]]; then - echo "❌ ERROR: waf_enabled must be 'true' or 'false', got: '$INPUT_WAF_ENABLED'" - VALIDATION_FAILED=true - else - echo "✅ waf_enabled: '$INPUT_WAF_ENABLED' is valid" - fi - - # Validate EXP (boolean) - if [[ "$INPUT_EXP" != "true" && "$INPUT_EXP" != "false" ]]; then - echo "❌ ERROR: EXP must be 'true' or 'false', got: '$INPUT_EXP'" - VALIDATION_FAILED=true - else - echo "✅ EXP: '$INPUT_EXP' is valid" - fi - - # # Validate run_e2e_tests (specific allowed values) - # if [[ -n "$INPUT_RUN_E2E_TESTS" ]]; then - # ALLOWED_VALUES=("None" "GoldenPath-Testing" "Smoke-Testing") - # if [[ ! " ${ALLOWED_VALUES[@]} " =~ " ${INPUT_RUN_E2E_TESTS} " ]]; then - # echo "❌ ERROR: run_e2e_tests '$INPUT_RUN_E2E_TESTS' is invalid. Allowed values: ${ALLOWED_VALUES[*]}" - # VALIDATION_FAILED=true - # else - # echo "✅ run_e2e_tests: '$INPUT_RUN_E2E_TESTS' is valid" - # fi - # fi - - # Validate existing_webapp_url (must start with https if provided) - if [[ -n "$INPUT_EXISTING_WEBAPP_URL" ]]; then - if [[ ! "$INPUT_EXISTING_WEBAPP_URL" =~ ^https:// ]]; then - echo "❌ ERROR: existing_webapp_url must start with 'https://', got: '$INPUT_EXISTING_WEBAPP_URL'" - VALIDATION_FAILED=true - else - echo "✅ existing_webapp_url: '$INPUT_EXISTING_WEBAPP_URL' is valid" - fi - fi - - # Validate deploy_result (required, must be specific values) - if [[ -z "$INPUT_DEPLOY_RESULT" ]]; then - echo "❌ ERROR: deploy_result is required but not provided" - VALIDATION_FAILED=true - else - ALLOWED_DEPLOY_RESULTS=("success" "failure" "skipped") - if [[ ! " ${ALLOWED_DEPLOY_RESULTS[@]} " =~ " ${INPUT_DEPLOY_RESULT} " ]]; then - echo "❌ ERROR: deploy_result '$INPUT_DEPLOY_RESULT' is invalid. Allowed values: ${ALLOWED_DEPLOY_RESULTS[*]}" - VALIDATION_FAILED=true - else - echo "✅ deploy_result: '$INPUT_DEPLOY_RESULT' is valid" - fi - fi - - # # Validate e2e_test_result (required, must be specific values) - # if [[ -z "$INPUT_E2E_TEST_RESULT" ]]; then - # echo "❌ ERROR: e2e_test_result is required but not provided" - # VALIDATION_FAILED=true - # else - # ALLOWED_TEST_RESULTS=("success" "failure" "skipped") - # if [[ ! " ${ALLOWED_TEST_RESULTS[@]} " =~ " ${INPUT_E2E_TEST_RESULT} " ]]; then - # echo "❌ ERROR: e2e_test_result '$INPUT_E2E_TEST_RESULT' is invalid. Allowed values: ${ALLOWED_TEST_RESULTS[*]}" - # VALIDATION_FAILED=true - # else - # echo "✅ e2e_test_result: '$INPUT_E2E_TEST_RESULT' is valid" - # fi - # fi - - # Validate CONTAINER_WEB_APPURL (must start with https if provided) - if [[ -n "$INPUT_CONTAINER_WEB_APPURL" ]]; then - if [[ ! "$INPUT_CONTAINER_WEB_APPURL" =~ ^https:// ]]; then - echo "❌ ERROR: CONTAINER_WEB_APPURL must start with 'https://', got: '$INPUT_CONTAINER_WEB_APPURL'" - VALIDATION_FAILED=true - else - echo "✅ CONTAINER_WEB_APPURL: '$INPUT_CONTAINER_WEB_APPURL' is valid" - fi - fi - - # Validate RESOURCE_GROUP_NAME (Azure resource group naming convention if provided) - if [[ -n "$INPUT_RESOURCE_GROUP_NAME" ]]; then - if [[ ! "$INPUT_RESOURCE_GROUP_NAME" =~ ^[a-zA-Z0-9._\(\)-]+$ ]] || [[ "$INPUT_RESOURCE_GROUP_NAME" =~ \.$ ]]; then - echo "❌ ERROR: RESOURCE_GROUP_NAME '$INPUT_RESOURCE_GROUP_NAME' is invalid. Must contain only alphanumerics, periods, underscores, hyphens, and parentheses. Cannot end with period." - VALIDATION_FAILED=true - elif [[ ${#INPUT_RESOURCE_GROUP_NAME} -gt 90 ]]; then - echo "❌ ERROR: RESOURCE_GROUP_NAME '$INPUT_RESOURCE_GROUP_NAME' exceeds 90 characters" - VALIDATION_FAILED=true - else - echo "✅ RESOURCE_GROUP_NAME: '$INPUT_RESOURCE_GROUP_NAME' is valid" - fi - fi - - # Validate QUOTA_FAILED (must be 'true' or 'false' or empty - defaults to 'false') - if [[ -n "$INPUT_QUOTA_FAILED" && "$INPUT_QUOTA_FAILED" != "true" && "$INPUT_QUOTA_FAILED" != "false" ]]; then - echo "❌ ERROR: QUOTA_FAILED must be 'true', 'false', or empty, got: '$INPUT_QUOTA_FAILED'" - VALIDATION_FAILED=true + if [ "$RUN_E2E_TESTS" = "GoldenPath-Testing" ]; then + TEST_SUITE_NAME="Golden Path Testing" + elif [ "$RUN_E2E_TESTS" = "Smoke-Testing" ]; then + TEST_SUITE_NAME="Smoke Testing" + elif [ "$RUN_E2E_TESTS" = "None" ]; then + TEST_SUITE_NAME="None" else - echo "✅ QUOTA_FAILED: '${INPUT_QUOTA_FAILED:-false}' is valid" + TEST_SUITE_NAME="$RUN_E2E_TESTS" fi - - # Validate TEST_SUCCESS (must be 'true' or 'false' or empty) - if [[ -n "$INPUT_TEST_SUCCESS" ]]; then - if [[ "$INPUT_TEST_SUCCESS" != "true" && "$INPUT_TEST_SUCCESS" != "false" ]]; then - echo "❌ ERROR: TEST_SUCCESS must be 'true', 'false', or empty, got: '$INPUT_TEST_SUCCESS'" - VALIDATION_FAILED=true - else - echo "✅ TEST_SUCCESS: '$INPUT_TEST_SUCCESS' is valid" - fi - fi - - # Validate TEST_REPORT_URL (must start with https if provided) - if [[ -n "$INPUT_TEST_REPORT_URL" ]]; then - if [[ ! "$INPUT_TEST_REPORT_URL" =~ ^https:// ]]; then - echo "❌ ERROR: TEST_REPORT_URL must start with 'https://', got: '$INPUT_TEST_REPORT_URL'" - VALIDATION_FAILED=true - else - echo "✅ TEST_REPORT_URL: '$INPUT_TEST_REPORT_URL' is valid" - fi - fi - - # Fail workflow if any validation failed - if [[ "$VALIDATION_FAILED" == "true" ]]; then - echo "" - echo "❌ Parameter validation failed. Please correct the errors above and try again." - exit 1 - fi - - echo "" - echo "✅ All input parameters validated successfully!" - - # - name: Determine Test Suite Display Name - # id: test_suite - # shell: bash - # env: - # RUN_E2E_TESTS: ${{ env.RUN_E2E_TESTS }} - # run: | - # if [ "$RUN_E2E_TESTS" = "GoldenPath-Testing" ]; then - # TEST_SUITE_NAME="Golden Path Testing" - # elif [ "$RUN_E2E_TESTS" = "Smoke-Testing" ]; then - # TEST_SUITE_NAME="Smoke Testing" - # elif [ "$RUN_E2E_TESTS" = "None" ]; then - # TEST_SUITE_NAME="None" - # else - # TEST_SUITE_NAME="$RUN_E2E_TESTS" - # fi - # echo "TEST_SUITE_NAME=$TEST_SUITE_NAME" >> $GITHUB_OUTPUT - # echo "Test Suite: $TEST_SUITE_NAME" + echo "TEST_SUITE_NAME=$TEST_SUITE_NAME" >> $GITHUB_OUTPUT + echo "Test Suite: $TEST_SUITE_NAME" + + - name: Determine Cleanup Status + id: cleanup + shell: bash + env: + CLEANUP_RESULT: ${{ inputs.cleanup_result }} + run: | + case "$CLEANUP_RESULT" in + success) echo "CLEANUP_STATUS=✅ SUCCESS" >> $GITHUB_OUTPUT ;; + failure) echo "CLEANUP_STATUS=❌ FAILED (Needs Manual Cleanup)" >> $GITHUB_OUTPUT ;; + *) echo "CLEANUP_STATUS=⏭️ SKIPPED (Needs Manual Cleanup)" >> $GITHUB_OUTPUT ;; + esac + + - name: Determine Configuration Label + id: config + shell: bash + env: + WAF_ENABLED: ${{ env.WAF_ENABLED }} + EXP: ${{ env.EXP }} + run: | + WAF_LABEL=$( [ "$WAF_ENABLED" = "true" ] && echo "WAF" || echo "Non-WAF" ) + EXP_LABEL=$( [ "$EXP" = "true" ] && echo "EXP" || echo "Non-EXP" ) + echo "CONFIG_LABEL=${WAF_LABEL} + ${EXP_LABEL}" >> $GITHUB_OUTPUT - name: Send Quota Failure Notification if: inputs.deploy_result == 'failure' && inputs.QUOTA_FAILED == 'true' @@ -258,12 +130,14 @@ jobs: GITHUB_RUN_ID: ${{ github.run_id }} ACCELERATOR_NAME: ${{ env.accelerator_name }} LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }} + CLEANUP_STATUS: ${{ steps.cleanup.outputs.CLEANUP_STATUS }} + CONFIG_LABEL: ${{ steps.config.outputs.CONFIG_LABEL }} run: | - RUN_URL="https://github.com/${GITHUB_REPOSITORY }/actions/runs/${GITHUB_RUN_ID}" + RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the ${ACCELERATOR_NAME} deployment has failed due to insufficient quota in the requested regions.

Issue Details:
• Quota check failed for GPT model
• Required GPT Capacity: ${{ env.GPT_MIN_CAPACITY }}
• Checked Regions: ${{ vars.AZURE_REGIONS }}

Run URL: ${RUN_URL}

Please resolve the quota issue and retry the deployment.

Best regards,
Your Automation Team

", - "subject": "${ACCELERATOR_NAME} Pipeline - Failed (Insufficient Quota)" + "body": "

Dear Team,

We would like to inform you that the ${ACCELERATOR_NAME} deployment has failed due to insufficient quota.

Status Summary:
StageStatus
Deployment❌ FAILED (Insufficient Quota)
E2E Tests⏭️ SKIPPED
Cleanup${CLEANUP_STATUS}

Configuration: ${CONFIG_LABEL}

Run URL: ${RUN_URL}

Please resolve the quota issue and retry the deployment.

Best regards,
Your Automation Team

", + "subject": "❌[CI/CD-Automation] [${ACCELERATOR_NAME}] Insufficient Quota" } EOF ) @@ -279,16 +153,16 @@ jobs: INPUT_RESOURCE_GROUP_NAME: ${{ inputs.RESOURCE_GROUP_NAME }} ACCELERATOR_NAME: ${{ env.accelerator_name }} LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }} - WAF_ENABLED: ${{ env.WAF_ENABLED }} - EXP: ${{ env.EXP }} + CONFIG_LABEL: ${{ steps.config.outputs.CONFIG_LABEL }} + CLEANUP_STATUS: ${{ steps.cleanup.outputs.CLEANUP_STATUS }} run: | RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" RESOURCE_GROUP="$INPUT_RESOURCE_GROUP_NAME" EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the ${ACCELERATOR_NAME} deployment process has encountered an issue and has failed to complete successfully.

Deployment Details:
• Resource Group: ${RESOURCE_GROUP}
• WAF Enabled: ${WAF_ENABLED}
• EXP Enabled: ${EXP}

Run URL: ${RUN_URL}

Please investigate the deployment failure at your earliest convenience.

Best regards,
Your Automation Team

", - "subject": "${ACCELERATOR_NAME} Pipeline - Failed" + "body": "

Dear Team,

We would like to inform you that the ${ACCELERATOR_NAME} deployment has failed.

Status Summary:
StageStatus
Deployment❌ FAILED (Deployment Issue)
E2E Tests⏭️ SKIPPED
Cleanup${CLEANUP_STATUS}

Deployment Details:
• Resource Group: ${RESOURCE_GROUP}

Configuration: ${CONFIG_LABEL}

Run URL: ${RUN_URL}

Please investigate the deployment failure at your earliest convenience.

Best regards,
Your Automation Team

", + "subject": "❌[CI/CD-Automation] [${ACCELERATOR_NAME}] Deployment-Failed" } EOF ) @@ -305,34 +179,35 @@ jobs: INPUT_EXISTING_WEBAPP_URL: ${{ inputs.existing_webapp_url }} INPUT_RESOURCE_GROUP_NAME: ${{ inputs.RESOURCE_GROUP_NAME }} INPUT_TEST_REPORT_URL: ${{ inputs.TEST_REPORT_URL }} - # INPUT_E2E_TEST_RESULT: ${{ inputs.e2e_test_result }} + INPUT_E2E_TEST_RESULT: ${{ inputs.e2e_test_result }} ACCELERATOR_NAME: ${{ env.accelerator_name }} LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }} GITHUB_REPOSITORY: ${{ github.repository }} GITHUB_RUN_ID: ${{ github.run_id }} - EXP: ${{ env.EXP }} - WAF_ENABLED: ${{ env.WAF_ENABLED }} + CONFIG_LABEL: ${{ steps.config.outputs.CONFIG_LABEL }} + CLEANUP_STATUS: ${{ steps.cleanup.outputs.CLEANUP_STATUS }} + RUN_E2E_TESTS: ${{ env.RUN_E2E_TESTS }} + TEST_SUITE_NAME: ${{ steps.test_suite.outputs.TEST_SUITE_NAME }} run: | RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" WEBAPP_URL="${INPUT_CONTAINER_WEB_APPURL:-$INPUT_EXISTING_WEBAPP_URL}" RESOURCE_GROUP="$INPUT_RESOURCE_GROUP_NAME" TEST_REPORT_URL="$INPUT_TEST_REPORT_URL" - # TEST_SUITE_NAME="${{ steps.test_suite.outputs.TEST_SUITE_NAME }}" if [ "$INPUT_E2E_TEST_RESULT" = "skipped" ]; then EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the ${ACCELERATOR_NAME} deployment has completed successfully.

Deployment Details:
• Resource Group: ${RESOURCE_GROUP}
• Web App URL: ${WEBAPP_URL}
• E2E Tests: Skipped (as configured)

Configuration:
• WAF Enabled: ${WAF_ENABLED}
• EXP Enabled: ${EXP}

Run URL: ${RUN_URL}

Best regards,
Your Automation Team

", - "subject": "${ACCELERATOR_NAME} Pipeline - Deployment Success" + "body": "

Dear Team,

We would like to inform you that the ${ACCELERATOR_NAME} deployment has completed successfully.

Status Summary:
StageStatus
Deployment✅ SUCCESS
E2E Tests⏭️ SKIPPED
Cleanup${CLEANUP_STATUS}

Deployment Details:
• Resource Group: ${RESOURCE_GROUP}
• Web App URL: ${WEBAPP_URL}

Configuration: ${CONFIG_LABEL}

Run URL: ${RUN_URL}

Best regards,
Your Automation Team

", + "subject": "✅[CI/CD-Automation] [${ACCELERATOR_NAME}] Success" } EOF ) else EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the ${ACCELERATOR_NAME} deployment and testing process has completed successfully.

Deployment Details:
• Resource Group: ${RESOURCE_GROUP}
• Web App URL: ${WEBAPP_URL}
• E2E Tests: Passed ✅
• Test Suite: ${TEST_SUITE_NAME}
• Test Report: View Report

Configuration:
• WAF Enabled: ${WAF_ENABLED}
• EXP Enabled: ${EXP}

Run URL: ${RUN_URL}

Best regards,
Your Automation Team

", - "subject": "${ACCELERATOR_NAME} Pipeline - Test Automation - Success" + "body": "

Dear Team,

We would like to inform you that the ${ACCELERATOR_NAME} deployment and test automation has completed successfully.

Status Summary:
StageStatus
Deployment✅ SUCCESS
E2E Tests✅ SUCCESS
Cleanup${CLEANUP_STATUS}

Deployment Details:
• Resource Group: ${RESOURCE_GROUP}
• Web App URL: ${WEBAPP_URL}
• Test Suite: ${TEST_SUITE_NAME}
• Test Report: View Report

Configuration: ${CONFIG_LABEL}

Run URL: ${RUN_URL}

Best regards,
Your Automation Team

", + "subject": "✅[CI/CD-Automation] [${ACCELERATOR_NAME}] Success" } EOF ) @@ -343,9 +218,7 @@ jobs: -d "$EMAIL_BODY" || echo "Failed to send success notification" - name: Send Test Failure Notification - if: inputs.deploy_result == 'success' - - # if: inputs.deploy_result == 'success' && inputs.e2e_test_result != 'skipped' && inputs.TEST_SUCCESS != 'true' + if: inputs.deploy_result == 'success' && inputs.e2e_test_result != 'skipped' && inputs.TEST_SUCCESS != 'true' shell: bash env: GITHUB_REPOSITORY: ${{ github.repository }} @@ -355,18 +228,21 @@ jobs: INPUT_RESOURCE_GROUP_NAME: ${{ inputs.RESOURCE_GROUP_NAME }} ACCELERATOR_NAME: ${{ env.accelerator_name }} LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }} - # INPUT_TEST_REPORT_URL: ${{ inputs.TEST_REPORT_URL }} + CLEANUP_STATUS: ${{ steps.cleanup.outputs.CLEANUP_STATUS }} + CONFIG_LABEL: ${{ steps.config.outputs.CONFIG_LABEL }} + RUN_E2E_TESTS: ${{ env.RUN_E2E_TESTS }} + TEST_SUITE_NAME: ${{ steps.test_suite.outputs.TEST_SUITE_NAME }} + INPUT_TEST_REPORT_URL: ${{ inputs.TEST_REPORT_URL }} run: | RUN_URL="https://github.com/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}" TEST_REPORT_URL="$INPUT_TEST_REPORT_URL" WEBAPP_URL="${INPUT_CONTAINER_WEB_APPURL:-$INPUT_EXISTING_WEBAPP_URL}" RESOURCE_GROUP="$INPUT_RESOURCE_GROUP_NAME" - # TEST_SUITE_NAME="${{ steps.test_suite.outputs.TEST_SUITE_NAME }}" EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that ${ACCELERATOR_NAME} accelerator test automation process has encountered issues and failed to complete successfully.

Deployment Details:
• Resource Group: ${RESOURCE_GROUP}
• Web App URL: ${WEBAPP_URL}
• Deployment Status: ✅ Success
• E2E Tests: ❌ Failed
• Test Suite: ${TEST_SUITE_NAME}

Test Details:
• Test Report: View Report

Run URL: ${RUN_URL}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

", - "subject": "${ACCELERATOR_NAME} Pipeline - Test Automation - Failed" + "body": "

Dear Team,

We would like to inform you that ${ACCELERATOR_NAME} test automation has failed.

Status Summary:
StageStatus
Deployment✅ SUCCESS
E2E Tests❌ FAILED
Cleanup${CLEANUP_STATUS}

Deployment Details:
• Resource Group: ${RESOURCE_GROUP}
• Web App URL: ${WEBAPP_URL}
• Test Suite: ${TEST_SUITE_NAME}
• Test Report: View Report

Configuration: ${CONFIG_LABEL}

Run URL: ${RUN_URL}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

", + "subject": "❌[CI/CD-Automation] [${ACCELERATOR_NAME}] E2E Test-Failed" } EOF ) @@ -376,9 +252,7 @@ jobs: -d "$EMAIL_BODY" || echo "Failed to send test failure notification" - name: Send Existing URL Success Notification - if: inputs.deploy_result == 'skipped' && inputs.existing_webapp_url != '' - # if: inputs.deploy_result == 'skipped' && inputs.existing_webapp_url != '' && inputs.e2e_test_result == 'success' && (inputs.TEST_SUCCESS == 'true' || inputs.TEST_SUCCESS == '') - + if: inputs.deploy_result == 'skipped' && inputs.existing_webapp_url != '' && inputs.e2e_test_result == 'success' && (inputs.TEST_SUCCESS == 'true' || inputs.TEST_SUCCESS == '') shell: bash env: GITHUB_REPOSITORY: ${{ github.repository }} @@ -387,16 +261,18 @@ jobs: INPUT_TEST_REPORT_URL: ${{ inputs.TEST_REPORT_URL }} ACCELERATOR_NAME: ${{ env.accelerator_name }} LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }} + CLEANUP_STATUS: ${{ steps.cleanup.outputs.CLEANUP_STATUS }} + RUN_E2E_TESTS: ${{ env.RUN_E2E_TESTS }} + TEST_SUITE_NAME: ${{ steps.test_suite.outputs.TEST_SUITE_NAME }} run: | RUN_URL="https://github.com/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}" EXISTING_URL="$INPUT_EXISTING_WEBAPP_URL" TEST_REPORT_URL="$INPUT_TEST_REPORT_URL" - # TEST_SUITE_NAME="${{ steps.test_suite.outputs.TEST_SUITE_NAME }}" EMAIL_BODY=$(cat <Dear Team,

The ${ACCELERATOR_NAME} pipeline executed against the specified Target URL and testing process has completed successfully.

Test Results:
• Status: ✅ Passed
• Test Suite: ${TEST_SUITE_NAME}
${TEST_REPORT_URL:+• Test Report: View Report}
• Target URL: ${EXISTING_URL}

Deployment: Skipped

Run URL: ${RUN_URL}

Best regards,
Your Automation Team

", - "subject": "${ACCELERATOR_NAME} Pipeline - Test Automation Passed " + "body": "

Dear Team,

The ${ACCELERATOR_NAME} pipeline executed against the specified Target URL and test automation has completed successfully.

Status Summary:
StageStatus
Deployment⏭️ SKIPPED (Tests executed on Pre-deployed RG)
E2E Tests✅ SUCCESS
Cleanup${CLEANUP_STATUS}

Test Results:
• Test Suite: ${TEST_SUITE_NAME}
${TEST_REPORT_URL:+• Test Report: View Report}
• Target URL: ${EXISTING_URL}

Run URL: ${RUN_URL}

Best regards,
Your Automation Team

", + "subject": "✅[CI/CD-Automation] [${ACCELERATOR_NAME}] Success" } EOF ) @@ -415,16 +291,18 @@ jobs: INPUT_TEST_REPORT_URL: ${{ inputs.TEST_REPORT_URL }} ACCELERATOR_NAME: ${{ env.accelerator_name }} LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }} + CLEANUP_STATUS: ${{ steps.cleanup.outputs.CLEANUP_STATUS }} + RUN_E2E_TESTS: ${{ env.RUN_E2E_TESTS }} + TEST_SUITE_NAME: ${{ steps.test_suite.outputs.TEST_SUITE_NAME }} run: | RUN_URL="https://github.com/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}" EXISTING_URL="$INPUT_EXISTING_WEBAPP_URL" TEST_REPORT_URL="$INPUT_TEST_REPORT_URL" - TEST_SUITE_NAME="${{ steps.test_suite.outputs.TEST_SUITE_NAME }}" EMAIL_BODY=$(cat <Dear Team,

The ${ACCELERATOR_NAME} pipeline executed against the specified Target URL and the test automation has encountered issues and failed to complete successfully.

Failure Details:
• Target URL: ${EXISTING_URL}
${TEST_REPORT_URL:+• Test Report: View Report}
• Test Suite: ${TEST_SUITE_NAME}
• Deployment: Skipped

Run URL: ${RUN_URL}

Best regards,
Your Automation Team

", - "subject": "${ACCELERATOR_NAME} Pipeline - Test Automation Failed " + "body": "

Dear Team,

The ${ACCELERATOR_NAME} pipeline executed against the specified Target URL and test automation has failed.

Status Summary:
StageStatus
Deployment⏭️ SKIPPED (Tests executed on Pre-deployed RG)
E2E Tests❌ FAILED
Cleanup${CLEANUP_STATUS}

Failure Details:
• Target URL: ${EXISTING_URL}
${TEST_REPORT_URL:+• Test Report: View Report}
• Test Suite: ${TEST_SUITE_NAME}

Run URL: ${RUN_URL}

Best regards,
Your Automation Team

", + "subject": "❌[CI/CD-Automation] [${ACCELERATOR_NAME}] E2E Test-Failed" } EOF ) diff --git a/documents/DeploymentGuide.md b/documents/DeploymentGuide.md index 790e4bcb..b5446e1d 100644 --- a/documents/DeploymentGuide.md +++ b/documents/DeploymentGuide.md @@ -16,7 +16,7 @@ Ensure you have access to an [Azure subscription](https://azure.microsoft.com/fr |------------------------------|-----------|-------------| | **Contributor** | Subscription level | Create and manage Azure resources | | **User Access Administrator** | Subscription level | Manage user access and role assignments | -| **Role Based Access Control** | Subscription/Resource Group level | Configure RBAC permissions | +| **Role Based Access Control Admin** | Subscription/Resource Group level | Configure RBAC permissions | | **App Registration Creation** | Azure Active Directory | Create and configure authentication | **🔍 How to Check Your Permissions:**