mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-02 09:46:16 +01:00
- display request priorities, if important or critical
- add "osc rq priorize" command to re-priorize existing requests - allow also "osc rq ls" shortcut
This commit is contained in:
parent
b0479fa760
commit
bd82e236ee
3
NEWS
3
NEWS
@ -1,5 +1,8 @@
|
|||||||
0.148
|
0.148
|
||||||
- support new history including review history of OBS 2.6
|
- support new history including review history of OBS 2.6
|
||||||
|
- display request priorities, if important or critical
|
||||||
|
- add "osc rq priorize" command to re-priorize existing requests
|
||||||
|
- allow also "osc rq ls" shortcut
|
||||||
|
|
||||||
0.147
|
0.147
|
||||||
- support groups in maintainership requests
|
- support groups in maintainership requests
|
||||||
|
@ -1958,6 +1958,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
"checkout" will checkout the request's source package ("submit" requests only).
|
"checkout" will checkout the request's source package ("submit" requests only).
|
||||||
|
|
||||||
|
"priorize" change the prioritity of a request to either "critical", "important", "moderate" or "low"
|
||||||
|
|
||||||
|
|
||||||
The 'review' command has the following sub commands:
|
The 'review' command has the following sub commands:
|
||||||
|
|
||||||
"list" lists open requests that need to be reviewed by the
|
"list" lists open requests that need to be reviewed by the
|
||||||
@ -1982,6 +1985,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
osc request setincident [-m TEXT] ID INCIDENT
|
osc request setincident [-m TEXT] ID INCIDENT
|
||||||
osc request supersede [-m TEXT] ID SUPERSEDING_ID
|
osc request supersede [-m TEXT] ID SUPERSEDING_ID
|
||||||
osc request approvenew [-m TEXT] PROJECT
|
osc request approvenew [-m TEXT] PROJECT
|
||||||
|
osc request priorize [-m TEXT] ID PRIORITY
|
||||||
|
|
||||||
osc request checkout/co ID
|
osc request checkout/co ID
|
||||||
osc request clone [-m TEXT] ID
|
osc request clone [-m TEXT] ID
|
||||||
@ -2021,7 +2025,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
if args[0] == 'help':
|
if args[0] == 'help':
|
||||||
return self.do_help(['help', 'request'])
|
return self.do_help(['help', 'request'])
|
||||||
|
|
||||||
cmds = ['list', 'log', 'show', 'decline', 'reopen', 'clone', 'accept', 'approvenew', 'wipe', 'setincident', 'supersede', 'revoke', 'checkout', 'co']
|
cmds = ['list', 'ls', 'log', 'show', 'decline', 'reopen', 'clone', 'accept', 'approvenew', 'wipe', 'setincident', 'supersede', 'revoke', 'checkout', 'co', 'priorize']
|
||||||
if subcmd != 'review' and args[0] not in cmds:
|
if subcmd != 'review' and args[0] not in cmds:
|
||||||
raise oscerr.WrongArgs('Unknown request action %s. Choose one of %s.' \
|
raise oscerr.WrongArgs('Unknown request action %s. Choose one of %s.' \
|
||||||
% (args[0], ', '.join(cmds)))
|
% (args[0], ', '.join(cmds)))
|
||||||
@ -2032,12 +2036,14 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
cmd = args[0]
|
cmd = args[0]
|
||||||
del args[0]
|
del args[0]
|
||||||
|
if cmd == 'ls':
|
||||||
|
cmd = "list"
|
||||||
|
|
||||||
apiurl = self.get_api_url()
|
apiurl = self.get_api_url()
|
||||||
|
|
||||||
if cmd in ['list']:
|
if cmd in ['list']:
|
||||||
min_args, max_args = 0, 2
|
min_args, max_args = 0, 2
|
||||||
elif cmd in ['supersede', 'setincident']:
|
elif cmd in ['supersede', 'setincident', 'priorize']:
|
||||||
min_args, max_args = 2, 2
|
min_args, max_args = 2, 2
|
||||||
else:
|
else:
|
||||||
min_args, max_args = 1, 1
|
min_args, max_args = 1, 1
|
||||||
@ -2074,6 +2080,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
elif cmd == 'setincident':
|
elif cmd == 'setincident':
|
||||||
reqid = args[0]
|
reqid = args[0]
|
||||||
incident = args[1]
|
incident = args[1]
|
||||||
|
elif cmd == 'priorize':
|
||||||
|
reqid = args[0]
|
||||||
|
priority = args[1]
|
||||||
elif cmd in ['log', 'add', 'show', 'decline', 'reopen', 'clone', 'accept', 'wipe', 'revoke', 'checkout', 'co']:
|
elif cmd in ['log', 'add', 'show', 'decline', 'reopen', 'clone', 'accept', 'wipe', 'revoke', 'checkout', 'co']:
|
||||||
reqid = args[0]
|
reqid = args[0]
|
||||||
|
|
||||||
@ -2089,6 +2098,13 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
r = http_POST(url, data=opts.message)
|
r = http_POST(url, data=opts.message)
|
||||||
print(ET.parse(r).getroot().get('code'))
|
print(ET.parse(r).getroot().get('code'))
|
||||||
|
|
||||||
|
# change priority
|
||||||
|
elif cmd == 'priorize':
|
||||||
|
query = { 'cmd': 'setpriority', 'priority': priority }
|
||||||
|
url = makeurl(apiurl, ['request', reqid], query)
|
||||||
|
r = http_POST(url, data=opts.message)
|
||||||
|
print(ET.parse(r).getroot().get('code'))
|
||||||
|
|
||||||
# add new reviewer to existing request
|
# add new reviewer to existing request
|
||||||
elif cmd in ['add'] and subcmd == 'review':
|
elif cmd in ['add'] and subcmd == 'review':
|
||||||
query = { 'cmd': 'addreview' }
|
query = { 'cmd': 'addreview' }
|
||||||
|
@ -2581,6 +2581,7 @@ class Request:
|
|||||||
self.reqid = None
|
self.reqid = None
|
||||||
self.title = ''
|
self.title = ''
|
||||||
self.description = ''
|
self.description = ''
|
||||||
|
self.priority = None
|
||||||
self.state = None
|
self.state = None
|
||||||
self.accept_at = None
|
self.accept_at = None
|
||||||
self.actions = []
|
self.actions = []
|
||||||
@ -2608,6 +2609,8 @@ class Request:
|
|||||||
self.reviews.append(ReviewState(review))
|
self.reviews.append(ReviewState(review))
|
||||||
for history_element in root.findall('history'):
|
for history_element in root.findall('history'):
|
||||||
self.statehistory.append(RequestHistory(history_element))
|
self.statehistory.append(RequestHistory(history_element))
|
||||||
|
if not root.find('priority') is None:
|
||||||
|
self.priority = root.find('priority').text.strip()
|
||||||
if not root.find('accept_at') is None and root.find('accept_at').text:
|
if not root.find('accept_at') is None and root.find('accept_at').text:
|
||||||
self.accept_at = root.find('accept_at').text.strip()
|
self.accept_at = root.find('accept_at').text.strip()
|
||||||
if not root.find('title') is None:
|
if not root.find('title') is None:
|
||||||
@ -2653,6 +2656,8 @@ class Request:
|
|||||||
ET.SubElement(root, 'description').text = self.description
|
ET.SubElement(root, 'description').text = self.description
|
||||||
if self.accept_at:
|
if self.accept_at:
|
||||||
ET.SubElement(root, 'accept_at').text = self.accept_at
|
ET.SubElement(root, 'accept_at').text = self.accept_at
|
||||||
|
if self.priority:
|
||||||
|
ET.SubElement(root, 'priority').text = self.priority
|
||||||
return root
|
return root
|
||||||
|
|
||||||
def to_str(self):
|
def to_str(self):
|
||||||
@ -2779,7 +2784,7 @@ class Request:
|
|||||||
tmpl = ' Review by %(type)-10s is %(state)-10s %(by)-50s'
|
tmpl = ' Review by %(type)-10s is %(state)-10s %(by)-50s'
|
||||||
for review in self.reviews:
|
for review in self.reviews:
|
||||||
lines.append(tmpl % Request.format_review(review))
|
lines.append(tmpl % Request.format_review(review))
|
||||||
history = ['%s(%s)' % (hist.name, hist.who) for hist in self.statehistory]
|
history = ['%s: %s' % (hist.description, hist.who) for hist in self.statehistory]
|
||||||
if history:
|
if history:
|
||||||
lines.append(' From: %s' % ' -> '.join(history))
|
lines.append(' From: %s' % ' -> '.join(history))
|
||||||
if self.description:
|
if self.description:
|
||||||
@ -2794,6 +2799,8 @@ class Request:
|
|||||||
lines = ['Request: #%s\n' % self.reqid]
|
lines = ['Request: #%s\n' % self.reqid]
|
||||||
if self.accept_at and self.state.name in [ 'new', 'review' ]:
|
if self.accept_at and self.state.name in [ 'new', 'review' ]:
|
||||||
lines.append(' *** This request will get automatically accepted after '+self.accept_at+' ! ***\n')
|
lines.append(' *** This request will get automatically accepted after '+self.accept_at+' ! ***\n')
|
||||||
|
if self.priority in [ 'critical', 'important' ] and self.state.name in [ 'new', 'review' ]:
|
||||||
|
lines.append(' *** This request has classified as '+self.priority+' ! ***\n')
|
||||||
|
|
||||||
for action in self.actions:
|
for action in self.actions:
|
||||||
tmpl = ' %(type)-13s %(source)s %(target)s'
|
tmpl = ' %(type)-13s %(source)s %(target)s'
|
||||||
|
Loading…
Reference in New Issue
Block a user