From 82457066d020674a992e0b8cc3c0a3abc766dfd9 Mon Sep 17 00:00:00 2001 From: Jakub Haruda Date: Fri, 11 Oct 2024 00:40:48 +0200 Subject: [PATCH] ReportPortal: Jira ID text to hyperlink --- newa/cli.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/newa/cli.py b/newa/cli.py index a17554c..e5c1b0a 100644 --- a/newa/cli.py +++ b/newa/cli.py @@ -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 @@ -41,7 +42,7 @@ eval_test, get_url_basename, render_template, - ) +) JIRA_NONE_ID = '_NO_ISSUE' STATEDIR_PARENT_DIR = Path('/var/tmp/newa') @@ -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 @@ -844,7 +846,10 @@ def cmd_execute(ctx: CLIContext, workers: int, _continue: bool) -> None: launch_description += '

' # 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