Skip to content

Commit c551c3c

Browse files
authored
Merge branch 'main' into pamelafox-patch-36
2 parents 954214f + 84cf73e commit c551c3c

File tree

258 files changed

+8850
-2695
lines changed

Some content is hidden

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

258 files changed

+8850
-2695
lines changed

.azdo/pipelines/azure-dev.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ steps:
5959
AZURE_SEARCH_QUERY_LANGUAGE: $(AZURE_SEARCH_QUERY_LANGUAGE)
6060
AZURE_SEARCH_QUERY_SPELLER: $(AZURE_SEARCH_QUERY_SPELLER)
6161
AZURE_SEARCH_SEMANTIC_RANKER: $(AZURE_SEARCH_SEMANTIC_RANKER)
62+
AZURE_SEARCH_QUERY_REWRITING: $(AZURE_SEARCH_QUERY_REWRITING)
63+
AZURE_SEARCH_FIELD_NAME_EMBEDDING: $(AZURE_SEARCH_FIELD_NAME_EMBEDDING)
6264
AZURE_STORAGE_ACCOUNT: $(AZURE_STORAGE_ACCOUNT)
6365
AZURE_STORAGE_RESOURCE_GROUP: $(AZURE_STORAGE_RESOURCE_GROUP)
6466
AZURE_STORAGE_SKU: $(AZURE_STORAGE_SKU)
@@ -68,6 +70,7 @@ steps:
6870
AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY: $(AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY)
6971
AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION: $(AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION)
7072
AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU: $(AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU)
73+
AZURE_OPENAI_REASONING_EFFORT: $(AZURE_OPENAI_REASONING_EFFORT)
7174
AZURE_OPENAI_EMB_MODEL_NAME: $(AZURE_OPENAI_EMB_MODEL_NAME)
7275
AZURE_OPENAI_EMB_DEPLOYMENT: $(AZURE_OPENAI_EMB_DEPLOYMENT)
7376
AZURE_OPENAI_EMB_DEPLOYMENT_CAPACITY: $(AZURE_OPENAI_EMB_DEPLOYMENT_CAPACITY)

.devcontainer/devcontainer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"features": {
55
"ghcr.io/devcontainers/features/node:1": {
66
// This should match the version of Node.js in Github Actions workflows
7-
"version": "18",
7+
"version": "22",
88
"nodeGypDependencies": false
99
},
1010
"ghcr.io/devcontainers/features/azure-cli:1.2.5": {},
@@ -17,7 +17,8 @@
1717
"ms-azuretools.azure-dev",
1818
"ms-azuretools.vscode-bicep",
1919
"ms-python.python",
20-
"esbenp.prettier-vscode"
20+
"esbenp.prettier-vscode",
21+
"DavidAnson.vscode-markdownlint"
2122
]
2223
}
2324
},
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
description: 'Fix and verify issues in app'
3+
model: GPT-5 (Preview)
4+
tools: ['extensions', 'codebase', 'usages', 'vscodeAPI', 'problems', 'changes', 'testFailure', 'fetch', 'findTestFiles', 'searchResults', 'githubRepo', 'runTests', 'runCommands', 'runTasks', 'editFiles', 'runNotebooks', 'search', 'new', 'create_pull_request', 'get_issue', 'get_issue_comments', 'get-library-docs', 'playwright', 'pylance mcp server']
5+
---
6+
7+
# Fixer Mode Instructions
8+
9+
You are in fixer mode. When given an issue to fix, follow these steps:
10+
11+
**Gather context**: Read error messages/stack traces/related code. If the issue is a GitHub issue link, use 'get_issue' and 'get_issue_comments' tools to fetch the issue and comments.
12+
**Make targeted fix**: Make minimal changes to fix the issue. Do not fix any issues that weren't identified. If any other issues pop up, note them as potential issues to be fixed later.
13+
**Verify fix**: Test the application to ensure the fix works as intended and doesn't introduce new issues. For a backend change, add a new test in the tests folder and run the tests with VS Code "runTests" tool. RUN all the tests using that tool, not just the tests you added. Try to add tests to existing test files when possible, like test_app.py. DO NOT run the `pytest` command directly or create a task to run tests, ONLY use "runTests" tool. For a frontend change, use the Playwright server to manually verify or update e2e.py tests.
14+
15+
## Local server setup
16+
17+
You MUST check task output readiness before debugging, testing, or declaring work complete.
18+
19+
- Start the app: Run the "Development" compound task (which runs both frontend and backend tasks) and check readiness from task output. Both must be in ready state:
20+
- Frontend task: "Frontend: npm run dev"
21+
- Backend task: "Backend: quart run"
22+
- Investigate and fix errors shown in the corresponding task terminal before proceeding. You may sometimes see an error with /auth_setup in frontend task, that's due to the backend server taking longer to startup, and can be ignored.
23+
- Both of the tasks provide hot reloading behavior:
24+
- Frontend: Vite provides HMR; changes in the frontend are picked up automatically without restarting the task.
25+
- Backend: Quart was started with --reload; Python changes trigger an automatic restart.
26+
- If watchers seem stuck or output stops updating, stop the tasks and run the "Development" task again.
27+
- To interact with a running application, use the Playwright MCP server. If testing login, you will need to navigate to 'localhost' instead of '127.0.0.1' since that's the URL allowed by the Entra application.
28+
29+
## Committing the change
30+
31+
When change is complete, offer to make a new branch, git commit, and pull request.
32+
Make sure the PR follows the PULL_REQUEST_TEMPLATE.md format, with all sections filled out and appropriate checkboxes checked.

