Skip to content

Commit 38194fb

Browse files
Merge pull request #783 from microsoft/dev-v4
fix: Merging Dev v4 changes to main
2 parents 092af3a + ff6e18d commit 38194fb

53 files changed

Lines changed: 20636 additions & 136 deletions

Some content is hidden

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

.coveragerc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[run]
2+
source = .
3+
omit =
4+
src/mcp_server/*
5+
src/backend/tests/*
6+
src/tests/mcp_server/*
7+
src/tests/agents/*
8+
src/**/__init__.py
9+
tests/e2e-test/*
10+
*/venv/*
11+
*/env/*
12+
*/.pytest_cache/*
13+
*/node_modules/*
14+
15+
[paths]
16+
source =
17+
src/backend
18+
*/site-packages
19+
20+
[report]
21+
exclude_lines =
22+
pragma: no cover
23+
def __repr__
24+
raise AssertionError
25+
raise NotImplementedError

.github/workflows/test.yml

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ on:
44
push:
55
branches:
66
- main
7-
- dev
8-
- demo
9-
- hotfix
7+
- demo-v4
8+
- dev-v4
109
paths:
1110
- 'src/backend/**/*.py'
1211
- 'src/tests/**/*.py'
@@ -24,9 +23,8 @@ on:
2423
- synchronize
2524
branches:
2625
- main
27-
- dev
28-
- demo
29-
- hotfix
26+
- demo-v4
27+
- dev-v4
3028
paths:
3129
- 'src/backend/**/*.py'
3230
- 'src/tests/**/*.py'
@@ -69,25 +67,22 @@ jobs:
6967
- name: Run tests with coverage
7068
if: env.skip_tests == 'false'
7169
run: |
72-
pytest --cov=. --cov-report=term-missing --cov-report=xml \
73-
--ignore=tests/e2e-test/tests \
74-
--ignore=src/backend/tests/test_app.py \
75-
--ignore=src/tests/agents/test_foundry_integration.py \
76-
--ignore=src/tests/mcp_server/test_factory.py \
77-
--ignore=src/tests/mcp_server/test_hr_service.py \
78-
--ignore=src/backend/tests/test_config.py \
79-
--ignore=src/tests/agents/test_human_approval_manager.py \
80-
--ignore=src/backend/tests/test_team_specific_methods.py \
81-
--ignore=src/backend/tests/models/test_messages.py \
82-
--ignore=src/backend/tests/test_otlp_tracing.py \
83-
--ignore=src/backend/tests/auth/test_auth_utils.py
70+
if python -m pytest src/tests/backend/test_app.py --cov=backend --cov-config=.coveragerc -q > /dev/null 2>&1 && \
71+
python -m pytest src/tests/backend --cov=backend --cov-append --cov-report=term --cov-report=xml --cov-config=.coveragerc --ignore=src/tests/backend/test_app.py; then
72+
echo "Tests completed, checking coverage."
73+
if [ -f coverage.xml ]; then
74+
COVERAGE=$(python -c "import xml.etree.ElementTree as ET; tree = ET.parse('coverage.xml'); root = tree.getroot(); print(float(root.attrib.get('line-rate', 0)) * 100)")
75+
echo "Overall coverage: $COVERAGE%"
76+
if (( $(echo "$COVERAGE < 80" | bc -l) )); then
77+
echo "Coverage is below 80%, failing the job."
78+
exit 1
79+
fi
80+
fi
81+
else
82+
echo "No tests found, skipping coverage check."
83+
fi
8484
85-
# - name: Run tests with coverage
86-
# if: env.skip_tests == 'false'
87-
# run: |
88-
# pytest --cov=. --cov-report=term-missing --cov-report=xml --ignore=tests/e2e-test/tests
89-
9085
- name: Skip coverage report if no tests
9186
if: env.skip_tests == 'true'
9287
run: |
93-
echo "Skipping coverage report because no tests were found."
88+
echo "Skipping coverage report because no tests were found."

