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

Merge pull request #1416 from adrianschroeter/keep_packages_locked

add support for keep_packages_locked on request revoke
This commit is contained in:
Daniel Mach 2023-10-04 08:49:11 +02:00 committed by GitHub
commit bd14f7e000
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -3044,6 +3044,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
help='non-interactive review of request') help='non-interactive review of request')
@cmdln.option('--exclude-target-project', action='append', @cmdln.option('--exclude-target-project', action='append',
help='exclude target project from request list') help='exclude target project from request list')
@cmdln.option('--keep-packages-locked', action='store_true',
help='Avoid unlocking of packages in maintenance incident when revoking release requests')
@cmdln.option('--incoming', action='store_true', @cmdln.option('--incoming', action='store_true',
help='Show only requests where the project is target') help='Show only requests where the project is target')
@cmdln.option('--involved-projects', action='store_true', @cmdln.option('--involved-projects', action='store_true',
@ -3082,6 +3084,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
"supersede" will supersede one request with another existing one. "supersede" will supersede one request with another existing one.
"revoke" will set the request state to "revoked" "revoke" will set the request state to "revoked"
WARNING: Revoking a maitenance release request unlocks packages in the source project.
To avoid unlocking, use the --keep-packages-locked option.
"accept" will change the request state to "accepted" and will trigger "accept" will change the request state to "accepted" and will trigger
the actual submit process. That would normally be a server-side copy of the actual submit process. That would normally be a server-side copy of
@ -3502,7 +3506,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
opts.message = edit_message(template=tmpl) opts.message = edit_message(template=tmpl)
try: try:
r = change_request_state(apiurl, r = change_request_state(apiurl,
reqid, state_map[cmd], opts.message or '', supersed=supersedid, force=opts.force) reqid, state_map[cmd], opts.message or '', supersed=supersedid, force=opts.force, keep_packages_locked=opts.keep_packages_locked)
print('Result of change request state: %s' % r) print('Result of change request state: %s' % r)
except HTTPError as e: except HTTPError as e:
print(e, file=sys.stderr) print(e, file=sys.stderr)

View File

@ -4726,12 +4726,14 @@ def change_review_state(
return root.get('code') return root.get('code')
def change_request_state(apiurl: str, reqid, newstate, message="", supersed=None, force=False): def change_request_state(apiurl: str, reqid, newstate, message="", supersed=None, force=False, keep_packages_locked=False):
query = {"cmd": "changestate", "newstate": newstate} query = {"cmd": "changestate", "newstate": newstate}
if supersed: if supersed:
query['superseded_by'] = supersed query['superseded_by'] = supersed
if force: if force:
query['force'] = "1" query['force'] = "1"
if keep_packages_locked:
query['keep_packages_locked'] = "1"
u = makeurl(apiurl, u = makeurl(apiurl,
['request', reqid], query=query) ['request', reqid], query=query)
f = http_POST(u, data=message) f = http_POST(u, data=message)