fix(tempo,jira,tests,ui): fix 4 pending issues
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled

- tempo: remove unsupported `workType` kwarg from create_worklog call;
  tempoapiclient v4 does not accept it → was causing every Tempo sync to fail
- tests: set created_at=datetime.utcnow() explicitly on test creation (both
  create_test and create_test_from_template) since the DB column has no
  server default, causing 'Created —' in the UI
- jira: remove duplicate Proof of Concept section from ticket description body;
  PoC already lives in customfield_10309, no need to repeat it in description
- ui: add TestPhaseTimeline component (read-only) showing RT execution time,
  blue queue time, blue evaluation time and lead validation timestamps derived
  from test phase timestamps; placed above WorklogTimeline in test detail page

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
kitos
2026-05-28 11:38:29 +02:00
parent 7111debd8f
commit 0955f35015
5 changed files with 261 additions and 16 deletions

View File

@@ -219,9 +219,6 @@ def _build_test_description(test: Test, technique: Optional[Technique]) -> str:
"h3. Description",
test.description or "_No description provided._",
"",
"h3. Proof of Concept",
f"{{code}}{test.procedure_text or 'N/A'}{{code}}",
"",
f"*Tool:* {test.tool_used or 'N/A'}",
"",
"----",

View File

@@ -69,21 +69,16 @@ def log_worklog(
date: str,
time_spent_seconds: int,
description: str,
work_type: str | None = None,
) -> dict:
"""Create a worklog entry in Tempo using *user*'s personal token."""
tempo = get_user_tempo_client(user)
kwargs: dict = {
"accountId": author_account_id,
"issueId": jira_issue_id,
"dateFrom": date,
"timeSpentSeconds": time_spent_seconds,
"description": description,
}
wt = work_type or settings.TEMPO_DEFAULT_WORK_TYPE
if wt:
kwargs["workType"] = wt
return tempo.create_worklog(**kwargs)
return tempo.create_worklog(
accountId=author_account_id,
issueId=jira_issue_id,
dateFrom=date,
timeSpentSeconds=time_spent_seconds,
description=description,
)
def auto_log_test_worklog(

View File

@@ -5,6 +5,7 @@ The router is responsible for HTTP concerns, auth, audit logging, and commit.
"""
import uuid
from datetime import datetime
from typing import Any
from sqlalchemy.orm import Session, joinedload
@@ -78,6 +79,7 @@ def create_test(
technique_id=technique_id,
created_by=creator_id,
state=TestState.draft,
created_at=datetime.utcnow(), # explicit — DB column has no server default
**fields,
)
db.add(test)
@@ -127,6 +129,7 @@ def create_test_from_template(
remediation_steps=template.suggested_remediation,
created_by=creator_id,
state=TestState.draft,
created_at=datetime.utcnow(), # explicit — DB column has no server default
)
db.add(test)
db.flush()