Skip to content

Commit cf776ed

Browse files
Merge pull request #261 from microsoft/demo-conflicts
Demo conflicts resolved
2 parents 082bf29 + eabc2f5 commit cf776ed

115 files changed

Lines changed: 16379 additions & 3157 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.

.github/workflows/test.yml

Lines changed: 105 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ on:
88
paths:
99
- 'src/backend-api/**/*.py'
1010
- 'src/backend-api/pyproject.toml'
11+
- 'src/backend-api/uv.lock'
1112
- 'src/backend-api/pytest.ini'
13+
- 'src/processor/**/*.py'
14+
- 'src/processor/pyproject.toml'
15+
- 'src/processor/uv.lock'
1216
- '.github/workflows/test.yml'
1317
pull_request:
1418
types:
@@ -22,7 +26,11 @@ on:
2226
paths:
2327
- 'src/backend-api/**/*.py'
2428
- 'src/backend-api/pyproject.toml'
29+
- 'src/backend-api/uv.lock'
2530
- 'src/backend-api/pytest.ini'
31+
- 'src/processor/**/*.py'
32+
- 'src/processor/pyproject.toml'
33+
- 'src/processor/uv.lock'
2634
- '.github/workflows/test.yml'
2735

2836
permissions:
@@ -36,10 +44,10 @@ jobs:
3644

3745
steps:
3846
- name: Checkout code
39-
uses: actions/checkout@v5
47+
uses: actions/checkout@v4
4048

4149
- name: Set up Python
42-
uses: actions/setup-python@v6
50+
uses: actions/setup-python@v5
4351
with:
4452
python-version: "3.12"
4553

@@ -48,7 +56,7 @@ jobs:
4856
python -m pip install --upgrade pip
4957
cd src/backend-api
5058
pip install -e .
51-
pip install pytest pytest-cov
59+
pip install pytest pytest-cov pytest-asyncio
5260
5361
- name: Check if Backend Test Files Exist
5462
id: check_backend_tests
@@ -71,9 +79,26 @@ jobs:
7179
--cov=src/app \
7280
--cov-report=term-missing \
7381
--cov-report=xml:reports/coverage.xml \
82+
--cov-fail-under=82 \
7483
--junitxml=pytest.xml \
7584
-v
7685
86+
- name: Prefix coverage XML filenames with repo-root path
87+
if: env.skip_backend_tests == 'false'
88+
run: |
89+
python <<'PY'
90+
import xml.etree.ElementTree as ET
91+
path = "src/backend-api/reports/coverage.xml"
92+
prefix = "src/backend-api/src/app/"
93+
tree = ET.parse(path)
94+
root = tree.getroot()
95+
for cls in root.iter("class"):
96+
fname = cls.attrib.get("filename", "")
97+
if fname and not fname.startswith(prefix):
98+
cls.attrib["filename"] = prefix + fname
99+
tree.write(path, xml_declaration=True, encoding="utf-8")
100+
PY
101+
77102
- name: Pytest Coverage Comment
78103
if: |
79104
always() &&
@@ -90,3 +115,80 @@ jobs:
90115
if: env.skip_backend_tests == 'true'
91116
run: |
92117
echo "Skipping backend tests because no test files were found."
118+
119+
processor_tests:
120+
runs-on: ubuntu-latest
121+
122+
steps:
123+
- name: Checkout code
124+
uses: actions/checkout@v4
125+
126+
- name: Set up Python
127+
uses: actions/setup-python@v5
128+
with:
129+
python-version: "3.12"
130+
131+
- name: Install Processor Dependencies
132+
run: |
133+
python -m pip install --upgrade pip
134+
cd src/processor
135+
pip install -e .
136+
pip install pytest pytest-cov pytest-asyncio
137+
138+
- name: Check if Processor Test Files Exist
139+
id: check_processor_tests
140+
run: |
141+
if [ -z "$(find src/processor/src/tests -type f -name 'test_*.py' 2>/dev/null)" ]; then
142+
echo "No processor test files found, skipping processor tests."
143+
echo "skip_processor_tests=true" >> $GITHUB_ENV
144+
else
145+
echo "Processor test files found, running tests."
146+
echo "skip_processor_tests=false" >> $GITHUB_ENV
147+
fi
148+
149+
- name: Run Processor Tests with Coverage
150+
if: env.skip_processor_tests == 'false'
151+
run: |
152+
cd src/processor
153+
pytest src/tests \
154+
--cov=src \
155+
--cov-report=term-missing \
156+
--cov-report=xml:reports/coverage.xml \
157+
--cov-fail-under=82 \
158+
--junitxml=pytest.xml \
159+
-v
160+
161+
- name: Prefix coverage XML filenames with repo-root path
162+
if: env.skip_processor_tests == 'false'
163+
run: |
164+
python <<'PY'
165+
import xml.etree.ElementTree as ET
166+
path = "src/processor/reports/coverage.xml"
167+
prefix = "src/processor/src/"
168+
tree = ET.parse(path)
169+
root = tree.getroot()
170+
for cls in root.iter("class"):
171+
fname = cls.attrib.get("filename", "")
172+
if fname and not fname.startswith(prefix):
173+
cls.attrib["filename"] = prefix + fname
174+
tree.write(path, xml_declaration=True, encoding="utf-8")
175+
PY
176+
177+
- name: Pytest Coverage Comment (Processor)
178+
if: |
179+
always() &&
180+
github.event_name == 'pull_request' &&
181+
github.event.pull_request.head.repo.fork == false &&
182+
env.skip_processor_tests == 'false'
183+
uses: MishaKav/pytest-coverage-comment@26f986d2599c288bb62f623d29c2da98609e9cd4 # v1.6.0
184+
with:
185+
pytest-xml-coverage-path: src/processor/reports/coverage.xml
186+
junitxml-path: src/processor/pytest.xml
187+
title: Processor Coverage Report
188+
unique-id-for-comment: processor
189+
report-only-changed-files: true
190+
191+
- name: Skip Processor Tests
192+
if: env.skip_processor_tests == 'true'
193+
run: |
194+
echo "Skipping processor tests because no test files were found."

