Skip to content

Commit a801e39

Browse files
Merge remote-tracking branch 'origin/dev' into PSL-US-33784
2 parents 1884e21 + d5ad80d commit a801e39

56 files changed

Lines changed: 2861 additions & 2572 deletions

Some content is hidden

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

.github/workflows/test.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ on:
3131
permissions:
3232
contents: read
3333
actions: read
34+
pull-requests: write
3435

3536
jobs:
3637
# frontend_tests:
@@ -106,7 +107,19 @@ jobs:
106107
- name: Run Backend Tests with Coverage
107108
if: env.skip_backend_tests == 'false'
108109
run: |
109-
pytest --cov=. --cov-report=term-missing --cov-report=xml ./src/tests/api
110+
pytest --cov=. --cov-report=term-missing --cov-report=xml --junitxml=pytest.xml ./src/tests/api
111+
112+
- name: Pytest Coverage Comment
113+
if: |
114+
always() &&
115+
github.event_name == 'pull_request' &&
116+
github.event.pull_request.head.repo.fork == false &&
117+
env.skip_backend_tests == 'false'
118+
uses: MishaKav/pytest-coverage-comment@26f986d2599c288bb62f623d29c2da98609e9cd4 # v1.6.0
119+
with:
120+
pytest-xml-coverage-path: coverage.xml
121+
junitxml-path: pytest.xml
122+
report-only-changed-files: true
110123

111124
- name: Skip Backend Tests
112125
if: env.skip_backend_tests == 'true'

documents/LocalDevelopmentSetup.md

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,46 @@ Create `.vscode/settings.json` and copy the following JSON:
293293

294294
---
295295

296+
### Running with Automated Script
297+
298+
For convenience, you can use the provided startup scripts that handle environment setup and start both backend and frontend services automatically. This is the quickest way to get up and running locally.
299+
300+
> **Note**: You must complete **Step 1 (Prerequisites)** and **Step 2 (Development Tools Setup)** before using the automated scripts.
301+
302+
#### Windows (Command Prompt or PowerShell):
303+
304+
```cmd
305+
cd src
306+
.\start.cmd
307+
```
308+
309+
#### macOS/Linux/WSL:
310+
311+
```bash
312+
cd src
313+
chmod +x start.sh
314+
./start.sh
315+
```
316+
317+
### What the Scripts Do
318+
319+
The startup scripts automatically handle:
320+
- Environment variable configuration
321+
- Azure authentication
322+
- Azure RBAC role assignments (Cosmos DB, SQL Server, AI Foundry, AI Search)
323+
- Python virtual environment setup
324+
- Backend dependency installation
325+
- Frontend dependency installation
326+
- Starting both backend and frontend servers
327+
328+
> **Note**: The script includes a 30-second wait for the backend to initialize before starting the frontend. If you see connection errors initially, wait a moment and reload the page.
329+
330+
---
331+
332+
## Running Backend and Frontend Manually
333+
334+
If you prefer more control over the setup process, follow the steps below to configure and run each service individually.
335+
296336
## Step 3: Azure Authentication Setup
297337

