fix(jira): clear stale assignee on hand-off to blue team / dual validation
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 red_lead reviewer stayed assigned in Jira through blue_evaluating
(and the blue_lead reviewer through in_review) since push_test_event
never touched the assignee on those transitions — only red_executing
and the review gates did. Both are hand-offs with no single owner yet,
so the assignee is cleared instead of left stale.

Also fixes push_bt_work_started never assigning the blue_tech who
actually picks up the queued test — it only moved the status to
In Progress before.
This commit is contained in:
kitos
2026-07-10 16:49:16 +02:00
parent 0fc2427f71
commit 337faf824d
2 changed files with 48 additions and 1 deletions
+25
View File
@@ -859,6 +859,21 @@ def push_test_event(
link.jira_issue_key, jira_account_id, exc_a,
)
# Both are hand-off points to a different team with no single owner
# yet: blue_evaluating is queued for Blue Team (whoever reviewed the
# red side is done with it), and in_review is dual-validation by both
# leads at once. Leaving the previous assignee (red/blue reviewer)
# stuck on the ticket is misleading, so clear it.
if new_state in ("blue_evaluating", "in_review"):
try:
jira.assign_issue(link.jira_issue_key, account_id=None)
logger.info("Unassigned Jira ticket %s (state=%s)", link.jira_issue_key, new_state)
except Exception as exc_a:
logger.warning(
"Could not unassign %s for state %s: %s",
link.jira_issue_key, new_state, exc_a,
)
link.last_synced_at = datetime.utcnow()
db.flush()
logger.info(
@@ -1067,6 +1082,16 @@ def push_bt_work_started(db: Session, test, actor) -> None:
except Exception as exc_t:
logger.warning("Could not transition %s to In Progress: %s", link.jira_issue_key, exc_t)
jira.issue_add_comment(link.jira_issue_key, comment)
jira_account_id = getattr(actor, "jira_account_id", None)
if jira_account_id:
try:
jira.assign_issue(link.jira_issue_key, account_id=jira_account_id)
except Exception as exc_a:
logger.warning(
"Could not assign %s to %s: %s", link.jira_issue_key, jira_account_id, exc_a,
)
link.last_synced_at = datetime.utcnow()
db.flush()
logger.info("Posted blue-team-started event to Jira %s", link.jira_issue_key)