Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Core Milestone Insights #75

Merged
merged 1 commit into from
Mar 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions adabot/circuitpython_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,18 @@ def gather_insights(repo, insights, since):
else:
insights["open_issues"].append(issue["html_url"])

# get milestones for core repo
if repo["name"] == "circuitpython":
params = {"state": "open"}
response = github.get("/repos/adafruit/circuitpython/milestones", params=params)
if not response.ok:
output_handler("Failed to get core milestone insights.")
else:
milestones = response.json()
for milestone in milestones:
#print(milestone)
insights["milestones"][milestone["title"]] = milestone["open_issues"]

def repo_is_on_pypi(repo):
"""returns True when the provided repository is in pypi"""
is_on = False
Expand Down Expand Up @@ -979,6 +991,7 @@ def run_library_checks():
core_insights[k] = set()
if isinstance(core_insights[k], list):
core_insights[k] = []
core_insights["milestones"] = dict()
repo_needs_work = []
since = datetime.datetime.now() - datetime.timedelta(days=7)
repos_by_error = {}
Expand Down Expand Up @@ -1021,6 +1034,12 @@ def run_library_checks():
print_issue_overview(core_insights)
output_handler("* {} open issues".format(len(core_insights["open_issues"])))
output_handler(" * https://github.com/adafruit/circuitpython/issues")
output_handler("* {} active milestones".format(len(core_insights["milestones"])))
ms_count = 0
for milestone in sorted(core_insights["milestones"].keys()):
ms_count += core_insights["milestones"][milestone]
output_handler(" * {0}: {1} open issues".format(milestone, core_insights["milestones"][milestone]))
output_handler(" * {} issues not assigned a milestone".format(len(core_insights["open_issues"]) - ms_count))
output_handler()
print_circuitpython_download_stats()

Expand Down