1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-27 07:06:13 +01:00

Merge pull request #828 from lethliel/implement_normal_release_request

implement releaserequest for non-maintenance prj
This commit is contained in:
Marco Strigl 2020-08-07 09:44:46 +02:00 committed by GitHub
commit 568cb38e3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 7 deletions

View File

@ -3107,18 +3107,30 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('-m', '--message', metavar='TEXT', @cmdln.option('-m', '--message', metavar='TEXT',
help='specify message TEXT') help='specify message TEXT')
@cmdln.option('-p', '--package', metavar='PKG', action='append',
help='specify packages to release')
def do_releaserequest(self, subcmd, opts, *args): def do_releaserequest(self, subcmd, opts, *args):
"""${cmd_name}: Create a request for releasing a maintenance update. """${cmd_name}: Create a release request
[See http://openbuildservice.org/help/manuals/obs-reference-guide/cha.obs.maintenance_setup.html For maintenance incident projects:
for information on this topic.]
This command is used by the maintenance team to start the release process of a maintenance update. This command is used by the maintenance team to start the release process of a maintenance update.
This includes usually testing based on the defined reviewers of the update project. This includes usually testing based on the defined reviewers of the update project.
[See https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.maintenance_setup.html
for information on this topic.]
For normal projects:
This command is used to transfer sources and binaries without rebuilding them.
It requires defined release targets set to trigger="manual".
[See https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.request_and_review_system.html
for information on this topic.]
usage: usage:
osc releaserequest [ SOURCEPROJECT ] osc releaserequest [-p package] [ SOURCEPROJECT ]
${cmd_option_list} ${cmd_option_list}
""" """
@ -3140,12 +3152,25 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if len(args) > 0: if len(args) > 0:
source_project = args[0] source_project = args[0]
f = show_project_meta(apiurl, source_project)
root = ET.fromstring(b''.join(f))
if not opts.message: if not opts.message:
opts.message = edit_message() opts.message = edit_message()
else: else:
opts.message = str(opts.message.encode().decode('unicode_escape')) opts.message = str(opts.message.encode().decode('unicode_escape'))
r = create_release_request(apiurl, source_project, opts.message) if 'kind' in root.attrib and root.attrib['kind'] == 'maintenance_incident':
r = create_release_request(apiurl, source_project, opts.message)
else:
r = Request()
if opts.package:
for pac in opts.package:
r.add_action('release', src_project=source_project, src_package=pac)
else:
r.add_action('release', src_project=source_project)
r.description = _html_escape(opts.message)
r.create(apiurl)
print(r.reqid) print(r.reqid)

View File

@ -2676,6 +2676,9 @@ class Action:
'maintenance_release': ('src_project', 'src_package', 'src_rev', 'tgt_project', 'tgt_package', 'person_name', 'maintenance_release': ('src_project', 'src_package', 'src_rev', 'tgt_project', 'tgt_package', 'person_name',
'acceptinfo_rev', 'acceptinfo_srcmd5', 'acceptinfo_xsrcmd5', 'acceptinfo_osrcmd5', 'acceptinfo_rev', 'acceptinfo_srcmd5', 'acceptinfo_xsrcmd5', 'acceptinfo_osrcmd5',
'acceptinfo_oxsrcmd5', 'acceptinfo_oproject', 'acceptinfo_opackage'), 'acceptinfo_oxsrcmd5', 'acceptinfo_oproject', 'acceptinfo_opackage'),
'release': ('src_project', 'src_package', 'src_rev', 'tgt_project', 'tgt_package', 'person_name',
'acceptinfo_rev', 'acceptinfo_srcmd5', 'acceptinfo_xsrcmd5', 'acceptinfo_osrcmd5',
'acceptinfo_oxsrcmd5', 'acceptinfo_oproject', 'acceptinfo_opackage', 'tgt_repository'),
'maintenance_incident': ('src_project', 'src_package', 'src_rev', 'tgt_project', 'tgt_package', 'tgt_releaseproject', 'person_name', 'opt_sourceupdate', 'opt_makeoriginolder', 'maintenance_incident': ('src_project', 'src_package', 'src_rev', 'tgt_project', 'tgt_package', 'tgt_releaseproject', 'person_name', 'opt_sourceupdate', 'opt_makeoriginolder',
'acceptinfo_rev', 'acceptinfo_srcmd5', 'acceptinfo_xsrcmd5', 'acceptinfo_osrcmd5', 'acceptinfo_rev', 'acceptinfo_srcmd5', 'acceptinfo_xsrcmd5', 'acceptinfo_osrcmd5',
'acceptinfo_oxsrcmd5'), 'acceptinfo_oxsrcmd5'),
@ -2935,7 +2938,7 @@ class Request:
srcupdate = ' ' srcupdate = ' '
if action.opt_sourceupdate and show_srcupdate: if action.opt_sourceupdate and show_srcupdate:
srcupdate = '(%s)' % action.opt_sourceupdate srcupdate = '(%s)' % action.opt_sourceupdate
elif action.type == 'maintenance_release': elif action.type in ('maintenance_release', 'release'):
d['source'] = '%s' % prj_pkg_join(action.src_project, action.src_package) d['source'] = '%s' % prj_pkg_join(action.src_project, action.src_package)
if action.src_rev: if action.src_rev:
d['source'] = d['source'] + '@%s' % action.src_rev d['source'] = d['source'] + '@%s' % action.src_rev