Skip to content

Commit eac52db

Browse files
Merge remote-tracking branch 'origin/dev-v4' into dependabotchanges
2 parents 5238268 + ccd3359 commit eac52db

288 files changed

Lines changed: 9018 additions & 15773 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.azdo/pipelines/azure-dev.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
# Run when commits are pushed to mainline branch (main or master)
22
# Set this to the mainline branch you are using
33
trigger:
4-
- main
4+
branches:
5+
include:
6+
- main
7+
paths:
8+
include:
9+
- src/*
10+
- infra/*
11+
- azure.yaml
12+
- azure_custom.yaml
13+
- .azdo/pipelines/azure-dev.yml
14+
exclude:
15+
- '*.md'
16+
- docs/*
17+
- data/*
518

619
# Azure Pipelines workflow to deploy to Azure using azd
720
# To configure required secrets and service connection for connecting to Azure, simply run `azd pipeline config --provider azdo`

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ omit =
1111
*/env/*
1212
*/.pytest_cache/*
1313
*/node_modules/*
14+
src/backend/v4/api/router.py
1415

1516
[paths]
1617
source =

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ updates:
3232
- "*"
3333

3434
- package-ecosystem: "pip"
35-
directory: "/src/frontend"
35+
directory: "/src/App"
3636
schedule:
3737
interval: "monthly"
3838
commit-message:
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: AZD Template Validation
2+
on:
3+
schedule:
4+
- cron: '30 1 * * 4' # Every Thursday at 7:00 AM IST (1:30 AM UTC)
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
pull-requests: write
11+
12+
jobs:
13+
template_validation:
14+
runs-on: ubuntu-latest
15+
name: azd template validation
16+
environment: production
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set timestamp
21+
run: echo "HHMM=$(date -u +'%H%M')" >> $GITHUB_ENV
22+
23+
- uses: microsoft/template-validation-action@v0.4.3
24+
with:
25+
validateAzd: ${{ vars.TEMPLATE_VALIDATE_AZD }}
26+
validateTests: ${{ vars.TEMPLATE_VALIDATE_TESTS }}
27+
useDevContainer: ${{ vars.TEMPLATE_USE_DEV_CONTAINER }}
28+
id: validation
29+
env:
30+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
31+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
32+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
33+
AZURE_ENV_NAME: azd-${{ vars.AZURE_ENV_NAME }}-${{ env.HHMM }}
34+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
35+
AZURE_ENV_OPENAI_LOCATION : ${{ vars.AZURE_AI_DEPLOYMENT_LOCATION }}
36+
AZURE_ENV_MODEL_CAPACITY: 1
37+
AZURE_ENV_MODEL_4_1_CAPACITY: 1 # keep low to avoid potential quota issues
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: print result
41+
run: cat ${{ steps.validation.outputs.resultFile }}

.github/workflows/azure-dev.yml

Lines changed: 48 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,59 @@
1-
name: Azure Template Validation
1+
name: Azure Dev Deploy
2+
23
on:
34
workflow_dispatch:
45

56
permissions:
67
contents: read
78
id-token: write
8-
pull-requests: write
99

1010
jobs:
11-
template_validation_job:
11+
deploy:
1212
runs-on: ubuntu-latest
1313
environment: production
14-
name: template validation
14+
env:
15+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
16+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
17+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
18+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
19+
AZURE_ENV_OPENAI_LOCATION : ${{ vars.AZURE_AI_DEPLOYMENT_LOCATION }}
20+
AZURE_ENV_MODEL_CAPACITY: 1
21+
AZURE_ENV_MODEL_4_1_CAPACITY: 1
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
1524
steps:
16-
# Step 1: Checkout the code from your repository
17-
- name: Checkout code
18-
uses: actions/checkout@v6
19-
# Step 2: Validate the Azure template using microsoft/template-validation-action
20-
- name: Validate Azure Template
21-
uses: microsoft/template-validation-action@bae4895d0a8abd4f0d5aad68ae8647b3027f4c91
22-
with:
23-
validateAzd: true
24-
useDevContainer: false
25-
id: validation
26-
env:
27-
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
28-
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
29-
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
30-
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
31-
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}
32-
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }}
33-
AZURE_ENV_OPENAI_LOCATION : ${{ secrets.AZURE_AI_DEPLOYMENT_LOCATION }}
34-
AZURE_ENV_MODEL_CAPACITY: 1
35-
AZURE_ENV_MODEL_4_1_CAPACITY: 1
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
38-
39-
# Step 3: Print the result of the validation
40-
- name: print result
41-
run: cat ${{ steps.validation.outputs.resultFile }}
25+
- name: Checkout Code
26+
uses: actions/checkout@v4
27+
28+
- name: Set timestamp and env name
29+
run: |
30+
HHMM=$(date -u +'%H%M')
31+
echo "AZURE_ENV_NAME=azd-${{ vars.AZURE_ENV_NAME }}-${HHMM}" >> $GITHUB_ENV
32+
33+
- name: Install azd
34+
uses: Azure/setup-azd@v2
35+
36+
- name: Login to Azure
37+
uses: azure/login@v2
38+
with:
39+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
40+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
41+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
42+
43+
- name: Login to AZD
44+
shell: bash
45+
run: |
46+
azd auth login \
47+
--client-id "$AZURE_CLIENT_ID" \
48+
--federated-credential-provider "github" \
49+
--tenant-id "$AZURE_TENANT_ID"
50+
51+
- name: Provision and Deploy
52+
shell: bash
53+
run: |
54+
if ! azd env select "$AZURE_ENV_NAME"; then
55+
azd env new "$AZURE_ENV_NAME" --subscription "$AZURE_SUBSCRIPTION_ID" --location "$AZURE_LOCATION" --no-prompt
56+
fi
57+
azd config set defaults.subscription "$AZURE_SUBSCRIPTION_ID"
58+
azd env set AZURE_ENV_OPENAI_LOCATION="$AZURE_ENV_OPENAI_LOCATION"
59+
azd up --no-prompt

.github/workflows/deploy-orchestrator.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: Deployment orchestrator
22

3-
permissions:
4-
contents: read
5-
actions: read
6-
73
on:
84
workflow_call:
95
inputs:
@@ -108,9 +104,25 @@ jobs:
108104
TEST_SUITE: ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
109105
secrets: inherit
110106

107+
cleanup-deployment:
108+
if: "!cancelled() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
109+
needs: [docker-build, deploy, e2e-test]
110+
uses: ./.github/workflows/job-cleanup-deployment.yml
111+
with:
112+
runner_os: ${{ inputs.runner_os }}
113+
trigger_type: ${{ inputs.trigger_type }}
114+
cleanup_resources: ${{ inputs.cleanup_resources }}
115+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
116+
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
117+
AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }}
118+
AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
119+
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
120+
IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }}
121+
secrets: inherit
122+
111123
send-notification:
112124
if: "!cancelled()"
113-
needs: [docker-build, deploy, e2e-test]
125+
needs: [docker-build, deploy, e2e-test, cleanup-deployment]
114126
uses: ./.github/workflows/job-send-notification.yml
115127
with:
116128
trigger_type: ${{ inputs.trigger_type }}
@@ -125,20 +137,5 @@ jobs:
125137
QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }}
126138
TEST_SUCCESS: ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
127139
TEST_REPORT_URL: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
128-
secrets: inherit
129-
130-
cleanup-deployment:
131-
if: "!cancelled() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
132-
needs: [docker-build, deploy, e2e-test]
133-
uses: ./.github/workflows/job-cleanup-deployment.yml
134-
with:
135-
runner_os: ${{ inputs.runner_os }}
136-
trigger_type: ${{ inputs.trigger_type }}
137-
cleanup_resources: ${{ inputs.cleanup_resources }}
138-
existing_webapp_url: ${{ inputs.existing_webapp_url }}
139-
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
140-
AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }}
141-
AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
142-
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
143-
IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }}
140+
cleanup_result: ${{ needs.cleanup-deployment.result }}
144141
secrets: inherit
Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
name: Deploy-Test-Cleanup (v2) Linux
1+
name: Deploy-Test-Cleanup (v2)
22

33
permissions:
4+
id-token: write
45
contents: read
56
actions: read
67
on:
@@ -14,6 +15,14 @@ on:
1415
- hotfix
1516
workflow_dispatch:
1617
inputs:
18+
runner_os:
19+
description: 'Deployment Environment'
20+
required: false
21+
type: choice
22+
options:
23+
- 'codespace'
24+
- 'Local'
25+
default: 'codespace'
1726
azure_location:
1827
description: 'Azure Location For Deployment'
1928
required: false
@@ -90,6 +99,7 @@ jobs:
9099
runs-on: ubuntu-latest
91100
outputs:
92101
validation_passed: ${{ steps.validate.outputs.passed }}
102+
runner_os: ${{ steps.validate.outputs.runner_os }}
93103
azure_location: ${{ steps.validate.outputs.azure_location }}
94104
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
95105
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
@@ -105,6 +115,7 @@ jobs:
105115
id: validate
106116
shell: bash
107117
env:
118+
INPUT_RUNNER_OS: ${{ github.event.inputs.runner_os }}
108119
INPUT_AZURE_LOCATION: ${{ github.event.inputs.azure_location }}
109120
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
110121
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
@@ -118,6 +129,20 @@ jobs:
118129
run: |
119130
echo "🔍 Validating workflow input parameters..."
120131
VALIDATION_FAILED=false
132+
133+
# Resolve runner_os from Deployment Environment selection
134+
DEPLOY_ENV="${INPUT_RUNNER_OS:-codespace}"
135+
if [[ "$DEPLOY_ENV" == "codespace" ]]; then
136+
RUNNER_OS="ubuntu-latest"
137+
echo "✅ Deployment Environment: 'codespace' → runner: ubuntu-latest"
138+
elif [[ "$DEPLOY_ENV" == "Local" ]]; then
139+
RUNNER_OS="windows-latest"
140+
echo "✅ Deployment Environment: 'Local' → runner: windows-latest"
141+
else
142+
echo "❌ ERROR: Deployment Environment must be 'codespace' or 'Local', got: '$DEPLOY_ENV'"
143+
VALIDATION_FAILED=true
144+
RUNNER_OS="ubuntu-latest"
145+
fi
121146
122147
# Validate azure_location (Azure region format)
123148
LOCATION="${INPUT_AZURE_LOCATION:-australiaeast}"
@@ -241,6 +266,7 @@ jobs:
241266
242267
# Output validated values
243268
echo "passed=true" >> $GITHUB_OUTPUT
269+
echo "runner_os=$RUNNER_OS" >> $GITHUB_OUTPUT
244270
echo "azure_location=$LOCATION" >> $GITHUB_OUTPUT
245271
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
246272
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
@@ -257,7 +283,7 @@ jobs:
257283
if: needs.validate-inputs.outputs.validation_passed == 'true'
258284
uses: ./.github/workflows/deploy-orchestrator.yml
259285
with:
260-
runner_os: ubuntu-latest
286+
runner_os: ${{ needs.validate-inputs.outputs.runner_os || 'ubuntu-latest' }}
261287
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
262288
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
263289
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}

.github/workflows/deploy-waf.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
name: Validate WAF Deployment v4
22

33
permissions:
4+
id-token: write
45
contents: read
56
actions: read
67
on:
78
push:
89
branches:
910
- main
11+
paths:
12+
- 'src/**'
13+
- 'infra/**'
14+
- 'azure.yaml'
15+
- 'azure_custom.yaml'
16+
- '.github/workflows/deploy-waf.yml'
1017
schedule:
1118
- cron: "0 11,23 * * *" # Runs at 11:00 AM and 11:00 PM GMT
1219

1320
jobs:
1421
deploy:
1522
runs-on: ubuntu-latest
23+
environment: production
1624
env:
1725
GPT_MIN_CAPACITY: 1
1826
O4_MINI_MIN_CAPACITY: 1
@@ -21,12 +29,16 @@ jobs:
2129
- name: Checkout Code
2230
uses: actions/checkout@v6
2331

32+
- name: Login to Azure
33+
uses: azure/login@v2
34+
with:
35+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
36+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
37+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
38+
2439
- name: Run Quota Check
2540
id: quota-check
2641
env:
27-
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
28-
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
29-
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
3042
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
3143
GPT_MIN_CAPACITY: ${{ env.GPT_MIN_CAPACITY }}
3244
O4_MINI_MIN_CAPACITY: ${{ env.O4_MINI_MIN_CAPACITY }}
@@ -66,10 +78,6 @@ jobs:
6678
echo "Selected Region: $VALID_REGION"
6779
echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
6880
69-
- name: Login to Azure
70-
run: |
71-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
72-
7381
- name: Install Bicep CLI
7482
run: az bicep install
7583

0 commit comments

Comments
 (0)