def get_bugzilla_authors_reviewers()

in libmozdata/patchanalysis.py [0:0]


def get_bugzilla_authors_reviewers(bug):
    bugzilla_reviewers = set()
    bugzilla_authors = set()
    for attachment in bug["attachments"]:
        if (
            sum(
                flag["name"] == "review"
                and (flag["status"] == "+" or flag["status"] == "-")
                for flag in attachment["flags"]
            )
            == 0
        ):
            continue

        bugzilla_authors.add(attachment["creator"])

        for flag in attachment["flags"]:
            if flag["name"] != "review" or flag["status"] == "-":
                continue

            # If the creator of the patch is the setter of the review flag, it's probably
            # because he/she was carrying a r+, so we don't add him/her to the reviewers list.
            if flag["setter"] == attachment["creator"]:
                continue

            bugzilla_reviewers.add(flag["setter"])

    return bugzilla_authors, bugzilla_reviewers