feat(jira): label standalone tests, include round data in submission comments
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

- Tests created without a campaign parent ticket now get a "standalone-test"
  label, so they're identifiable in Jira without cross-referencing Aegis.
- The comment posted on every red/blue submission was a generic one-liner
  with no data — only a reopened round got a full data dump (via
  push_round_archived), so a round that was approved outright left no
  record in Jira of what was actually done. Now every submission comment
  includes the round number, procedure/tool/attack success (red) or
  detection/containment result (blue), and summary.
This commit is contained in:
kitos
2026-07-14 08:37:40 +02:00
parent 6d6f87b968
commit 814cfa9671
2 changed files with 129 additions and 5 deletions
+20 -4
View File
@@ -449,15 +449,26 @@ def _build_state_comment(
elif new_state == "red_review":
lines += [
"Red Team has submitted evidence and the test is awaiting Red Lead review "
"before it queues for Blue Team.",
f"Red Team has submitted evidence for Round {test.red_round_number or 1} and the "
"test is awaiting Red Lead review before it queues for Blue Team.",
"",
f"*Procedure:* {test.procedure_text or 'N/A'}",
f"*Tool used:* {test.tool_used or 'N/A'}",
f"*Attack Success:* {_enum_value(test.attack_success) or 'N/A'}",
]
if test.red_summary:
lines += ["", "h4. Red Team Summary", test.red_summary]
elif new_state == "blue_review":
lines += [
"Blue Team has submitted evidence and the test is awaiting Blue Lead review "
"before cross-validation.",
f"Blue Team has submitted evidence for Round {test.blue_round_number or 1} and the "
"test is awaiting Blue Lead review before cross-validation.",
"",
f"*Detection Result:* {_enum_value(test.detection_result) or 'N/A'}",
f"*Containment Result:* {_enum_value(test.containment_result) or 'N/A'}",
]
if test.blue_summary:
lines += ["", "h4. Blue Team Summary", test.blue_summary]
elif new_state == "blue_evaluating":
lines += [
@@ -707,6 +718,11 @@ def auto_create_test_issue(
if test.platform:
# Jira labels can't contain whitespace — normalize to kebab-case.
labels.append(re.sub(r"[^a-z0-9_-]+", "-", test.platform.lower()).strip("-"))
# No parent_ticket_override means this test isn't nested under a
# campaign ticket — i.e. it's standalone. Tag it so standalone tests
# are identifiable in Jira without cross-referencing Aegis.
if parent_ticket_override is None:
labels.append("standalone-test")
fields: dict = {
"project": {"key": project_key},
"summary": f"[Aegis] {mitre_id}{test.name}",