src/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# src package

src/backend/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# backend package

src/backend/v4/api/router.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ async def plan_approval(
501501
logging.warning(f"Failed to send WebSocket error: {ws_error}")
502502
raise HTTPException(status_code=500, detail="Internal server error")
503503

504+
return None
505+
504506

505507
@app_v4.post("/user_clarification")
506508
async def user_clarification(
@@ -639,6 +641,8 @@ async def user_clarification(
639641
status_code=404, detail="No active plan found for clarification"
640642
)
641643

644+
return None
645+
642646

643647
@app_v4.post("/agent_message")
644648
async def agent_message_user(

src/backend/v4/common/services/team_service.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,6 @@ async def get_team_configuration(
207207
if team_config is None:
208208
return None
209209

210-
# Verify the configuration belongs to the user
211-
# if team_config.user_id != user_id:
212-
# self.logger.warning(
213-
# "Access denied: config %s does not belong to user %s",
214-
# team_id,
215-
# user_id,
216-
# )
217-
# return None
218-
219210
return team_config
220211

221212
except (KeyError, TypeError, ValueError) as e:

src/backend/v4/magentic_agents/common/lifecycle.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,6 @@ async def close(self) -> None:
413413
optionally delete the agent definition here.
414414
"""
415415
try:
416-
# Example optional clean up of an agent id:
417-
# if self._agent and isinstance(self._agent, AzureAIAgentClient) and self._agent._should_delete_agent:
418-
# try:
419-
# if self.client and self._agent.agent_id:
420-
# await self.client.agents.delete_agent(self._agent.agent_id)
421-
# except Exception:
422-
# pass
423416

424417
# Close underlying client via base close
425418
if self._agent and hasattr(self._agent, "close"):

src/frontend/src/components/common/TeamSelector.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -704,18 +704,16 @@ const TeamSelector: React.FC<TeamSelectorProps> = ({
704704
</DialogContent>
705705

706706

707-
{tempSelectedTeam && (
708-
<div className={styles.dialogActions}>
709-
<Button
710-
appearance="primary"
711-
onClick={handleContinue}
712-
disabled={!tempSelectedTeam || selectionLoading}
713-
className={styles.continueButton}
714-
>
715-
{selectionLoading ? 'Selecting...' : 'Continue'}
716-
</Button>
717-
</div>
718-
)}
707+
<div className={styles.dialogActions}>
708+
<Button
709+
appearance="primary"
710+
onClick={handleContinue}
711+
disabled={!tempSelectedTeam || selectionLoading}
712+
className={styles.continueButton}
713+
>
714+
{selectionLoading ? 'Selecting...' : 'Continue'}
715+
</Button>
716+
</div>
719717
</DialogSurface>
720718
</Dialog>
721719

src/frontend/src/components/content/PlanPanelLeft.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { getUserInfoGlobal } from "@/api/config";
2626
import TeamSelector from "../common/TeamSelector";
2727
import { TeamConfig } from "../../models/Team";
2828
import TeamSelected from "../common/TeamSelected";
29-
import TeamService from "@/services/TeamService";
3029

3130
const PlanPanelLeft: React.FC<PlanPanelLefProps> = ({
3231
reloadTasks,
@@ -100,7 +99,7 @@ const PlanPanelLeft: React.FC<PlanPanelLefProps> = ({
10099
}, [loadPlansData, setUserInfo, reloadTasks]);
101100
useEffect(() => {
102101
if (plans) {
103-
const { inProgress, completed } =
102+
const { completed } =
104103
TaskService.transformPlansToTasks(plans);
105104
setCompletedTasks(completed);
106105
}

src/frontend/src/pages/HomePage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { useEffect, useState, useCallback } from 'react';
2-
import { useNavigate } from 'react-router-dom';
32
import {
43
Spinner
54
} from '@fluentui/react-components';

0 commit comments

Comments
 (0)