Skip to content

Commit b4f707f

Browse files
feat: FDP integration – migrate to Foundry project, enable keyless OpenAI auth, and update test automation workflows
2 parents 0bf8223 + f03ec14 commit b4f707f

Some content is hidden

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

52 files changed

+1525
-903
lines changed

.github/workflows/deploy-KMGeneric.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
104104
- name: Determine Tag Name Based on Branch
105105
id: determine_tag
106-
run: echo "tagname=${{ github.ref_name == 'main' && 'latest_migrated' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.ref_name == 'dependabotchanges' && 'dependabotchanges' || github.head_ref || 'default' }}" >> $GITHUB_OUTPUT
106+
run: echo "tagname=${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.ref_name == 'dependabotchanges' && 'dependabotchanges' || github.head_ref || 'default' }}" >> $GITHUB_OUTPUT
107107

108108
- name: Deploy Bicep Template
109109
id: deploy

.github/workflows/docker-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
id: determine_tag
5050
run: |
5151
if [[ "${{ github.ref_name }}" == "main" ]]; then
52-
echo "tagname=latest_migrated" >> $GITHUB_OUTPUT
52+
echo "tagname=latest" >> $GITHUB_OUTPUT
5353
elif [[ "${{ github.ref_name }}" == "dev" ]]; then
5454
echo "tagname=dev" >> $GITHUB_OUTPUT
5555
elif [[ "${{ github.ref_name }}" == "demo" ]]; then

.github/workflows/test-automation.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Test Automation KMGeneric
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
paths:
9+
- 'tests/e2e-test/**'
10+
schedule:
11+
- cron: '0 13 * * *' # Runs at 1 PM UTC
12+
workflow_dispatch:
13+
14+
env:
15+
url: ${{ vars.KMG_WEB_URL }}
16+
api_url: ${{ vars.KMG_API_URL }}
17+
accelerator_name: "KMGeneric"
18+
19+
jobs:
20+
test:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: '3.13'
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install -r tests/e2e-test/requirements.txt
35+
36+
- name: Ensure browsers are installed
37+
run: python -m playwright install --with-deps chromium
38+
39+
- name: Run tests(1)
40+
id: test1
41+
run: |
42+
xvfb-run pytest --headed --html=report/report.html --self-contained-html
43+
working-directory: tests/e2e-test
44+
continue-on-error: true
45+
46+
- name: Sleep for 30 seconds
47+
if: ${{ steps.test1.outcome == 'failure' }}
48+
run: sleep 30s
49+
shell: bash
50+
51+
- name: Run tests(2)
52+
if: ${{ steps.test1.outcome == 'failure' }}
53+
id: test2
54+
run: |
55+
xvfb-run pytest --headed --html=report/report.html --self-contained-html
56+
working-directory: tests/e2e-test
57+
continue-on-error: true
58+
59+
- name: Sleep for 60 seconds
60+
if: ${{ steps.test2.outcome == 'failure' }}
61+
run: sleep 60s
62+
shell: bash
63+
64+
- name: Run tests(3)
65+
if: ${{ steps.test2.outcome == 'failure' }}
66+
id: test3
67+
run: |
68+
xvfb-run pytest --headed --html=report/report.html --self-contained-html
69+
working-directory: tests/e2e-test
70+
71+
- name: Upload test report
72+
id: upload_report
73+
uses: actions/upload-artifact@v4
74+
if: ${{ !cancelled() }}
75+
with:
76+
name: test-report
77+
path: tests/e2e-test/report/*
78+
79+
- name: Send Notification
80+
if: always()
81+
run: |
82+
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
83+
REPORT_URL=${{ steps.upload_report.outputs.artifact-url }}
84+
IS_SUCCESS=${{ steps.test1.outcome == 'success' || steps.test2.outcome == 'success' || steps.test3.outcome == 'success' }}
85+
# Construct the email body
86+
if [ "$IS_SUCCESS" = "true" ]; then
87+
EMAIL_BODY=$(cat <<EOF
88+
{
89+
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has completed successfully.</p><p><strong>Run URL:</strong> <a href=\"${RUN_URL}\">${RUN_URL}</a><br></p><p><strong>Test Report:</strong> <a href=\"${REPORT_URL}\">${REPORT_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
90+
"subject": "${{ env.accelerator_name }} Test Automation - Success"
91+
}
92+
EOF
93+
)
94+
else
95+
EMAIL_BODY=$(cat <<EOF
96+
{
97+
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Run URL:</strong> <a href=\"${RUN_URL}\">${RUN_URL}</a><br> ${OUTPUT}</p><p><strong>Test Report:</strong> <a href=\"${REPORT_URL}\">${REPORT_URL}</a></p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>",
98+
"subject": "${{ env.accelerator_name }} Test Automation - Failure"
99+
}
100+
EOF
101+
)
102+
fi
103+
# Send the notification
104+
curl -X POST "${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA}}" \
105+
-H "Content-Type: application/json" \
106+
-d "$EMAIL_BODY" || echo "Failed to send notification"

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Run Backend Tests with Coverage
9393
if: env.skip_backend_tests == 'false'
9494
run: |
95-
pytest --cov=. --cov-report=term-missing --cov-report=xml
95+
pytest --cov=. --cov-report=term-missing --cov-report=xml ./src/tests/api
9696
9797
- name: Skip Backend Tests
9898
if: env.skip_backend_tests == 'true'
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
AZURE_AI_SEARCH_API_KEY=""
2-
AZURE_OPENAI_API_KEY=""
32

docs/workshop/docs/workshop/Challenge-3-and-4/Challenge-3.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ One of the easiest and most fun changes you can make to the app is updating the
5757
![Azure Portal Settings > Configuration](../img/portal-app-api-env.png)
5858
5. Locate the following environment variables:
5959
- `AZURE_AI_SEARCH_API_KEY`
60-
- `AZURE_OPENAI_API_KEY`
6160
6. Copy their values and paste them into your local `\workshop\docs\workshop\.env.sample` file:
6261
`AZURE_AI_SEARCH_API_KEY=your-key-from-portal`
63-
`AZURE_OPENAI_API_KEY=your-other-key-from-portal`
6462
7. Rename the .env.sample file to .env
6563
8. Open a terminal or command prompt.
6664
9. Navigate to the project directory where `start.cmd` is located:

docs/workshop/docs/workshop/Challenge-3-and-4/Challenge-4.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
1. Open the [knowledge_mining_api notebook](./knowledge_mining_api.ipynb) from the Challenge-3-and-4 folder
44
2. Run the first cell to import the requirements
5-
3. The second cell defines a class that is used to define the plugin for the Azure AI Project Client. This contains the various functions that power different behaviors such as greeting, query Azure SQL database and query Azure AI Search. Run cell 2 to see the results when a user says Hello. The next result will show when a user asks a question and runs the Azure SQL query function. Finally we will see two more results when the user asks questions that runs the Azure AI Search function.
6-
4. Finally, you could update the `user_inputs` in cell 2 to try out more questions.
5+
3. Run the second cell to define a function to connect to the Azure SQL database.
6+
4. The third cell defines a class that is used to define the plugin for the Azure AI Agent. This contains the various functions that power different behaviors such as greeting, query Azure SQL database and query Azure AI Search. Run cell 3 and 4 to see the results when a user says Hello. The next result will show when a user asks a question and runs the Azure SQL query function. Finally we will see a result when the user asks questions that runs the Azure AI Search function.
7+
5. Finally, you could update the `user_inputs` in cell 3 to try out more questions.
78

89
```shell
910
user_inputs = [

0 commit comments

Comments
 (0)