1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 01:06:17 +02:00

Merge branch 'print_additional_APIURL_links' of https://github.com/lethliel/osc

Add a "print_web_links" option. If enabled, a webui url is printed after
certain operations. For now, it is only used in "do_submitrequest" in order
to print the webui url that can be used to view the newly created request
(note: the print_web_links option is not considered in the "cd prj; osc sr"
case).
This commit is contained in:
Marcus Huewe 2020-02-06 21:26:20 +01:00
commit 4d0c9f2dc6
2 changed files with 11 additions and 1 deletions

View File

@ -1460,7 +1460,15 @@ Please submit there instead, or use --nodevelproject to force direct submission.
dst_project, dst_package,
opts.message, orev=rev,
src_update=src_update, dst_updatelink=opts.update_link)
print('created request id', result)
if conf.config['print_web_links']:
root = ET.fromstring(b''.join(show_configuration(apiurl)))
node = root.find('obs_url')
if node is None or not node.text:
raise oscerr.APIError('obs_url configuration element expected')
obs_url = node.text
print('%s/request/show/%s' % (obs_url, result))
if supersede_existing:
for req in reqs:

View File

@ -151,6 +151,8 @@ DEFAULTS = {'apiurl': 'https://api.opensuse.org',
'exclude_glob': '.osc CVS .svn .* _linkerror *~ #*# *.orig *.bak *.changes.vctmp.*',
# whether to keep passwords in plaintext (deprecated (see creds manager)).
'plaintext_passwd': '0',
# whether to print Web UI links to directly insert in browser (where possible)
'print_web_links': '0',
# limit the age of requests shown with 'osc req list'.
# this is a default only, can be overridden by 'osc req list -D NNN'
# Use 0 for unlimted.
@ -198,7 +200,7 @@ boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'tr
'checkout_no_colon', 'checkout_rooted', 'check_for_request_on_action', 'linkcontrol', 'show_download_progress', 'request_show_interactive',
'request_show_source_buildstatus', 'review_inherit_group', 'use_keyring', 'gnome_keyring', 'no_verify', 'builtin_signature_check',
'http_full_debug', 'include_request_from_project', 'local_service_run', 'buildlog_strip_time', 'no_preinstallimage',
'status_mtime_heuristic']
'status_mtime_heuristic', 'print_web_links']
integer_opts = ['build-jobs']
api_host_options = ['user', 'pass', 'passx', 'aliases', 'http_headers', 'realname', 'email', 'sslcertck', 'cafile', 'capath', 'trusted_prj']