fix(jira,tests): clarify manager-resolved disputes in Jira and the Summary tab
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled

The validated/rejected Jira comment always said 'by both leads' and
never carried the manager's own notes, even when a manager had just
overridden two disagreeing votes — misleading, since that combination
of statuses is only reachable via a manager decision. Now detected
from the disagreement itself and worded accordingly, with the
manager's notes included via the existing extra-data mechanism.

Also reworks the Summary tab: Final Result moves to the top (was the
very last thing on the page) and now shows Containment alongside
Detection — previously the only place Containment appeared at all was
inside the editable Blue tab. Both team cards now show the validating
lead's notes, not just the approved/rejected badge, and flag when a
manager's decision resolved a disagreement between the two leads.
This commit is contained in:
kitos
2026-07-15 15:26:00 +02:00
parent 09553f5c42
commit 68ab6406d4
4 changed files with 163 additions and 30 deletions
+11 -5
View File
@@ -1147,9 +1147,14 @@ def check_dual_validation(db: Session, test: Test) -> Test:
# Define function _dispatch_dual_validation_effects
def _dispatch_dual_validation_effects(
db: Session, test: Test, entity: TestEntity, actor: User | None = None
db: Session, test: Test, entity: TestEntity, actor: User | None = None,
extra: dict | None = None,
) -> None:
"""Dispatch side effects (notifications, cache, Jira) based on domain events."""
"""Dispatch side effects (notifications, cache, Jira) based on domain events.
``extra`` is forwarded onto the Jira comment (e.g. a manager's decision
notes) — see ``push_test_event``'s ``extra`` kwarg.
"""
for event in entity.events:
# Check: event.name == "dual_validation_approved"
if event.name == "dual_validation_approved":
@@ -1178,7 +1183,7 @@ def _dispatch_dual_validation_effects(
if actor:
try:
from app.services.jira_service import push_test_event
push_test_event(db, test, actor, "validated")
push_test_event(db, test, actor, "validated", extra=extra)
except Exception as e:
logger.warning("Jira push failed for test %s: %s", test.id, e, exc_info=True)
@@ -1198,7 +1203,7 @@ def _dispatch_dual_validation_effects(
if actor:
try:
from app.services.jira_service import push_test_event
push_test_event(db, test, actor, "rejected")
push_test_event(db, test, actor, "rejected", extra=extra)
except Exception as e:
logger.warning("Jira push failed for test %s: %s", test.id, e, exc_info=True)
@@ -1364,7 +1369,8 @@ def resolve_dispute_by_manager(db: Session, test: Test, user: User, outcome: str
details={"outcome": outcome, "notes": notes, "test_name": test.name},
)
_dispatch_dual_validation_effects(db, test, entity, actor=user)
jira_extra = {"Manager Decision": f"{user.username}" + (f"{notes}" if notes else "")}
_dispatch_dual_validation_effects(db, test, entity, actor=user, extra=jira_extra)
# Let both leads know the manager made the final call, not just whichever
# side "won" — the losing side needs to know just as much.