Skip to content

Commit 43e6ec1

Browse files
committed
Links to TF requests in RP
1 parent 376ae7f commit 43e6ec1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

newa/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ class Settings:
150150
rp_token: str = ''
151151
rp_project: str = ''
152152
rp_test_param_filter: str = ''
153+
rp_launch_descr_chars_limit: str = ''
153154
jira_url: str = ''
154155
jira_token: str = ''
155156
jira_project: str = ''
@@ -204,6 +205,10 @@ def _str_to_bool(value: str) -> bool:
204205
cp,
205206
'reportportal/test_param_filter',
206207
'NEWA_REPORTPORTAL_TEST_PARAM_FILTER'),
208+
rp_launch_descr_chars_limit=_get(
209+
cp,
210+
'reportportal/launch_descr_chars_limit',
211+
'NEWA_REPORTPORTAL_LAUNCH_DESCR_CHARS_LIMIT'),
207212
jira_project=_get(
208213
cp,
209214
'jira/project',

newa/cli.py

+8
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,14 @@ def cmd_execute(
12061206
# small sleep to avoid race conditions inside tmt code
12071207
time.sleep(0.1)
12081208

1209+
rp_chars_limit = ctx.settings.rp_launch_descr_chars_limit or 1024
1210+
rp_launch_descr_updated = launch_description + "\n"
1211+
for execute_job in ctx.load_execute_jobs('execute-'):
1212+
req_link = f"[{execute_job.request.id}]({execute_job.execution.request_api})\n"
1213+
if len(req_link) + len(rp_launch_descr_updated) < rp_chars_limit:
1214+
rp_launch_descr_updated += req_link
1215+
rp.update_launch(launch_uuid, description=rp_launch_descr_updated)
1216+
12091217
ctx.logger.info('Finished execution')
12101218

12111219
# let's keep the RP lauch unfinished when using --no-wait

0 commit comments

Comments
 (0)