.github/copilot-instructions.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Adding new data
2+
3+
New files should be added to the `data` folder, and then either run scripts/prepdocs.sh or scripts/prepdocs.ps1 to ingest the data.
4+
5+
# Adding a new azd environment variable
6+
7+
An azd environment variable is stored by the azd CLI for each environment. It is passed to the "azd up" command and can configure both provisioning options and application settings.
8+
When adding new azd environment variables, update:
9+
10+
1. infra/main.parameters.json : Add the new parameter with a Bicep-friendly variable name and map to the new environment variable
11+
1. infra/main.bicep: Add the new Bicep parameter at the top, and add it to the `appEnvVariables` object
12+
1. azure.yaml: Add the new environment variable under pipeline config section
13+
1. .azdo/pipelines/azure-dev.yml: Add the new environment variable under `env` section
14+
1. .github/workflows/azure-dev.yml: Add the new environment variable under `env` section
15+
16+
# Adding a new setting to "Developer Settings" in RAG app
17+
18+
When adding a new developer setting, update:
19+
20+
* frontend:
21+
* app/frontend/src/api/models.ts : Add to ChatAppRequestOverrides
22+
* app/frontend/src/components/Settings.tsx : Add a UI element for the setting
23+
* app/frontend/src/locales/*/translations.json: Add a translation for the setting label/tooltip for all languages
24+
* app/frontend/src/pages/chat/Chat.tsx: Add the setting to the component, pass it to Settings
25+
* app/frontend/src/pages/ask/Ask.tsx: Add the setting to the component, pass it to Settings
26+
27+
* backend:
28+
* app/backend/approaches/chatreadretrieveread.py : Retrieve from overrides parameter
29+
* app/backend/approaches/retrievethenread.py : Retrieve from overrides parameter
30+
* app/backend/app.py: Some settings may need to be sent down in the /config route.
31+
32+
# When adding tests for a new feature:
33+
34+
All tests are in the `tests` folder and use the pytest framework.
35+
There are three styles of tests:
36+
37+
* e2e tests: These use playwright to run the app in a browser and test the UI end-to-end. They are in e2e.py and they mock the backend using the snapshots from the app tests.
38+
* app integration tests: Mostly in test_app.py, these test the app's API endpoints and use mocks for services like Azure OpenAI and Azure Search.
39+
* unit tests: The rest of the tests are unit tests that test individual functions and methods. They are in test_*.py files.
40+
41+
When adding a new feature, add tests for it in the appropriate file.
42+
If the feature is a UI element, add an e2e test for it.
43+
If it is an API endpoint, add an app integration test for it.
44+
If it is a function or method, add a unit test for it.
45+
Use mocks from conftest.py to mock external services.
46+
47+
When you're running tests, make sure you activate the .venv virtual environment first:
48+
49+
```bash
50+
source .venv/bin/activate
51+
```

.github/workflows/azure-dev-validation.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
security-events: write
1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v5
2121

2222
- name: Build Bicep for linting
2323
uses: azure/CLI@v2
@@ -32,7 +32,7 @@ jobs:
3232
security-events: write
3333
steps:
3434
- name: Checkout
35-
uses: actions/checkout@v4
35+
uses: actions/checkout@v5
3636

3737
- name: Run PSRule analysis
3838
uses: microsoft/[email protected]

.github/workflows/azure-dev.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ jobs:
4949
AZURE_SEARCH_QUERY_LANGUAGE: ${{ vars.AZURE_SEARCH_QUERY_LANGUAGE }}
5050
AZURE_SEARCH_QUERY_SPELLER: ${{ vars.AZURE_SEARCH_QUERY_SPELLER }}
5151
AZURE_SEARCH_SEMANTIC_RANKER: ${{ vars.AZURE_SEARCH_SEMANTIC_RANKER }}
52+
AZURE_SEARCH_QUERY_REWRITING: ${{ vars.AZURE_SEARCH_QUERY_REWRITING }}
53+
AZURE_SEARCH_FIELD_NAME_EMBEDDING: ${{ vars.AZURE_SEARCH_FIELD_NAME_EMBEDDING }}
5254
AZURE_STORAGE_ACCOUNT: ${{ vars.AZURE_STORAGE_ACCOUNT }}
5355
AZURE_STORAGE_RESOURCE_GROUP: ${{ vars.AZURE_STORAGE_RESOURCE_GROUP }}
5456
AZURE_STORAGE_SKU: ${{ vars.AZURE_STORAGE_SKU }}
@@ -59,6 +61,7 @@ jobs:
5961
AZURE_OPENAI_CHATGPT_DEPLOYMENT: ${{ vars.AZURE_OPENAI_CHATGPT_DEPLOYMENT }}
6062
AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY: ${{ vars.AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY }}
6163
AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION: ${{ vars.AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION }}
64+
AZURE_OPENAI_REASONING_EFFORT: ${{ vars.AZURE_OPENAI_REASONING_EFFORT }}
6265
AZURE_OPENAI_EMB_MODEL_NAME: ${{ vars.AZURE_OPENAI_EMB_MODEL_NAME }}
6366
AZURE_OPENAI_EMB_DEPLOYMENT: ${{ vars.AZURE_OPENAI_EMB_DEPLOYMENT }}
6467
AZURE_OPENAI_EMB_DEPLOYMENT_CAPACITY: ${{ vars.AZURE_OPENAI_EMB_DEPLOYMENT_CAPACITY }}
@@ -115,39 +118,24 @@ jobs:
115118
USE_AI_PROJECT: ${{ vars.USE_AI_PROJECT }}
116119
steps:
117120
- name: Checkout
118-
uses: actions/checkout@v4
121+
uses: actions/checkout@v5
119122

120123
- name: Install azd
121-
uses: Azure/setup-azd@v2.1.0
124+
uses: Azure/setup-azd@v2.2.0
122125

123126
- name: Install Nodejs
124127
uses: actions/setup-node@v4
125128
with:
126129
node-version: 18
127130

128131
- name: Log in with Azure (Federated Credentials)
129-
if: ${{ env.AZURE_CLIENT_ID != '' }}
130132
run: |
131133
azd auth login `
132134
--client-id "$Env:AZURE_CLIENT_ID" `
133135
--federated-credential-provider "github" `
134136
--tenant-id "$Env:AZURE_TENANT_ID"
135137
shell: pwsh
136138

137-
- name: Log in with Azure (Client Credentials)
138-
if: ${{ env.AZURE_CREDENTIALS != '' }}
139-
run: |
140-
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;
141-
Write-Host "::add-mask::$($info.clientSecret)"
142-
143-
azd auth login `
144-
--client-id "$($info.clientId)" `
145-
--client-secret "$($info.clientSecret)" `
146-
--tenant-id "$($info.tenantId)"
147-
shell: pwsh
148-
env:
149-
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
150-
151139
- name: Provision Infrastructure
152140
run: azd provision --no-prompt
153141
env:

.github/workflows/evaluate.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ jobs:
125125
})
126126
127127
- name: Checkout pull request
128-
uses: actions/checkout@v4
128+
uses: actions/checkout@v5
129129
with:
130130
ref: refs/pull/${{ github.event.issue.number }}/head
131131

132132
- name: Install uv
133-
uses: astral-sh/setup-uv@v5
133+
uses: astral-sh/setup-uv@v6
134134
with:
135135
enable-cache: true
136136
version: "0.4.20"
@@ -143,7 +143,7 @@ jobs:
143143
node-version: 18
144144

145145
- name: Install azd
146-
uses: Azure/setup-azd@v2.1.0
146+
uses: Azure/setup-azd@v2.2.0
147147

148148
- name: Login to Azure with az CLI
149149
uses: azure/login@v2
@@ -159,7 +159,6 @@ jobs:
159159
az account set --subscription ${{env.AZURE_SUBSCRIPTION_ID}}
160160
161161
- name: Login to with Azure with azd (Federated Credentials)
162-
if: ${{ env.AZURE_CLIENT_ID != '' }}
163162
run: |
164163
azd auth login `
165164
--client-id "$Env:AZURE_CLIENT_ID" `

.github/workflows/frontend.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
prettier:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
1818
- name: Run prettier on frontend
1919
run: |
2020
cd ./app/frontend

.github/workflows/lint-markdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout repo
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v5
1717
- name: Run markdownlint
1818
uses: articulate/actions-markdownlint@v1
1919
with:

.github/workflows/python-test.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,31 @@ on:
1919

2020
jobs:
2121
test_package:
22-
name: Test ${{ matrix.os }} Python ${{ matrix.python_version }}
22+
name: Test ${{ matrix.os }} Python ${{ matrix.python_version }} Node ${{ matrix.node_version }}
2323
runs-on: ${{ matrix.os }}
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
os: ["ubuntu-20.04", "windows-latest"]
27+
os: ["ubuntu-latest", "windows-latest"]
2828
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
29+
node_version: ["20.14", "22"]
2930
steps:
30-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v5
32+
with:
33+
# Fetch full history so diff-cover can compute a merge base with origin/main
34+
fetch-depth: 0
3135
- name: Install uv
32-
uses: astral-sh/setup-uv@v5
36+
uses: astral-sh/setup-uv@v6
3337
with:
3438
enable-cache: true
3539
version: "0.4.20"
3640
cache-dependency-glob: "requirements**.txt"
3741
python-version: ${{ matrix.python_version }}
42+
activate-environment: true
3843
- name: Setup node
3944
uses: actions/setup-node@v4
4045
with:
41-
node-version: 18
46+
node-version: ${{ matrix.node_version }}
4247
- name: Build frontend
4348
run: |
4449
cd ./app/frontend
@@ -59,7 +64,14 @@ jobs:
5964
run: black . --check --verbose
6065
- name: Run Python tests
6166
if: runner.os != 'Windows'
62-
run: pytest -s -vv --cov --cov-fail-under=86
67+
run: pytest -s -vv --cov --cov-report=xml --cov-fail-under=89
68+
- name: Check diff coverage
69+
if: runner.os != 'Windows'
70+
run: |
71+
BASE_REF="${{ github.base_ref }}"
72+
if [ -z "$BASE_REF" ]; then BASE_REF="main"; fi
73+
git fetch origin "$BASE_REF:refs/remotes/origin/$BASE_REF"
74+
diff-cover coverage.xml --compare-branch="origin/$BASE_REF" --fail-under=90
6375
- name: Run E2E tests with Playwright
6476
id: e2e
6577
if: runner.os != 'Windows'

0 commit comments

Comments
 (0)