.github/workflows/validate-bicep-params.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,16 @@ jobs:
3434
- name: Validate infra/ parameters
3535
id: validate_infra
3636
continue-on-error: true
37+
env:
38+
ACCELERATOR_NAME: ${{ env.accelerator_name }}
3739
run: |
3840
set +e
39-
python scripts/validate_bicep_params.py --dir infra --strict --no-color --json-output infra_results.json 2>&1 | tee infra_output.txt
41+
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
42+
python scripts/validate_bicep_params.py --dir infra --strict --no-color \
43+
--json-output infra_results.json \
44+
--html-output email_body.html \
45+
--accelerator-name "${ACCELERATOR_NAME}" \
46+
--run-url "${RUN_URL}" 2>&1 | tee infra_output.txt
4047
EXIT_CODE=${PIPESTATUS[0]}
4148
set -e
4249
echo "## Infra Param Validation" >> "$GITHUB_STEP_SUMMARY"
@@ -61,24 +68,21 @@ jobs:
6168
name: bicep-validation-results
6269
path: |
6370
infra_results.json
71+
email_body.html
6472
retention-days: 30
6573

6674
- name: Send schedule notification on failure
6775
if: github.event_name == 'schedule' && steps.result.outputs.status == 'failure'
6876
env:
6977
LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}
70-
GITHUB_REPOSITORY: ${{ github.repository }}
71-
GITHUB_RUN_ID: ${{ github.run_id }}
7278
ACCELERATOR_NAME: ${{ env.accelerator_name }}
7379
run: |
74-
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
75-
INFRA_OUTPUT=$(sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g' infra_output.txt)
80+
EMAIL_BODY=$(cat email_body.html)
7681
7782
jq -n \
7883
--arg name "${ACCELERATOR_NAME}" \
79-
--arg infra "$INFRA_OUTPUT" \
80-
--arg url "$RUN_URL" \
81-
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Issues Detected"), body: ("<p>Dear Team,</p><p>The scheduled <strong>Bicep Parameter Validation</strong> for <strong>" + $name + "</strong> has detected parameter mapping errors.</p><p><strong>infra/ Results:</strong></p><pre>" + $infra + "</pre><p><strong>Run URL:</strong> <a href=\"" + $url + "\">" + $url + "</a></p><p>Please fix the parameter mapping issues at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>")}' \
84+
--arg body "$EMAIL_BODY" \
85+
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Issues Detected"), body: $body}' \
8286
| curl -X POST "${LOGICAPP_URL}" \
8387
-H "Content-Type: application/json" \
8488
-d @- || echo "Failed to send notification"
@@ -87,18 +91,14 @@ jobs:
8791
if: github.event_name == 'schedule' && steps.result.outputs.status == 'success'
8892
env:
8993
LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}
90-
GITHUB_REPOSITORY: ${{ github.repository }}
91-
GITHUB_RUN_ID: ${{ github.run_id }}
9294
ACCELERATOR_NAME: ${{ env.accelerator_name }}
9395
run: |
94-
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
95-
INFRA_OUTPUT=$(sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g' infra_output.txt)
96+
EMAIL_BODY=$(cat email_body.html)
9697
9798
jq -n \
9899
--arg name "${ACCELERATOR_NAME}" \
99-
--arg infra "$INFRA_OUTPUT" \
100-
--arg url "$RUN_URL" \
101-
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Passed"), body: ("<p>Dear Team,</p><p>The scheduled <strong>Bicep Parameter Validation</strong> for <strong>" + $name + "</strong> has completed successfully. All parameter mappings are valid.</p><p><strong>infra/ Results:</strong></p><pre>" + $infra + "</pre><p><strong>Run URL:</strong> <a href=\"" + $url + "\">" + $url + "</a></p><p>Best regards,<br>Your Automation Team</p>")}' \
100+
--arg body "$EMAIL_BODY" \
101+
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Passed"), body: $body}' \
102102
| curl -X POST "${LOGICAPP_URL}" \
103103
-H "Content-Type: application/json" \
104104
-d @- || echo "Failed to send notification"

