Some checks failed
Build and push DevOpsDash / build (push) Has been cancelled
- Taskz kanban board (create/edit tasks, findings, status/priority) - Worklog timeline + standup summary (proxied from DevOpsMCP MCP API) - Knowledge browser (ADRs, memories, knowledge catalog files) - FastAPI backend reading same Redis as DevOpsMCP - Read-only bind-mount for DevOpsMCP data directory (/data) - Nomad job spec (dash.i80.dk, Traefik TLS, host volume read-only) - Gitea Actions CI → registry.i80.dk/gitea/devops-dash:latest
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
"""Worklog router — proxies worklog/standup calls to DevOpsMCP."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Optional
|
|
|
|
from fastapi import APIRouter, HTTPException
|
|
|
|
from app import mcp_client
|
|
|
|
router = APIRouter(prefix="/api/v1", tags=["worklog"])
|
|
|
|
|
|
@router.get("/worklog")
|
|
async def api_worklog(
|
|
context: str = "egmont",
|
|
days: int = 7,
|
|
group_by: str = "repo",
|
|
since_date: Optional[str] = None,
|
|
until_date: Optional[str] = None,
|
|
):
|
|
try:
|
|
return await mcp_client.get_worklog(
|
|
context=context,
|
|
days=days,
|
|
group_by=group_by,
|
|
since_date=since_date,
|
|
until_date=until_date,
|
|
)
|
|
except Exception as exc:
|
|
raise HTTPException(status_code=502, detail=f"DevOpsMCP error: {exc}") from exc
|
|
|
|
|
|
@router.get("/standup")
|
|
async def api_standup(days: int = 2, context: str = "egmont"):
|
|
try:
|
|
return await mcp_client.get_standup(days=days, context=context)
|
|
except Exception as exc:
|
|
raise HTTPException(status_code=502, detail=f"DevOpsMCP error: {exc}") from exc
|