Skip to content

Commit 32931b0

Browse files
committed
Improve cancellation status setting
1 parent 01784ab commit 32931b0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

swattool/review.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,17 @@ def _prompt_bug_infos(build: swatbuild.Build,
6262

6363

6464
def _create_new_status(build: swatbuild.Build, command: str
65-
) -> userdata.Triage:
65+
) -> Optional[userdata.Triage]:
6666
"""Create new status for a given failure."""
6767
newstatus = userdata.Triage()
6868
if command in ["a", "b"]:
6969
newstatus = _prompt_bug_infos(build, command == "a")
7070
elif command == "c":
71+
if build.status != swatbuild.Status.CANCELLED:
72+
logging.error("Only cancelled builds can be triaged as cancelled")
73+
return None
7174
newstatus.status = swatbotrest.TriageStatus.CANCELLED
75+
newstatus.comment = "Cancelled"
7276
elif command == "m":
7377
newstatus.status = swatbotrest.TriageStatus.MAIL_SENT
7478
elif command == "i" and utils.MAILNAME:

0 commit comments

Comments
 (0)