Skip to content

Commit

Permalink
ReportPortal: Jira ID text to hyperlink
Browse files Browse the repository at this point in the history
  • Loading branch information
jharuda committed Oct 16, 2024
1 parent b86ae7a commit 8245706
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions newa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import re
import sys
import time
import urllib
from collections.abc import Generator
from functools import partial
from pathlib import Path
Expand Down Expand Up @@ -41,7 +42,7 @@
eval_test,
get_url_basename,
render_template,
)
)

JIRA_NONE_ID = '_NO_ISSUE'
STATEDIR_PARENT_DIR = Path('/var/tmp/newa')
Expand Down Expand Up @@ -822,6 +823,7 @@ def cmd_execute(ctx: CLIContext, workers: int, _continue: bool) -> None:
# store all launch uuids for later finishing
launch_list = []
# now we process jobs for each jira_id
jira_url = ctx.settings.jira_url
for jira_id in jira_schedule_job_mapping:
# when --continue the launch was probably already created
# check the 1st job for launch_uuid
Expand All @@ -844,7 +846,10 @@ def cmd_execute(ctx: CLIContext, workers: int, _continue: bool) -> None:
launch_description += '<br><br>'
# add the number of jobs
if not jira_id.startswith(JIRA_NONE_ID):
launch_description += f'{jira_id}: '
issue_url = urllib.parse.urljoin(
jira_url,
f"/browse/{jira_id}")
launch_description += f'[{jira_id}]({issue_url}): '
launch_description += (f'{len(jira_schedule_job_mapping[jira_id])} '
'request(s) in total')
# create the actual launch
Expand Down

0 comments on commit 8245706

Please sign in to comment.