mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-06 23:31:29 +00:00
Add block/unblock-hint info to excuses.yaml
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
1028860c53
commit
5d31eee805
13
britney.py
13
britney.py
@ -1214,12 +1214,18 @@ class Britney(object):
|
|||||||
for hint in self.hints.search(package=src):
|
for hint in self.hints.search(package=src):
|
||||||
if hint.type == 'block':
|
if hint.type == 'block':
|
||||||
blocked['block'] = hint
|
blocked['block'] = hint
|
||||||
|
excuse.add_hint(hint)
|
||||||
if hint.type == 'block-udeb':
|
if hint.type == 'block-udeb':
|
||||||
blocked['block-udeb'] = hint
|
blocked['block-udeb'] = hint
|
||||||
|
excuse.add_hint(hint)
|
||||||
|
if 'block' not in blocked:
|
||||||
for hint in self.hints.search(type='block-all', package='source'):
|
for hint in self.hints.search(type='block-all', package='source'):
|
||||||
blocked.setdefault('block', hint)
|
blocked['block'] = hint
|
||||||
if suite in ['pu', 'tpu']:
|
excuse.add_hint(hint)
|
||||||
|
break
|
||||||
|
if suite in ('pu', 'tpu'):
|
||||||
blocked['block'] = '%s-block' % (suite)
|
blocked['block'] = '%s-block' % (suite)
|
||||||
|
excuse.needs_approval = True
|
||||||
|
|
||||||
# if the source is blocked, then look for an `unblock' hint; the unblock request
|
# 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
|
# 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)
|
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 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" %
|
excuse.addhtml("Ignoring %s request by %s, due to %s request by %s" %
|
||||||
(block_cmd, blocked[block_cmd].user, unblock_cmd, unblocks[0].user))
|
(block_cmd, blocked[block_cmd].user, unblock_cmd, unblocks[0].user))
|
||||||
else:
|
else:
|
||||||
|
19
excuse.py
19
excuse.py
@ -50,6 +50,8 @@ class Excuse(object):
|
|||||||
self.section = None
|
self.section = None
|
||||||
self._is_valid = False
|
self._is_valid = False
|
||||||
self._dontinvalidate = False
|
self._dontinvalidate = False
|
||||||
|
self.needs_approval = False
|
||||||
|
self.hints = []
|
||||||
self.forced = False
|
self.forced = False
|
||||||
|
|
||||||
self.invalid_deps = []
|
self.invalid_deps = []
|
||||||
@ -147,6 +149,9 @@ class Excuse(object):
|
|||||||
"""Denote than an old binary ("cruft") is available from a previous source version"""
|
"""Denote than an old binary ("cruft") is available from a previous source version"""
|
||||||
self.old_binaries[from_source_version].add(binary)
|
self.old_binaries[from_source_version].add(binary)
|
||||||
|
|
||||||
|
def add_hint(self, hint):
|
||||||
|
self.hints.append(hint)
|
||||||
|
|
||||||
def html(self):
|
def html(self):
|
||||||
"""Render the excuse in HTML"""
|
"""Render the excuse in HTML"""
|
||||||
res = "<a id=\"%s\" name=\"%s\">%s</a> (%s to %s)\n<ul>\n" % \
|
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-architectures': sorted(self.missing_builds),
|
||||||
'on-unimportant-architectures': sorted(self.missing_builds_ood_arch),
|
'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:
|
if self.old_binaries:
|
||||||
excusedata['old-binaries'] = {x: sorted(self.old_binaries[x]) for x in self.old_binaries}
|
excusedata['old-binaries'] = {x: sorted(self.old_binaries[x]) for x in self.old_binaries}
|
||||||
if self.forced:
|
if self.forced:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user