Skip to content

Commit cbf8e6e

Browse files
Address code review feedback: improve imports and add TODO comments
Co-authored-by: Harmanpreet-Microsoft <175086414+Harmanpreet-Microsoft@users.noreply.github.com>
1 parent b620c17 commit cbf8e6e

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/backend/v4/api/router.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import logging
44
import os
5+
import tempfile
56
import uuid
67
from typing import Optional
78
from datetime import datetime
@@ -35,6 +36,7 @@
3536
WebSocket,
3637
WebSocketDisconnect,
3738
)
39+
from fastapi.responses import FileResponse
3840
from v4.common.services.plan_service import PlanService
3941
from v4.common.services.team_service import TeamService
4042
from v4.config.settings import (
@@ -1469,7 +1471,6 @@ async def generate_branch_report(
14691471
500:
14701472
description: Internal server error
14711473
"""
1472-
from fastapi.responses import FileResponse
14731474

14741475
# Validate user authentication
14751476
authenticated_user = get_authenticated_user_details(request_headers=request.headers)
@@ -1480,8 +1481,8 @@ async def generate_branch_report(
14801481
)
14811482

14821483
try:
1483-
# Create output directory if it doesn't exist
1484-
output_dir = "/tmp/reports"
1484+
# Create output directory if it doesn't exist (platform-independent)
1485+
output_dir = os.path.join(tempfile.gettempdir(), "reports")
14851486
os.makedirs(output_dir, exist_ok=True)
14861487

14871488
# Generate filename with timestamp

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ async def fetch_branches_from_github(github_tools, owner: str, repo: str) -> Lis
3232
List of branch dictionaries
3333
"""
3434
try:
35-
# This would use the actual github_tools in production
36-
# For now, returning empty list as placeholder
35+
# TODO: Integrate with actual GitHub MCP tools when available
36+
# This is a placeholder that returns empty data
37+
# In production, this would call github_tools.list_branches(owner, repo)
3738
logger.info(f"Fetching branches for {owner}/{repo}")
3839
return []
3940
except Exception as e:
@@ -54,8 +55,9 @@ async def fetch_pull_requests_from_github(github_tools, owner: str, repo: str) -
5455
List of pull request dictionaries
5556
"""
5657
try:
57-
# This would use the actual github_tools in production
58-
# For now, returning empty list as placeholder
58+
# TODO: Integrate with actual GitHub MCP tools when available
59+
# This is a placeholder that returns empty data
60+
# In production, this would call github_tools.list_pull_requests(owner, repo)
5961
logger.info(f"Fetching pull requests for {owner}/{repo}")
6062
return []
6163
except Exception as e:

0 commit comments

Comments
 (0)