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 = {} prs = {}
prioritary_milestone = "2.6.x"
def get_teams(): def get_teams():
with open("repos.json", "r") as f: with open("repos.json", "r") as f:
@ -56,6 +58,9 @@ def priority(pr):
if "dying" in pr["labels"] and base_priority > -100: if "dying" in pr["labels"] and base_priority > -100:
base_priority += 5 base_priority += 5
if pr["milestone"] != None and pr["milestone"] != prioritary_milestone:
base_priority -= 10
return base_priority return base_priority
@ -74,6 +79,10 @@ def main():
if "pull_request" not in issue.keys(): if "pull_request" not in issue.keys():
continue continue
milestone = None
if issue["milestone"]:
milestone = issue["milestone"]["title"]
pr = { pr = {
"repo": repo, "repo": repo,
"title": issue["title"], "title": issue["title"],
@ -81,10 +90,17 @@ def main():
"id": "%s-%s" % (repo, issue["number"]), "id": "%s-%s" % (repo, issue["number"]),
"createdDaysAgo": githubDateToDaysAgo(issue["created_at"]), "createdDaysAgo": githubDateToDaysAgo(issue["created_at"]),
"updatedDaysAgo": githubDateToDaysAgo(issue["updated_at"]), "updatedDaysAgo": githubDateToDaysAgo(issue["updated_at"]),
"url": issue["pull_request"]["html_url"], "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): if isPRDying(pr):
pr["labels"].append("dying") pr["labels"].append("dying")
pr["priority"] = priority(pr) pr["priority"] = priority(pr)

View file

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