Add block/unblock-hint info to excuses.yaml

Signed-off-by: Niels Thykier <niels@thykier.net>
master
Niels Thykier 8 years ago
parent 1028860c53
commit 5d31eee805

@ -1214,12 +1214,18 @@ class Britney(object):
for hint in self.hints.search(package=src):
if hint.type == 'block':
blocked['block'] = hint
excuse.add_hint(hint)
if hint.type == 'block-udeb':
blocked['block-udeb'] = hint
for hint in self.hints.search(type='block-all', package='source'):
blocked.setdefault('block', hint)
if suite in ['pu', 'tpu']:
excuse.add_hint(hint)
if 'block' not in blocked:
for hint in self.hints.search(type='block-all', package='source'):
blocked['block'] = hint
excuse.add_hint(hint)
break
if suite in ('pu', 'tpu'):
blocked['block'] = '%s-block' % (suite)
excuse.needs_approval = True
# if the source is blocked, then look for an `unblock' hint; the unblock request
# is processed only if the specified version is correct. If a package is blocked
@ -1229,7 +1235,8 @@ class Britney(object):
unblocks = self.hints.search(unblock_cmd, package=src)
if unblocks and unblocks[0].version is not None and unblocks[0].version == source_u[VERSION]:
if suite == 'unstable' or block_cmd == 'block-udeb':
excuse.add_hint(unblocks[0])
if block_cmd == 'block-udeb' or not excuse.needs_approval:
excuse.addhtml("Ignoring %s request by %s, due to %s request by %s" %
(block_cmd, blocked[block_cmd].user, unblock_cmd, unblocks[0].user))
else:

@ -50,6 +50,8 @@ class Excuse(object):
self.section = None
self._is_valid = False
self._dontinvalidate = False
self.needs_approval = False
self.hints = []
self.forced = False
self.invalid_deps = []
@ -147,6 +149,9 @@ class Excuse(object):
"""Denote than an old binary ("cruft") is available from a previous source version"""
self.old_binaries[from_source_version].add(binary)
def add_hint(self, hint):
self.hints.append(hint)
def html(self):
"""Render the excuse in HTML"""
res = "<a id=\"%s\" name=\"%s\">%s</a> (%s to %s)\n<ul>\n" % \
@ -236,6 +241,20 @@ class Excuse(object):
'on-architectures': sorted(self.missing_builds),
'on-unimportant-architectures': sorted(self.missing_builds_ood_arch),
}
if self.needs_approval:
status = 'not-approved'
for h in self.hints:
if h.type == 'unblock':
status = 'approved'
break
excusedata['manual-approval-status'] = status
if self.hints:
hint_info = [{
'hint-type': h.type,
'hint-from': h.user,
} for h in self.hints]
excusedata['hints'] = hint_info
if self.old_binaries:
excusedata['old-binaries'] = {x: sorted(self.old_binaries[x]) for x in self.old_binaries}
if self.forced:

Loading…
Cancel
Save