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
+62
View File
@@ -233,6 +233,68 @@ def test_push_test_event_maps_every_state_to_jira_status(
mock_jira.set_issue_status.assert_called_once_with(link.jira_issue_key, expected_status)
@patch("app.services.jira_service.has_admin_jira_configured", return_value=True)
@patch("app.services.jira_service.get_admin_jira_client")
def test_push_test_event_validated_says_both_leads_when_they_agree(mock_get_client, mock_configured, db):
mock_jira = MagicMock()
mock_get_client.return_value = mock_jira
test = _make_test(red_validation_status="approved", blue_validation_status="approved")
link = _make_link(test.id)
db.add(link)
db.commit()
jira_service.push_test_event(db, test, MagicMock(username="alice", jira_account_id=None), "validated")
comment = mock_jira.issue_add_comment.call_args[0][1]
assert "validated* by both leads" in comment
assert "manager" not in comment.lower()
@patch("app.services.jira_service.has_admin_jira_configured", return_value=True)
@patch("app.services.jira_service.get_admin_jira_client")
def test_push_test_event_validated_flags_manager_override_when_leads_disagree(mock_get_client, mock_configured, db):
"""Regression: a disputed test resolved by a manager keeps the leads'
original disagreeing votes — the comment must not claim 'both leads'
agreed, and must carry the manager's own decision/notes."""
mock_jira = MagicMock()
mock_get_client.return_value = mock_jira
test = _make_test(red_validation_status="approved", blue_validation_status="rejected")
link = _make_link(test.id)
db.add(link)
db.commit()
jira_service.push_test_event(
db, test, MagicMock(username="sergio", jira_account_id=None), "validated",
extra={"Manager Decision": "sergio — test rejected"},
)
comment = mock_jira.issue_add_comment.call_args[0][1]
assert "manager's decision" in comment.lower()
assert "both leads" not in comment
assert "Manager Decision:* sergio — test rejected" in comment
@patch("app.services.jira_service.has_admin_jira_configured", return_value=True)
@patch("app.services.jira_service.get_admin_jira_client")
def test_push_test_event_rejected_flags_manager_override_when_leads_disagree(mock_get_client, mock_configured, db):
mock_jira = MagicMock()
mock_get_client.return_value = mock_jira
test = _make_test(red_validation_status="rejected", blue_validation_status="approved")
link = _make_link(test.id)
db.add(link)
db.commit()
jira_service.push_test_event(
db, test, MagicMock(username="sergio", jira_account_id=None), "rejected",
extra={"Manager Decision": "sergio — needs full rework"},
)
comment = mock_jira.issue_add_comment.call_args[0][1]
assert "manager's decision" in comment.lower()
assert "must be reworked" not in comment
assert "Manager Decision:* sergio — needs full rework" in comment
@patch("app.services.jira_service.has_admin_jira_configured", return_value=True)
@patch("app.services.jira_service.get_admin_jira_client")
def test_push_test_event_red_review_comment_includes_round_data(mock_get_client, mock_configured, db):