docs/DeploymentGuide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ Select one of the following options to deploy the Container Migration Solution A
156156
**Required Tools:**
157157
- [PowerShell 7.0+](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell)
158158
- [Azure Developer CLI (azd) 1.18.0+](https://aka.ms/install-azd)
159+
- [Bicep CLI 0.33.0+](https://learn.microsoft.com/azure/azure-resource-manager/bicep/install)
159160
- [Python 3.9+](https://www.python.org/downloads/)
160161
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
161162
- [Git](https://git-scm.com/downloads)

infra/main.bicep

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ module aiFoundryAiServices 'br/public:avm/res/cognitive-services/account:0.13.2'
872872
principalType: 'ServicePrincipal'
873873
}
874874
{
875-
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Azure AI User
875+
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Foundry User
876876
principalId: appIdentity.outputs.principalId
877877
principalType: 'ServicePrincipal'
878878
}
@@ -1123,6 +1123,12 @@ module containerAppsEnvironment 'br/public:avm/res/app/managed-environment:0.11.
11231123
params: {
11241124
name: 'cae-${solutionSuffix}'
11251125
location: location
1126+
tags: {
1127+
...resourceGroup().tags
1128+
...existingTags
1129+
...allTags
1130+
...tags
1131+
}
11261132
managedIdentities: { systemAssigned: true }
11271133
appLogsConfiguration: enableMonitoring
11281134
? {

infra/main.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"metadata": {
66
"_generator": {
77
"name": "bicep",
8-
"version": "0.43.1.21952",
9-
"templateHash": "1278209883407272359"
8+
"version": "0.43.8.12551",
9+
"templateHash": "13087590133917597872"
1010
}
1111
},
1212
"parameters": {
@@ -4715,8 +4715,8 @@
47154715
"metadata": {
47164716
"_generator": {
47174717
"name": "bicep",
4718-
"version": "0.43.1.21952",
4719-
"templateHash": "4488065934246762087"
4718+
"version": "0.43.8.12551",
4719+
"templateHash": "4604761290796021104"
47204720
}
47214721
},
47224722
"definitions": {
@@ -26135,8 +26135,8 @@
2613526135
},
2613626136
"dependsOn": [
2613726137
"appIdentity",
26138-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
2613926138
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
26139+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
2614026140
"virtualNetwork"
2614126141
]
2614226142
},
@@ -30103,8 +30103,8 @@
3010330103
"metadata": {
3010430104
"_generator": {
3010530105
"name": "bicep",
30106-
"version": "0.43.1.21952",
30107-
"templateHash": "17526785557845507677"
30106+
"version": "0.43.8.12551",
30107+
"templateHash": "13516349791985095953"
3010830108
}
3010930109
},
3011030110
"definitions": {
@@ -33853,8 +33853,8 @@
3385333853
},
3385433854
"dependsOn": [
3385533855
"aiFoundryAiServices",
33856-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
3385733856
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
33857+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
3385833858
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
3385933859
"virtualNetwork"
3386033860
]
@@ -33892,8 +33892,8 @@
3389233892
"metadata": {
3389333893
"_generator": {
3389433894
"name": "bicep",
33895-
"version": "0.43.1.21952",
33896-
"templateHash": "8251376928798842081"
33895+
"version": "0.43.8.12551",
33896+
"templateHash": "17583277036649944863"
3389733897
}
3389833898
},
3389933899
"parameters": {
@@ -38362,6 +38362,9 @@
3836238362
"location": {
3836338363
"value": "[parameters('location')]"
3836438364
},
38365+
"tags": {
38366+
"value": "[shallowMerge(createArray(resourceGroup().tags, variables('existingTags'), variables('allTags'), parameters('tags')))]"
38367+
},
3836538368
"managedIdentities": {
3836638369
"value": {
3836738370
"systemAssigned": true

infra/main.parameters.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
},
4141
"imageTag": {
4242
"value": "${AZURE_ENV_IMAGE_TAG}"
43+
},
44+
"tags": {
45+
"value": "${AZURE_ENV_TAGS}"
4346
}
4447
}
4548
}

infra/main.waf.parameters.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
},
5656
"vmSize": {
5757
"value": "${AZURE_ENV_VM_SIZE}"
58+
},
59+
"tags": {
60+
"value": "${AZURE_ENV_TAGS}"
5861
}
5962
}
6063
}

infra/main_custom.bicep

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ module existingAiFoundryAiServicesDeployments 'modules/ai-services-deployments.b
760760
{
761761
principalId: appIdentity.outputs.principalId
762762
principalType: 'ServicePrincipal'
763-
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Azure AI User
763+
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Foundry User
764764
}
765765
]
766766
}
@@ -814,7 +814,7 @@ module aiFoundryAiServices 'br/public:avm/res/cognitive-services/account:0.13.2'
814814
principalType: 'ServicePrincipal'
815815
}
816816
{
817-
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Azure AI User
817+
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Foundry User
818818
principalId: appIdentity.outputs.principalId
819819
principalType: 'ServicePrincipal'
820820
}
@@ -1076,6 +1076,12 @@ module containerAppsEnvironment 'br/public:avm/res/app/managed-environment:0.11.
10761076
params: {
10771077
name: 'cae-${solutionSuffix}'
10781078
location: location
1079+
tags: {
1080+
...resourceGroup().tags
1081+
...existingTags
1082+
...allTags
1083+
...tags
1084+
}
10791085
managedIdentities: { systemAssigned: true }
10801086
appLogsConfiguration: enableMonitoring
10811087
? {

infra/modules/cosmosDb.bicep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ module cosmosAccount 'br/public:avm/res/document-db/database-account:0.15.1' = {
4949
name: take('avm.res.document-db.account.${name}', 64)
5050
params: {
5151
name: name
52-
enableAnalyticalStorage: true
5352
location: location
5453
minimumTlsVersion: 'Tls12'
5554
defaultConsistencyLevel: 'Session'

0 commit comments

Comments
 (0)