298338
Before configuring services, authenticate with Azure:
@@ -385,13 +425,17 @@ az role assignment create \
385425
```
386426

387427
#### Cosmos DB Access
388-
389428
```bash
429+
# Get your principal ID
430+
PRINCIPAL_ID=$(az ad signed-in-user show --query id -o tsv)
431+
390432
# Assign Cosmos DB Built-in Data Contributor role
391-
az role assignment create \
392-
--role "Cosmos DB Built-in Data Contributor" \
393-
--assignee $PRINCIPAL_ID \
394-
--scope "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.DocumentDB/databaseAccounts/<cosmos-account-name>"
433+
az cosmosdb sql role assignment create \
434+
--resource-group <resource-group-name> \
435+
--account-name <cosmos-db-account-name> \
436+
--role-definition-name "Cosmos DB Built-in Data Contributor" \
437+
--principal-id $PRINCIPAL_ID \
438+
--scope /subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.DocumentDB/databaseAccounts/<cosmos-db-account-name>
395439
```
396440

397441
#### Azure Storage Access

infra/main_custom.bicep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,9 @@ module searchServiceUpdate 'br/public:avm/res/search/search-service:0.12.0' = {
857857
]
858858
: []
859859
}
860+
dependsOn: [
861+
searchService
862+
]
860863
}
861864

862865
// ========== Search Service to AI Services Role Assignment ========== //

infra/scripts/run_create_agents_scripts.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ titleAgentName=""
330330
while IFS='=' read -r key value; do
331331
# Skip empty lines or lines without '='
332332
[ -z "$key" ] && continue
333+
# Strip trailing carriage return if present (Windows line endings)
334+
value="${value%$'\r'}"
333335
case "$key" in
334336
conversationAgentName)
335337
conversationAgentName="$value"

src/App/package-lock.json

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"@fluentui/react": "^8.125.4",
88
"@azure/msal-react": "^3.0.23",
99
"@azure/msal-browser": "^4.24.1",
10+
"@reduxjs/toolkit": "^2.6.1",
1011
"@testing-library/jest-dom": "^6.9.0",
1112
"@fluentui/react-icons": "^2.0.317",
1213
"@fluentui/react-components": "^9.72.11",
@@ -27,6 +28,7 @@
2728
"react-d3-cloud": "^1.0.6",
2829
"react-dom": "^18.3.1",
2930
"react-markdown": "^10.1.0",
31+
"react-redux": "^9.1.2",
3032
"react-scripts": "^5.0.1",
3133
"rehype-raw": "^7.0.0",
3234
"remark-gfm": "^4.0.1",

src/App/src/App.css

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
display: flex;
1111
flex-direction: row;
1212
height: calc(100vh - 6vh);
13-
/* height: 94vh; */
1413
gap: var(--gap-base);
1514
margin-inline: var(--margin-base);
1615
}
@@ -31,7 +30,6 @@ body {
3130
.header {
3231
display: flex;
3332
align-items: center;
34-
/* height: 64px; */
3533
height: 6vh;
3634
justify-content: space-between;
3735
background-color: #fff;
@@ -44,14 +42,8 @@ body {
4442
}
4543

4644
.header-title {
47-
/* font-size: 24px; */
4845
color: #242424;
49-
/* font-size: 18px;
50-
font-style: normal;
51-
font-weight: 700;
52-
font-family: "Segoe UI"; */
5346
margin-left: 0.5rem;
54-
/* font-size: 1.1rem; */
5547
}
5648

5749
.header-title span {
@@ -77,20 +69,6 @@ body {
7769
gap: 0.25rem;
7870
}
7971

80-
/* .header button {
81-
height: var(--button-height) !important;
82-
font-size: var(--header-btn-font-size) !important;
83-
} */
84-
85-
/* .header button > span > svg {
86-
width: var(--header-btn-icon-size);
87-
height: var(--header-btn-icon-size);
88-
} */
89-
90-
/* .answerDisclaimerContainer {
91-
margin-top: 3px;
92-
} */
93-
9472
.answerDisclaimer {
9573
font-size: var(--answer-disclaimer-font, 12px);
9674
color: #a0a0a0;

src/App/src/App.test.tsx

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1-
import React from 'react';
2-
import { render, screen } from '@testing-library/react';
3-
import App from './App';
1+
import chatReducer, {
2+
appendMessages,
3+
setGeneratingResponse,
4+
} from "./state/slices/chatSlice";
45

5-
test('renders learn react link', () => {
6-
render(<App />);
7-
const linkElement = screen.getByText(/learn react/i);
8-
expect(linkElement).toBeInTheDocument();
6+
describe("chatSlice", () => {
7+
it("stores chat messages with typed actions", () => {
8+
const initialState = chatReducer(undefined, { type: "@@INIT" });
9+
const loadingState = chatReducer(
10+
initialState,
11+
setGeneratingResponse(true)
12+
);
13+
const nextState = chatReducer(
14+
loadingState,
15+
appendMessages([
16+
{
17+
id: "message-1",
18+
role: "user",
19+
content: "Hello world",
20+
date: "2026-04-10T00:00:00.000Z",
21+
},
22+
])
23+
);
24+
25+
expect(nextState.generatingResponse).toBe(true);
26+
expect(nextState.messages).toHaveLength(1);
27+
expect(nextState.messages[0].content).toBe("Hello world");
28+
});
929
});

0 commit comments

Comments
 (0)