Skip to content

Commit e95352e

Browse files
Merge branch 'dev' into psl-us18810-kmgen
2 parents 9131ab9 + 2a7712e commit e95352e

Some content is hidden

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

45 files changed

+1054
-510
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"image": "mcr.microsoft.com/devcontainers/python:3.11-bullseye",
44
"forwardPorts": [50505],
55
"features": {
6-
"ghcr.io/azure/azure-dev/azd:latest": {}
6+
"ghcr.io/azure/azure-dev/azd:latest": {},
7+
"ghcr.io/devcontainers/features/azure-cli:1": {}
78
},
89
"customizations": {
910
"vscode": {

.devcontainer/setup_env.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ git pull
55

66
# provide execute permission to quotacheck script
77
sudo chmod +x ./infra/scripts/checkquota_km.sh
8-
sudo chmod +x ./infra/scripts/quota_check_params.sh
8+
sudo chmod +x ./infra/scripts/quota_check_params.sh
9+
sudo chmod +x ./infra/scripts/run_process_data_scripts.sh

.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/deploy.yml

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,3 @@
1-
# name: Deploy MkDocs site to GitHub Pages
2-
3-
# on:
4-
# push:
5-
# branches:
6-
# - main
7-
8-
# jobs:
9-
# deploy:
10-
# runs-on: ubuntu-latest
11-
12-
# steps:
13-
# # Checkout the repo
14-
# - name: Checkout repo
15-
# uses: actions/checkout@v3
16-
17-
# # Set up Python environment
18-
# - name: Set up Python
19-
# uses: actions/setup-python@v4
20-
# with:
21-
# python-version: '3.x'
22-
23-
# # Install MkDocs and Material theme
24-
# - name: Install MkDocs & Material theme
25-
# run: |
26-
# pip install mkdocs-material mkdocs-jupyter
27-
28-
# # Build the MkDocs site
29-
# - name: Build the site
30-
# run: |
31-
# cd workshop
32-
# mkdocs build
33-
# touch site/.nojekyll # Disable Jekyll
34-
35-
# # Deploy to GitHub Pages
36-
# - name: Deploy to GitHub Pages
37-
# uses: peaceiris/actions-gh-pages@v3
38-
# with:
39-
# github_token: ${{ secrets.GITHUB_TOKEN }}
40-
# publish_dir: workshop/site
411

422
name: Deploy MkDocs site to GitHub Pages
433

@@ -46,6 +6,11 @@ on:
466
branches:
477
- main
488

9+
permissions:
10+
contents: write
11+
pages: write
12+
id-token: write
13+
4914
jobs:
5015
build-and-deploy:
5116
runs-on: ubuntu-latest

.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
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'

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ Follow the quick deploy steps on the deployment guide to deploy this solution
7272
<br/>
7373

7474
> ⚠️ **Important: Check Azure OpenAI Quota Availability**
75-
<br/>To ensure sufficient quota is available in your subscription, please follow [quota check instructions guide](./docs/QuotaCheck.md) before you deploy the solution.
75+
<br/>To ensure sufficient quota is available in your subscription, please follow [quota check instructions guide](./documents/QuotaCheck.md) before you deploy the solution.
7676
7777
<br/>
7878

7979
### Prerequisites and costs
80-
To deploy this solution accelerator, ensure you have access to an [Azure subscription](https://azure.microsoft.com/free/) with the necessary permissions to create **resource groups, resources, app registrations, and assign roles at the resource group level**. This should include Contributor role at the subscription level and Role Based Access Control role on the subscription and/or resource group level. Follow the steps in [Azure Account Set Up](./docs/AzureAccountSetUp.md).
80+
To deploy this solution accelerator, ensure you have access to an [Azure subscription](https://azure.microsoft.com/free/) with the necessary permissions to create **resource groups, resources, app registrations, and assign roles at the resource group level**. This should include Contributor role at the subscription level and Role Based Access Control role on the subscription and/or resource group level. Follow the steps in [Azure Account Set Up](./documents/AzureAccountSetUp.md).
8181

8282
Here are some example regions where the services are available: East US, East US2, Australia East, UK South, France Central.
8383

@@ -204,4 +204,4 @@ You acknowledge that the Software and Microsoft Products and Services (1) are no
204204

205205
You acknowledge the Software is not subject to SOC 1 and SOC 2 compliance audits. No Microsoft technology, nor any of its component technologies, including the Software, is intended or made available as a substitute for the professional advice, opinion, or judgement of a certified financial services professional. Do not use the Software to replace, substitute, or provide professional financial advice or judgment.
206206

207-
BY ACCESSING OR USING THE SOFTWARE, YOU ACKNOWLEDGE THAT THE SOFTWARE IS NOT DESIGNED OR INTENDED TO SUPPORT ANY USE IN WHICH A SERVICE INTERRUPTION, DEFECT, ERROR, OR OTHER FAILURE OF THE SOFTWARE COULD RESULT IN THE DEATH OR SERIOUS BODILY INJURY OF ANY PERSON OR IN PHYSICAL OR ENVIRONMENTAL DAMAGE (COLLECTIVELY, “HIGH-RISK USE”), AND THAT YOU WILL ENSURE THAT, IN THE EVENT OF ANY INTERRUPTION, DEFECT, ERROR, OR OTHER FAILURE OF THE SOFTWARE, THE SAFETY OF PEOPLE, PROPERTY, AND THE ENVIRONMENT ARE NOT REDUCED BELOW A LEVEL THAT IS REASONABLY, APPROPRIATE, AND LEGAL, WHETHER IN GENERAL OR IN A SPECIFIC INDUSTRY. BY ACCESSING THE SOFTWARE, YOU FURTHER ACKNOWLEDGE THAT YOUR HIGH-RISK USE OF THE SOFTWARE IS AT YOUR OWN RISK.
207+
BY ACCESSING OR USING THE SOFTWARE, YOU ACKNOWLEDGE THAT THE SOFTWARE IS NOT DESIGNED OR INTENDED TO SUPPORT ANY USE IN WHICH A SERVICE INTERRUPTION, DEFECT, ERROR, OR OTHER FAILURE OF THE SOFTWARE COULD RESULT IN THE DEATH OR SERIOUS BODILY INJURY OF ANY PERSON OR IN PHYSICAL OR ENVIRONMENTAL DAMAGE (COLLECTIVELY, “HIGH-RISK USE”), AND THAT YOU WILL ENSURE THAT, IN THE EVENT OF ANY INTERRUPTION, DEFECT, ERROR, OR OTHER FAILURE OF THE SOFTWARE, THE SAFETY OF PEOPLE, PROPERTY, AND THE ENVIRONMENT ARE NOT REDUCED BELOW A LEVEL THAT IS REASONABLY, APPROPRIATE, AND LEGAL, WHETHER IN GENERAL OR IN A SPECIFIC INDUSTRY. BY ACCESSING THE SOFTWARE, YOU FURTHER ACKNOWLEDGE THAT YOUR HIGH-RISK USE OF THE SOFTWARE IS AT YOUR OWN RISK.

docs/workshop/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Conversation Knowledge Mining Solution Accelerator: Hands-on Workshop
22

33
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator) |
4-
|---|---|
5-
64

75

86
### About the Conversation Knowledge Mining Solution Accelerator

docs/workshop/docs/workshop/Challenge-3-and-4/knowledge_mining_api.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"from azure.identity.aio import DefaultAzureCredential\n",
3232
"from azure.ai.projects import AIProjectClient\n",
3333
"from semantic_kernel.agents import AzureAIAgent\n",
34-
"from azure.ai.projects.models import TruncationObject"
34+
"from azure.ai.projects.models import TruncationObject\n",
35+
"from azure.identity import DefaultAzureCredential, get_bearer_token_provider"
3536
]
3637
},
3738
{
@@ -221,9 +222,12 @@
221222
" self,\n",
222223
" question: Annotated[str, \"the question\"]\n",
223224
" ):\n",
225+
" token_provider = get_bearer_token_provider(\n",
226+
" DefaultAzureCredential(), \"https://cognitiveservices.azure.com/.default\"\n",
227+
" )\n",
224228
" client = openai.AzureOpenAI(\n",
225229
" azure_endpoint=self.azure_openai_endpoint,\n",
226-
" api_key=self.azure_openai_api_key,\n",
230+
" azure_ad_token_provider=token_provider,\n",
227231
" api_version=self.azure_openai_api_version\n",
228232
" )\n",
229233
"\n",

0 commit comments

Comments
 (0)