feat(jira): sync the full Purple Team workflow status to Jira
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
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
Previously only red_executing (-> "In Progress") ever changed the Jira issue's status; every other Aegis transition (red_review, blue_evaluating, blue_review, in_review, validated, rejected, disputed) only posted a comment, leaving the Jira board stuck on whatever status it started with. Expands push_test_event() to a full TestState -> Jira-status table covering the whole lifecycle (To-Do -> In Progress -> RT Test Review -> Queued Blue Team -> In Progress -> Blue Team Test Review -> Validation -> Done/Rejected/Dispute), matching the Purple Team Jira workflow. Adds two new lifecycle hooks that the generic dispatch can't handle correctly: - push_bt_work_started(): blue_evaluating covers both "queued, unclaimed" and "actively being worked" — needs an explicit push when the blue tech clicks Start Evaluation, or it never leaves "Queued Blue Team". - disputed state push: a conflicting lead vote previously produced zero Jira signal at all. Also fills two real gaps: reopen_red_review and reopen_blue_review never synced anything to Jira before. Their target status differs on purpose — reopen_red_review pushes "In Progress" (Aegis resumes the same operator immediately, no re-claim), while reopen_blue_review pushes "Queued Blue Team" (Aegis clears blue_work_started_at, forcing a fresh "Start Evaluation" click) — verified against the actual field-reset behavior in test_entity.py rather than assumed symmetry between the two teams.
This commit is contained in:
@@ -408,6 +408,12 @@ def reopen_red_review(db: Session, test: Test, user: User, notes: str) -> Test:
|
||||
except Exception as e:
|
||||
logger.warning("Notification failed for test %s: %s", test.id, e, exc_info=True)
|
||||
|
||||
try:
|
||||
from app.services.jira_service import push_test_event
|
||||
push_test_event(db, test, user, "red_executing", extra={"notes": notes.strip()})
|
||||
except Exception as e:
|
||||
logger.warning("Jira push failed for test %s: %s", test.id, e, exc_info=True)
|
||||
|
||||
return test
|
||||
|
||||
|
||||
@@ -447,6 +453,12 @@ def start_blue_work(db: Session, test: Test, user: User) -> Test:
|
||||
except Exception as e:
|
||||
logger.warning("Jira BT start date push failed for test %s: %s", test.id, e, exc_info=True)
|
||||
|
||||
try:
|
||||
from app.services.jira_service import push_bt_work_started
|
||||
push_bt_work_started(db, test, user)
|
||||
except Exception as e:
|
||||
logger.warning("Jira push failed for test %s: %s", test.id, e, exc_info=True)
|
||||
|
||||
return test
|
||||
|
||||
|
||||
@@ -601,6 +613,12 @@ def reopen_blue_review(db: Session, test: Test, user: User, notes: str) -> Test:
|
||||
except Exception as e:
|
||||
logger.warning("Notification failed for test %s: %s", test.id, e, exc_info=True)
|
||||
|
||||
try:
|
||||
from app.services.jira_service import push_test_event
|
||||
push_test_event(db, test, user, "blue_evaluating", extra={"notes": notes.strip()})
|
||||
except Exception as e:
|
||||
logger.warning("Jira push failed for test %s: %s", test.id, e, exc_info=True)
|
||||
|
||||
return test
|
||||
|
||||
|
||||
@@ -1122,6 +1140,12 @@ def _dispatch_dual_validation_effects(
|
||||
logger.warning("Jira push failed for test %s: %s", test.id, e, exc_info=True)
|
||||
|
||||
elif event.name == "dual_validation_disputed":
|
||||
if actor:
|
||||
try:
|
||||
from app.services.jira_service import push_test_event
|
||||
push_test_event(db, test, actor, "disputed")
|
||||
except Exception as e:
|
||||
logger.warning("Jira push failed for test %s: %s", test.id, e, exc_info=True)
|
||||
# Notify the lead who APPROVED asking them to review the rejection
|
||||
_notify_validation_conflict(db, test, actor)
|
||||
# Notify managers too, in case the dispute stalls and needs escalation
|
||||
|
||||
Reference in New Issue
Block a user