Skip to content

Commit e781652

Browse files
authored
Merge branch 'main' into dependabot/pip/azure-monitor-opentelemetry-1.6.13
2 parents 4d9705a + a318a13 commit e781652

File tree

68 files changed

+2119
-809
lines changed

Some content is hidden

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

68 files changed

+2119
-809
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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', '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

.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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ jobs:
118118
USE_AI_PROJECT: ${{ vars.USE_AI_PROJECT }}
119119
steps:
120120
- name: Checkout
121-
uses: actions/checkout@v4
121+
uses: actions/checkout@v5
122122

123123
- name: Install azd
124-
uses: Azure/setup-azd@v2.1.0
124+
uses: Azure/setup-azd@v2.2.0
125125

126126
- name: Install Nodejs
127127
uses: actions/setup-node@v4

.github/workflows/evaluate.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ 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

@@ -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

.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2929
node_version: ["20.14", "22"]
3030
steps:
31-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v5
3232
- name: Install uv
3333
uses: astral-sh/setup-uv@v6
3434
with:

.github/workflows/validate-markdown.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout Repo
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v5
2323
with:
2424
ref: ${{ github.event.pull_request.head.sha }}
2525
- name: Check broken Paths
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
steps:
3939
- name: Checkout Repo
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@v5
4141
with:
4242
ref: ${{ github.event.pull_request.head.sha }}
4343
- name: Run Check URLs Country Locale
@@ -54,7 +54,7 @@ jobs:
5454
runs-on: ubuntu-latest
5555
steps:
5656
- name: Checkout Repo
57-
uses: actions/checkout@v4
57+
uses: actions/checkout@v5
5858
with:
5959
ref: ${{ github.event.pull_request.head.sha }}
6060
- name: Run Check Broken URLs

.vscode/tasks.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,74 @@
1515
"cwd": "${workspaceFolder}/app"
1616
},
1717
"problemMatcher": []
18+
},
19+
{
20+
"label": "Development",
21+
"dependsOn": [
22+
"Frontend: npm run dev",
23+
"Backend: quart run"
24+
],
25+
"group": {
26+
"kind": "build",
27+
"isDefault": true
28+
}
29+
},
30+
{
31+
"label": "Frontend: npm run dev",
32+
"type": "npm",
33+
"script": "dev",
34+
"isBackground": true,
35+
"options": {
36+
"cwd": "${workspaceFolder}/app/frontend"
37+
},
38+
"presentation": {
39+
"reveal": "always",
40+
"group": "buildWatchers",
41+
"panel": "dedicated",
42+
"clear": false
43+
},
44+
"problemMatcher": {
45+
"pattern": {
46+
"regexp": ""
47+
},
48+
"background": {
49+
"activeOnStart": true,
50+
"beginsPattern": ".*VITE v.*",
51+
"endsPattern": ".*(?:➜\\s*)?Local:\\s+https?://.*"
52+
}
53+
}
54+
},
55+
{
56+
"label": "Backend: quart run",
57+
"type": "shell",
58+
"command": "${workspaceFolder}/.venv/bin/python",
59+
"windows": {
60+
"command": "${workspaceFolder}\\.venv\\Scripts\\python.exe"
61+
},
62+
"args": ["-m", "quart", "run", "--reload", "-p", "50505"],
63+
"options": {
64+
"cwd": "${workspaceFolder}/app/backend",
65+
"env": {
66+
"QUART_APP": "main:app",
67+
"QUART_ENV": "development",
68+
"QUART_DEBUG": "0",
69+
"LOADING_MODE_FOR_AZD_ENV_VARS": "override"
70+
}
71+
},
72+
"isBackground": true,
73+
"presentation": {
74+
"reveal": "always",
75+
"group": "buildWatchers",
76+
"panel": "dedicated"
77+
},
78+
"problemMatcher": {
79+
"pattern": { "regexp": "" },
80+
"background": {
81+
"activeOnStart": true,
82+
"beginsPattern": ".*Serving Quart app.*",
83+
"endsPattern": ".*hypercorn.*Running on http://.*"
84+
}
85+
}
1886
}
1987
]
2088
}

0 commit comments

Comments
 (0)