Count tickets per submitter and hide excesses.
This commit is contained in:
parent
1c745d0b1d
commit
d28d94f584
1 changed files with 20 additions and 0 deletions
|
@ -44,6 +44,9 @@ SECLAB = 563471
|
||||||
# These will show up in a query but aren't actual review tickets
|
# These will show up in a query but aren't actual review tickets
|
||||||
trackers = set([ACCEPT, BUNDLED, FEATURE, NEEDSPONSOR, GUIDELINES, SCITECH, SECLAB])
|
trackers = set([ACCEPT, BUNDLED, FEATURE, NEEDSPONSOR, GUIDELINES, SCITECH, SECLAB])
|
||||||
|
|
||||||
|
# How many packages per submitter are allowed in the main queue
|
||||||
|
maxpackages = 5
|
||||||
|
|
||||||
# So the bugzilla module has some way to complain
|
# So the bugzilla module has some way to complain
|
||||||
logging.basicConfig()
|
logging.basicConfig()
|
||||||
#logging.basicConfig(level=logging.DEBUG)
|
#logging.basicConfig(level=logging.DEBUG)
|
||||||
|
@ -242,6 +245,23 @@ def run_query(bz):
|
||||||
if filter(opendep, bugdata[bug.id]['depends']):
|
if filter(opendep, bugdata[bug.id]['depends']):
|
||||||
bugdata[bug.id]['hidden'].append('blocked')
|
bugdata[bug.id]['hidden'].append('blocked')
|
||||||
|
|
||||||
|
# Count up each submitter's tickets and hide excessive submissions. Want
|
||||||
|
# to make sure one submitter only has 'maxpackages' tickets in the NEW
|
||||||
|
# queue at one time. Already-hidden packages don't count.
|
||||||
|
submitters = {}
|
||||||
|
for i in bugs:
|
||||||
|
if i.reporter not in submitters:
|
||||||
|
submitters[i.reporter] = 0
|
||||||
|
|
||||||
|
# Don't count tickets which are already hidden
|
||||||
|
if len(bugdata[i.id]['hidden']):
|
||||||
|
continue
|
||||||
|
|
||||||
|
submitters[i.reporter] += 1
|
||||||
|
if (submitters[i.reporter] > maxpackages and
|
||||||
|
'nobody@fedoraproject.org' not in i.reporter):
|
||||||
|
bugdata[i.id]['hidden'].append('excessive')
|
||||||
|
|
||||||
# Now we need to look up the names of the users
|
# Now we need to look up the names of the users
|
||||||
for i in bugs:
|
for i in bugs:
|
||||||
if select_needsponsor(i, bugdata[i.id]):
|
if select_needsponsor(i, bugdata[i.id]):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue