Skip to content

Commit 0fe85fa

Browse files
committed
Add label if job is re-trigger
1 parent b6d9844 commit 0fe85fa

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/report/report.py

+21
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ def __init__(self, firewatch_config: Configuration, job: Job) -> None:
3939

4040
exit(0)
4141

42+
# If job is retrigger
43+
if job.is_retriggered:
44+
self.logger.info(f"Adding retrigger label to issue: {job.name}")
45+
self.add_retrigger_job_label(jira=firewatch_config.jira, issue_id=job.name)
46+
4247
bugs_filed = None
4348
bugs_updated = None
4449
# If job has failures, file bugs
@@ -390,6 +395,22 @@ def add_passing_job_label(self, jira: Jira, issue_id: str) -> None:
390395
labels=[JOB_PASSED_SINCE_TICKET_CREATED_LABEL],
391396
)
392397

398+
def add_retrigger_job_label(self, jira: Jira, issue_id: str) -> None:
399+
"""
400+
Used to add a label on a Jira issue that the latest build is retrigger of job.
401+
402+
Args:
403+
jira (Jira): Jira object.
404+
issue_id (str): Issue ID of the open issue to comment on.
405+
406+
Returns:
407+
None
408+
"""
409+
jira.add_labels_to_issue(
410+
issue_id_or_key=issue_id,
411+
labels=["RETRIGGER_JOB"],
412+
)
413+
393414
def add_duplicate_comment(
394415
self,
395416
issue_id: str,

0 commit comments

Comments
 (0)