Skip to content

Commit 01a287f

Browse files
committed
Merge from main
2 parents 2fc9594 + 4b3f88f commit 01a287f

File tree

76 files changed

+1483
-306
lines changed

Some content is hidden

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

76 files changed

+1483
-306
lines changed

.devcontainer/devcontainer.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
"version": "18",
1717
"nodeGypDependencies": false
1818
},
19-
"ghcr.io/azure/azure-dev/azd:latest": {},
20-
// Required for azd to package the app to ACA
21-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
22-
"ghcr.io/prulloac/devcontainer-features/ollama:1": {}
19+
"ghcr.io/azure/azure-dev/azd:latest": {
20+
"version": "1.10.3"
21+
},
22+
"ghcr.io/prulloac/devcontainer-features/ollama:1": {},
23+
// az CLI is helpful for being able to login correctly with DefaultAzureCredential:
24+
"ghcr.io/devcontainers/features/azure-cli": {}
2325
},
2426
// Configure tool-specific properties.
2527
"customizations": {
@@ -46,10 +48,6 @@
4648
"source.fixAll": "explicit"
4749
},
4850
"editor.defaultFormatter": "charliermarsh.ruff"
49-
},
50-
"files.exclude": {
51-
".ruff_cache": true,
52-
".pytest_cache": true
5351
}
5452
}
5553
}

.env.sample

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ OPENAI_EMBED_HOST=azure
1313
# You also need to `azd auth login` if running this locally
1414
AZURE_OPENAI_ENDPOINT=https://YOUR-AZURE-OPENAI-SERVICE-NAME.openai.azure.com
1515
AZURE_OPENAI_VERSION=2024-03-01-preview
16-
AZURE_OPENAI_CHAT_DEPLOYMENT=gpt-35-turbo
17-
AZURE_OPENAI_CHAT_MODEL=gpt-35-turbo
16+
AZURE_OPENAI_CHAT_DEPLOYMENT=gpt-4o-mini
17+
AZURE_OPENAI_CHAT_MODEL=gpt-4o-mini
1818
AZURE_OPENAI_EMBED_DEPLOYMENT=text-embedding-ada-002
1919
AZURE_OPENAI_EMBED_MODEL=text-embedding-ada-002
20-
AZURE_OPENAI_EMBED_MODEL_DIMENSIONS=1536
20+
AZURE_OPENAI_EMBED_DIMENSIONS=1536
2121
AZURE_OPENAI_EMBEDDING_COLUMN=embedding_ada002
22+
AZURE_OPENAI_EVAL_DEPLOYMENT=gpt-4
23+
AZURE_OPENAI_EVAL_MODEL=gpt-4
24+
AZURE_TENANT_ID=
2225
# Only needed when using key-based Azure authentication:
2326
AZURE_OPENAI_KEY=
2427
# Needed for OpenAI.com:

.github/workflows/app-tests.yaml

100755100644
Lines changed: 74 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ name: App Tests
33
on:
44
push:
55
branches: [ main ]
6+
paths-ignore:
7+
- "**.md"
8+
- ".azdo/**"
9+
- ".devcontainer/**"
10+
- ".github/**"
611
pull_request:
712
branches: [ main ]
13+
paths-ignore:
14+
- "**.md"
15+
- ".azdo/**"
16+
- ".devcontainer/**"
17+
- ".github/**"
818
workflow_dispatch:
919

