Adding roadmap for 2.7

This commit is contained in:
Alexandre Aubin 2017-07-03 23:33:27 +02:00
parent 06bcd3cc4e
commit 16ebf8db42
3 changed files with 49 additions and 34 deletions

View file

@ -3,6 +3,7 @@
import json
import BeautifulSoup
roadmaps = { "2.6.x": 11, "2.7.x": 13 }
status_filters = {
"all": None,
@ -14,29 +15,33 @@ status_filters = {
def parse_issues():
soup = BeautifulSoup.BeautifulSoup(open("data/raw_roadmapissues.xml").read())
issues = []
for issue in soup.issues:
cleaned_issue = {}
cleaned_issue["id"] = issue.id.text
cleaned_issue["priority"] = issue.priority["name"]
cleaned_issue["status"] = issue.status["name"]
cleaned_issue["type"] = issue.tracker["name"]
cleaned_issue["subject"] = issue.subject.text
cleaned_issue["p"] = priority(cleaned_issue)
issues.append(cleaned_issue)
for roadmap in sorted(roadmaps.keys()):
soup = BeautifulSoup.BeautifulSoup(open("data/raw_"+roadmap+"_issues.xml").read())
for issue in soup.issues:
cleaned_issue = {}
cleaned_issue["id"] = issue.id.text
cleaned_issue["priority"] = issue.priority["name"]
cleaned_issue["status"] = issue.status["name"]
cleaned_issue["type"] = issue.tracker["name"]
cleaned_issue["subject"] = issue.subject.text
cleaned_issue["roadmap"] = roadmap
cleaned_issue["p"] = priority(cleaned_issue)
issues.append(cleaned_issue)
issues = sorted(issues, key=lambda x: x["p"], reverse=True )
return issues
def filtered_issues(issues, status_filter=None, type_filter=None):
issues_filtered = issues
def filtered_issues(issues, roadmap, status_filter=None, type_filter=None):
issues_filtered = [ issue for issue in issues if issue["roadmap"] == roadmap ]
if status_filter != None:
issues_filtered = [ issue for issue in issues_filtered if issue["status"] in status_filter]
@ -69,7 +74,7 @@ def priority(issue):
elif (issue["status"]):
p += 10
p -= sorted(roadmaps.keys()).index(issue["roadmap"]) / 10
return p
@ -78,20 +83,25 @@ def main():
# Parse issues...
issues = parse_issues()
# Build summary
summary = {}
for roadmap in roadmaps:
summary[roadmap] = {}
# First add issues by status
for status_name, status_filter in status_filters.items():
summary[status_name] = filtered_issues(issues, status_filter)
for roadmap in roadmaps:
for status_name, status_filter in status_filters.items():
summary[roadmap][status_name] = filtered_issues(issues, roadmap, status_filter)
print summary
# The compute percent
for status_name, status_filter in status_filters.items():
if (status_name != "all"):
n = summary[status_name]
p = float("{0:.1f}".format(100 * n / summary["all"]))
summary[status_name] = (n,p)
for roadmap in roadmaps:
for status_name, status_filter in status_filters.items():
if (status_name != "all"):
n = summary[roadmap][status_name]
p = float("{0:.1f}".format(100 * n / summary[roadmap]["all"]))
summary[roadmap][status_name] = (n,p)
# (Meh)
summary = { "summary": summary }

View file

@ -3,12 +3,15 @@
import requests
import json
roadmaps = { "2.6.x": 11, "2.7.x": 13 }
def get_roadmapissues():
roadmapissues = requests.get("https://dev.yunohost.org/issues.xml?fixed_version_id=11&status_id=*&limit=100", verify=False)
for roadmap, id in roadmaps.items():
issues = requests.get("https://dev.yunohost.org/issues.xml?fixed_version_id="+str(id)+"&status_id=*&limit=100", verify=False)
with open("data/raw_roadmapissues.xml", "w") as f:
f.write(roadmapissues.text)
with open("data/raw_"+roadmap+"_issues.xml", "w") as f:
f.write(issues.text)
get_roadmapissues()

View file

@ -55,30 +55,32 @@
<h1>Yunohost Roadmap Dashboard</h1>
</div>
</div>
<h3>2.6.x</h3>
{% for roadmap, summary in data.summary.items() %}
<h3>{{ roadmap }}</h3>
<div class="row">
<div class="col-md-offset-1 col-md-10">
<div class="issue-legend">All ({{data.summary.all}} issues) </div>
<div class="issue-legend">All ({{summary.all}} issues) </div>
<div class="bs-component">
<div class="progress">
<div class="progress-bar progress-bar-success" style="width:
{{data.summary.done[1]}}%">{{data.summary.done[0]}} done</div>
{{summary.done[1]}}%">{{summary.done[0]}} done</div>
<div class="progress-bar progress-bar-warning" style="width:
{{data.summary.ongoing[1]}}%">{{data.summary.ongoing[0]}}
{{summary.ongoing[1]}}%">{{summary.ongoing[0]}}
ongoing</div>
<div class="progress-bar progress-bar-none" style="width:
{{data.summary.new[1]}}%">{{data.summary.new[0]}} new</div>
{{summary.new[1]}}%">{{summary.new[0]}} new</div>
</div>
</div>
</div>
</div>
{% endfor %}
<div class="row">
<div class="col-md-12">