Skip to content
Open
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
15 changes: 11 additions & 4 deletions new-contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ def bmo_request(
# return json response
try:
with url_request.urlopen(req) as r:
res = json.load(r)
return res
return json.load(r)
except url_error.HTTPError as e:
try:
res = json.load(e.fp)
Expand Down Expand Up @@ -142,6 +141,9 @@ def main() -> None:
)
):
continue
# skip known bots
if assignee in ("[email protected]",):
continue
# skip users we already know are not new
should_skip = False
for cache_item in cache:
Expand All @@ -155,7 +157,7 @@ def main() -> None:
new[assignee]["bugs"].append(bug["id"])
continue

print(f"checking {assignee}", file=sys.stderr, end="")
print(f"checking {assignee}", file=sys.stderr, end="", flush=True)

# always exclude employees; this is quicker than a bug search, and not
# all bugs have correct metadata
Expand All @@ -174,7 +176,12 @@ def main() -> None:
print(" employee", file=sys.stderr)
current_cache["skip"].append(assignee)
continue
print(" contributor", file=sys.stderr, end="")
print(" contributor", file=sys.stderr, end="", flush=True)

# ignore bugs in a broken state
if not bug.get("cf_last_resolved"):
print(f" bug-{bug['id']} in unexpected state", file=sys.stderr)
continue

# query for bugs fixed by this user before this one
prior_bugs = bmo_request(
Expand Down