Skip to content

Commit 4bc8d18

Browse files
authored
Merge branch 'main' into copilot/fix-2751
2 parents 5d23055 + b7a2743 commit 4bc8d18

File tree

68 files changed

+2203
-1463
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

+2203
-1463
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Azure Search OpenAI Demo",
3-
"image": "mcr.microsoft.com/devcontainers/python:3.11-bookworm",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.13-bookworm",
44
"features": {
55
"ghcr.io/devcontainers/features/node:1": {
66
// This should match the version of Node.js in Github Actions workflows

.github/dependabot.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,34 @@ updates:
1616
directory: "/app/frontend"
1717
schedule:
1818
interval: "weekly"
19+
# Ignore Vite 7.x for now: Vite >=7 requires Node >=20.19.0 while project engines.node is currently >=20.0.0
20+
ignore:
21+
- dependency-name: "vite"
22+
versions:
23+
- ">=7.0.0"
1924

2025
# Maintain dependencies for pip
2126
- package-ecosystem: "pip"
2227
directory: "/"
2328
schedule:
2429
interval: "weekly"
30+
groups:
31+
telemetry:
32+
patterns:
33+
- "opentelemetry-*"
34+
- "azure-monitor-opentelemetry*"
35+
pydantic:
36+
patterns:
37+
- "pydantic"
38+
- "pydantic-*"
39+
- "typing-extensions"
40+
pallets:
41+
patterns:
42+
- "flask"
43+
- "werkzeug"
44+
- "blinker"
45+
- "quart"
46+
- "jinja2"
47+
- "click"
48+
- "itsdangerous"
49+
- "markupsafe"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
PSRULE_CONFIGURATION_AZURE_BICEP_FILE_EXPANSION_TIMEOUT: '30'
5151

5252
- name: Upload results to security tab
53-
uses: github/codeql-action/upload-sarif@v3
53+
uses: github/codeql-action/upload-sarif@v4
5454
if: github.repository == 'Azure-Samples/azure-search-openai-demo'
5555
with:
5656
sarif_file: reports/ps-rule-results.sarif

.github/workflows/azure-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
uses: Azure/[email protected]
123123

124124
- name: Install Nodejs
125-
uses: actions/setup-node@v5
125+
uses: actions/setup-node@v6
126126
with:
127127
node-version: 20
128128

.github/workflows/evaluate.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ jobs:
124124
ref: refs/pull/${{ github.event.issue.number }}/head
125125

126126
- name: Install uv
127-
uses: astral-sh/setup-uv@v6
127+
uses: astral-sh/setup-uv@v7
128128
with:
129129
enable-cache: true
130-
version: "0.4.20"
130+
version: "0.9.5"
131131
cache-dependency-glob: "requirements**.txt"
132132
python-version: "3.11"
133133

134134
- name: Setup node
135-
uses: actions/setup-node@v5
135+
uses: actions/setup-node@v6
136136
with:
137137
node-version: 20
138138

@@ -192,19 +192,19 @@ jobs:
192192
193193
- name: Upload eval results as build artifact
194194
if: ${{ success() }}
195-
uses: actions/upload-artifact@v4
195+
uses: actions/upload-artifact@v5
196196
with:
197197
name: eval_result
198198
path: ./evals/results/pr${{ github.event.issue.number }}
199199

200200
- name: Upload server logs as build artifact
201-
uses: actions/upload-artifact@v4
201+
uses: actions/upload-artifact@v5
202202
with:
203203
name: server_logs
204204
path: ./app/backend/serverlogs.out
205205

206206
- name: Upload server error logs as build artifact
207-
uses: actions/upload-artifact@v4
207+
uses: actions/upload-artifact@v5
208208
with:
209209
name: server_error_logs
210210
path: ./app/backend/serverlogs.err

.github/workflows/python-test.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
os: ["ubuntu-latest", "windows-latest"]
28-
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
28+
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2929
node_version: ["20.14", "22"]
3030
steps:
3131
- uses: actions/checkout@v5
3232
with:
3333
# Fetch full history so diff-cover can compute a merge base with origin/main
3434
fetch-depth: 0
3535
- name: Install uv
36-
uses: astral-sh/setup-uv@v6
36+
uses: astral-sh/setup-uv@v7
3737
with:
3838
enable-cache: true
39-
version: "0.4.20"
39+
version: "0.9.5"
4040
cache-dependency-glob: "requirements**.txt"
4141
python-version: ${{ matrix.python_version }}
4242
activate-environment: true
4343
- name: Setup node
44-
uses: actions/setup-node@v5
44+
uses: actions/setup-node@v6
4545
with:
4646
node-version: ${{ matrix.node_version }}
4747
- name: Build frontend
@@ -82,7 +82,7 @@ jobs:
8282
pytest tests/e2e.py --tracing=retain-on-failure
8383
- name: Upload test artifacts
8484
if: ${{ failure() && steps.e2e.conclusion == 'failure' }}
85-
uses: actions/upload-artifact@v4
85+
uses: actions/upload-artifact@v5
8686
with:
8787
name: playwright-traces${{ matrix.python_version }}
8888
path: test-results

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- id: end-of-file-fixer
88
- id: trailing-whitespace
99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.9.3
10+
rev: v0.14.2
1111
hooks:
1212
- id: ruff
1313
- repo: https://github.com/psf/black

AGENTS.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,49 @@ When adding a new feature, add tests for it in the appropriate file.
7878
If the feature is a UI element, add an e2e test for it.
7979
If it is an API endpoint, add an app integration test for it.
8080
If it is a function or method, add a unit test for it.
81-
Use mocks from conftest.py to mock external services.
81+
Use mocks from tests/conftest.py to mock external services. Prefer mocking at the HTTP/requests level when possible.
8282

8383
When you're running tests, make sure you activate the .venv virtual environment first:
8484

85-
```bash
85+
```shell
8686
source .venv/bin/activate
8787
```
8888

89+
To check for coverage, run the following command:
90+
91+
```shell
92+
pytest --cov --cov-report=annotate:cov_annotate
93+
```
94+
95+
Open the cov_annotate directory to view the annotated source code. There will be one file per source file. If a file has 100% source coverage, it means all lines are covered by tests, so you do not need to open the file.
96+
97+
For each file that has less than 100% test coverage, find the matching file in cov_annotate and review the file.
98+
99+
If a line starts with a ! (exclamation mark), it means that the line is not covered by tests. Add tests to cover the missing lines.
100+
89101
## Sending pull requests
90102

91103
When sending pull requests, make sure to follow the PULL_REQUEST_TEMPLATE.md format.
104+
105+
## Upgrading dependencies
106+
107+
To upgrade a particular package in the backend, use the following command, replacing `<package-name>` with the name of the package you want to upgrade:
108+
109+
```shell
110+
cd app/backend && uv pip compile requirements.in -o requirements.txt --python-version 3.10 --upgrade-package package-name
111+
```
112+
113+
## Checking Python type hints
114+
115+
To check Python type hints, use the following command:
116+
117+
```shell
118+
cd app/backend && mypy . --config-file=../../pyproject.toml
119+
```
120+
121+
```shell
122+
cd scripts && mypy . --config-file=../pyproject.toml
123+
```
124+
125+
Note that we do not currently enforce type hints in the tests folder, as it would require adding a lot of `# type: ignore` comments to the existing tests.
126+
We only enforce type hints in the main application code and scripts.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ A related option is VS Code Dev Containers, which will open the project in your
131131
1. Install the required tools:
132132

133133
- [Azure Developer CLI](https://aka.ms/azure-dev/install)
134-
- [Python 3.9, 3.10, or 3.11](https://www.python.org/downloads/)
134+
- [Python 3.10, 3.11, 3.12, 3.13, or 3.14](https://www.python.org/downloads/)
135135
- **Important**: Python and the pip package manager must be in the path in Windows for the setup scripts to work.
136136
- **Important**: Ensure you can run `python --version` from console. On Ubuntu, you might need to run `sudo apt install python-is-python3` to link `python` to `python3`.
137137
- [Node.js 20+](https://nodejs.org/download/)

app/backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.11-bullseye
1+
FROM python:3.13-bookworm
22

33
WORKDIR /app
44

0 commit comments

Comments
 (0)