1020
permissions:
@@ -17,68 +27,110 @@ jobs:
1727
strategy:
1828
fail-fast: false
1929
matrix:
20-
os: ["ubuntu-latest", "windows-latest", "macos-latest-xlarge", "macos-13"]
21-
python_version: ["3.10", "3.11", "3.12"]
30+
os: ["ubuntu-latest", "macos-latest-xlarge", "macos-13", "windows-latest"]
31+
python_version: ["3.10"]
2232
exclude:
2333
- os: macos-latest-xlarge
2434
python_version: "3.10"
35+
env:
36+
UV_SYSTEM_PYTHON: 1
37+
POSTGRES_HOST: localhost
38+
POSTGRES_USERNAME: postgres
39+
POSTGRES_PASSWORD: root
40+
POSTGRES_DATABASE: postgres
41+
POSTGRES_SSL: disable
2542
steps:
2643
- uses: actions/checkout@v4
27-
- name: Check for MacOS Runner
28-
if: matrix.os == 'macos-latest-xlarge'
29-
run: brew install postgresql@14
30-
- name: Install pgvector on Windows using install-pgvector.bat
44+
45+
- name: (MacOS) Install postgreSQL and pgvector using brew
46+
if: matrix.os == 'macos-13' || matrix.os == 'macos-latest-xlarge'
47+
run: |
48+
brew install postgresql@14
49+
brew link --overwrite postgresql@14
50+
brew install pgvector
51+
brew services start postgresql@14 && sleep 1
52+
createuser -s ${{ env.POSTGRES_USERNAME }}
53+
psql -d postgres -c "ALTER USER ${{ env.POSTGRES_USERNAME }} WITH PASSWORD '${{ env.POSTGRES_PASSWORD }}'"
54+
psql -d postgres -c 'CREATE EXTENSION vector'
55+
56+
- name: Install pgvector
3157
if: matrix.os == 'windows-latest'
3258
shell: cmd
33-
run: .github\workflows\install-pgvector.bat
34-
- name: Install PostgreSQL development libraries
59+
run: |
60+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
61+
cd %TEMP%
62+
git clone --branch v0.7.4 https://github.com/pgvector/pgvector.git
63+
cd pgvector
64+
nmake /NOLOGO /F Makefile.win
65+
nmake /NOLOGO /F Makefile.win install
66+
sc config postgresql-x64-14 start=auto
67+
net start postgresql-x64-14
68+
"%PGBIN%/psql" -d postgres -c "CREATE EXTENSION vector"
69+
70+
- name: (Linux) Install pgvector and set password
3571
if: matrix.os == 'ubuntu-latest'
3672
run: |
37-
sudo apt update
38-
sudo apt install postgresql-server-dev-14
39-
- name: Setup postgres
40-
uses: ikalnytskyi/action-setup-postgres@v6
41-
with:
42-
username: admin
43-
password: postgres
44-
database: postgres
45-
- name: Install pgvector on MacOS/Linux using install-pgvector.sh
46-
if: matrix.os != 'windows-latest'
47-
run: .github/workflows/install-pgvector.sh
73+
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
74+
sudo apt-get install postgresql-14-pgvector
75+
sudo systemctl start postgresql
76+
sudo -u postgres psql -c "ALTER USER ${{ env.POSTGRES_USERNAME }} PASSWORD '${{ env.POSTGRES_PASSWORD }}'"
77+
sudo -u postgres psql -c 'CREATE EXTENSION vector'
78+
4879
- name: Setup python
4980
uses: actions/setup-python@v5
5081
with:
5182
python-version: ${{ matrix.python_version }}
5283
architecture: x64
84+
85+
- name: Install uv
86+
uses: astral-sh/setup-uv@v3
87+
with:
88+
enable-cache: true
89+
version: "0.4.20"
90+
cache-dependency-glob: "requirements**.txt"
91+
5392
- name: Install dependencies
5493
run: |
55-
python -m pip install -r requirements-dev.txt
94+
uv pip install -r requirements-dev.txt
95+
5696
- name: Install app as editable app
5797
run: |
58-
python -m pip install -e src/backend
98+
uv pip install -e src/backend
99+
59100
- name: Setup local database with seed data
60101
run: |
61-
cp .env.sample .env
62102
python ./src/backend/fastapi_app/setup_postgres_database.py
63103
python ./src/backend/fastapi_app/setup_postgres_seeddata.py
104+
64105
- name: Setup node
65106
uses: actions/setup-node@v4
66107
with:
67108
node-version: 18
109+
68110
- name: Build frontend
69111
run: |
70112
cd ./src/frontend
71113
npm install
72114
npm run build
115+
116+
- name: Setup mypy cache
117+
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
118+
with:
119+
path: ./.mypy_cache
120+
key: mypy${{ matrix.os }}-${{ matrix.python_version }}-${{ hashFiles('requirements-dev.txt', 'src/backend/requirements.txt', 'src/backend/pyproject.toml') }}
121+
73122
- name: Run MyPy
74123
run: python3 -m mypy .
124+
75125
- name: Run Pytest
76126
run: python3 -m pytest -s -vv --cov --cov-fail-under=85
127+
77128
- name: Run E2E tests with Playwright
78129
id: e2e
79130
run: |
80131
playwright install chromium --with-deps
81132
python3 -m pytest tests/e2e.py --tracing=retain-on-failure
133+
82134
- name: Upload test artifacts
83135
if: ${{ failure() && steps.e2e.conclusion == 'failure' }}
84136
uses: actions/upload-artifact@v4

.github/workflows/azure-dev.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Deploy with azd
33
on:
44
workflow_dispatch:
55
push:
6-
branches:
7-
- main
6+
branches: [ main ]
87

98
# GitHub Actions workflow to deploy to Azure using azd
109
# To configure required secrets for connecting to Azure, simply run `azd pipeline config`

.github/workflows/bicep-security-scan.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222
- name: Build Bicep for linting
2323
uses: azure/CLI@v2
2424
with:
25-
inlineScript: az config set bicep.use_binary_from_path=false && az bicep build -f infra/main.bicep --stdout
25+
inlineScript: |
26+
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
27+
az config set bicep.use_binary_from_path=false && az bicep build -f infra/main.bicep --stdout
2628
2729
- name: Run Microsoft Security DevOps Analysis
2830
uses: microsoft/security-devops-action@preview

0 commit comments

Comments
 (0)