Skip to content

Commit

Permalink
Use a different link in bugs create from private deck jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
calebevans committed Sep 13, 2024
1 parent c11a218 commit ee59058
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/objects/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def __init__(
else:
self.pr_id = ""
self.firewatch_config = firewatch_config
self.is_private_deck = True if gcs_creds_file else False

# Set GCS bucket values
self.gcs_bucket = gcs_bucket
Expand Down
18 changes: 10 additions & 8 deletions src/report/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ def file_jira_issues(
step_name=pair["failure"].step, # type: ignore
failure_type=pair["failure"].failure_type, # type: ignore
classification=pair["rule"].classification, # type: ignore
job_name=job.name, # type: ignore
build_id=job.build_id, # type: ignore
job=job, # type: ignore
failed_test_name=(
pair["failure"].failed_test_name # type: ignore
if firewatch_config.verbose_test_failure_reporting
Expand Down Expand Up @@ -256,8 +255,7 @@ def report_success(self, job: Job, firewatch_config: Configuration) -> None:
project=rule.jira_project,
summary=f"Job {job.name} passed - {date.strftime('%m-%d-%Y')}",
description=self._get_issue_description(
job_name=job.name, # type: ignore
build_id=job.build_id, # type: ignore
job=job, # type: ignore
success_issue=True,
),
issue_type="Story",
Expand Down Expand Up @@ -515,8 +513,7 @@ def _get_file_attachments(

def _get_issue_description(
self,
job_name: str,
build_id: str,
job: Job,
step_name: Optional[str] = None,
failure_type: Optional[str] = None,
classification: Optional[str] = None,
Expand All @@ -539,8 +536,13 @@ def _get_issue_description(
Returns:
str: String object representing the description.
"""
link_line = f"*Prow Job Link:* [{job_name} #{build_id}|https://prow.ci.openshift.org/view/gs/test-platform-results/logs/{job_name}/{build_id}]"
build_id_line = f"*Build ID:* {build_id}"
link_line_base_url = (
"https://qe-private-deck-ci.apps.ci.l2s4.p1.openshiftapps.com/view/gs/qe-private-deck/logs/"
if job.is_private_deck
else "https://prow.ci.openshift.org/view/gs/test-platform-results/logs/"
)
link_line = f"*Prow Job Link:* [{job.name} #{job.build_id}|{link_line_base_url}{job.name}/{job.build_id}]"
build_id_line = f"*Build ID:* {job.build_id}"
firewatch_link_line = f"This {'issue' if success_issue else 'bug'} was filed using [firewatch in OpenShift CI|https://github.com/CSPI-QE/firewatch]"

# If the issue is being created for a failure
Expand Down

0 comments on commit ee59058

Please sign in to comment.