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

Refactored count_bugs to use libmozdata #3687

Closed
wants to merge 5 commits into from
Closed
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
17 changes: 11 additions & 6 deletions bugbug/bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from typing import Iterable, Iterator, NewType, Optional

import tenacity
import libmozdata.bugzilla
from dateutil.relativedelta import relativedelta
from libmozdata.bugzilla import Bugzilla
from tqdm import tqdm
Expand Down Expand Up @@ -282,13 +283,17 @@ def delete_bugs(match):
def count_bugs(bug_query_params):
bug_query_params["count_only"] = 1

r = utils.get_session("bugzilla").get(
"https://bugzilla.mozilla.org/rest/bug", params=bug_query_params
)
r.raise_for_status()
count = r.json()["bug_count"]
count_of_bugs = []

return count
def bug_handler(corresponding_bugs):
count_of_bugs.append(corresponding_bugs["bug_count"])

Bugzilla(
bug_query_params,
bughandler=bug_handler
).get_data().wait()

return count_of_bugs


def get_product_component_count(months: int = 12) -> dict[str, int]:
Expand Down