Adjustment to interface and ranking

This commit is contained in:
Alexandre Aubin 2017-05-02 16:25:04 +02:00
parent 4b075b51eb
commit 06bcd3cc4e
2 changed files with 23 additions and 6 deletions

View file

@ -5,6 +5,8 @@ import datetime
prs = {}
prioritary_milestone = "2.6.x"
def get_teams():
with open("repos.json", "r") as f:
@ -56,6 +58,9 @@ def priority(pr):
if "dying" in pr["labels"] and base_priority > -100:
base_priority += 5
if pr["milestone"] != None and pr["milestone"] != prioritary_milestone:
base_priority -= 10
return base_priority
@ -74,6 +79,10 @@ def main():
if "pull_request" not in issue.keys():
continue
milestone = None
if issue["milestone"]:
milestone = issue["milestone"]["title"]
pr = {
"repo": repo,
"title": issue["title"],
@ -82,9 +91,16 @@ def main():
"createdDaysAgo": githubDateToDaysAgo(issue["created_at"]),
"updatedDaysAgo": githubDateToDaysAgo(issue["updated_at"]),
"url": issue["pull_request"]["html_url"],
"teams": teams
"teams": teams,
"milestone": milestone,
"size": None
}
for size in ["small", "medium", "big"]:
if "%s decision" % size in pr["labels"]:
pr["labels"].remove("%s decision" % size)
pr["labels"].insert(0,size)
if isPRDying(pr):
pr["labels"].append("dying")
pr["priority"] = priority(pr)

View file

@ -102,15 +102,16 @@
<span class="label
{% if label == "important" %}label-danger{%else%}
{% if label == "opinion needed" %}label-warning{%else%}
{% if label == "small decision" %}label-info{%else%}
{% if label == "medium decision" %}label-info{%else%}
{% if label == "big decision" %}label-info{%else%}
{% if label == "small" %}label-info{%else%}
{% if label == "medium" %}label-info{%else%}
{% if label == "big" %}label-info{%else%}
{% if label == "ready to merge" %}label-success{%else%}
{% if label == "work needed" %}label-primary{%else%}
{% if label == "inactive" %}label-default{%else%}
{% if label == "postponed" %}label-default{%else%}
{% if label == "dying" %}label-danger{%else%}
label-primary
{%endif%}{%endif%}{%endif%}{%endif%}{%endif%}{%endif%}{%endif%}{%endif%}{%endif%}
{%endif%}{%endif%}{%endif%}{%endif%}{%endif%}{%endif%}{%endif%}{%endif%}{%endif%}{%endif%}
">{{ label }}</span>
&nbsp;
{% endfor %}