Skip to content

Commit

Permalink
Merge pull request #1416 from adrianschroeter/keep_packages_locked
Browse files Browse the repository at this point in the history
add support for keep_packages_locked on request revoke
  • Loading branch information
dmach committed Oct 4, 2023
2 parents 11c2140 + f6cb228 commit bd14f7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion osc/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3044,6 +3044,8 @@ def do_changedevelrequest(self, subcmd, opts, *args):
help='non-interactive review of request')
@cmdln.option('--exclude-target-project', action='append',
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',
help='Show only requests where the project is target')
@cmdln.option('--involved-projects', action='store_true',
Expand Down Expand Up @@ -3082,6 +3084,8 @@ def do_request(self, subcmd, opts, *args):
"supersede" will supersede one request with another existing one.
"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
the actual submit process. That would normally be a server-side copy of
Expand Down Expand Up @@ -3502,7 +3506,7 @@ def do_request(self, subcmd, opts, *args):
opts.message = edit_message(template=tmpl)
try:
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)
except HTTPError as e:
print(e, file=sys.stderr)
Expand Down
4 changes: 3 additions & 1 deletion osc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4726,12 +4726,14 @@ def change_review_state(
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}
if supersed:
query['superseded_by'] = supersed
if force:
query['force'] = "1"
if keep_packages_locked:
query['keep_packages_locked'] = "1"
u = makeurl(apiurl,
['request', reqid], query=query)
f = http_POST(u, data=message)
Expand Down

0 comments on commit bd14f7e

Please sign in to comment.