Skip to content

Commit

Permalink
Improve cancellation status setting
Browse files Browse the repository at this point in the history
  • Loading branch information
mbriand committed Oct 17, 2024
1 parent 01784ab commit 32931b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion swattool/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,17 @@ def _prompt_bug_infos(build: swatbuild.Build,


def _create_new_status(build: swatbuild.Build, command: str
) -> userdata.Triage:
) -> Optional[userdata.Triage]:
"""Create new status for a given failure."""
newstatus = userdata.Triage()
if command in ["a", "b"]:
newstatus = _prompt_bug_infos(build, command == "a")
elif command == "c":
if build.status != swatbuild.Status.CANCELLED:
logging.error("Only cancelled builds can be triaged as cancelled")
return None
newstatus.status = swatbotrest.TriageStatus.CANCELLED
newstatus.comment = "Cancelled"
elif command == "m":
newstatus.status = swatbotrest.TriageStatus.MAIL_SENT
elif command == "i" and utils.MAILNAME:
Expand Down

0 comments on commit 32931b0

Please sign in to comment.