How to use the libmozdata.bugzilla.BugzillaUser function in libmozdata

To help you get started, we’ve selected a few libmozdata examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / relman-auto-nag / auto_nag / scripts / not_landed.py View on Github external
def get_nicks(self, nicknames):
        def handler(user, data):
            data[user["name"]] = user["nick"]

        users = set(nicknames.values())
        data = {}
        if users:
            BugzillaUser(
                user_names=list(users),
                include_fields=["name", "nick"],
                user_handler=handler,
                user_data=data,
            ).wait()

        for bugid, name in nicknames.items():
            nicknames[bugid] = (name, data[name])

        return nicknames
github mozilla / relman-auto-nag / auto_nag / scripts / regression_without_regressed_by.py View on Github external
no_nick[winner] = []
                no_nick[winner].append(bugid)
            else:
                winner = {
                    "mail": info["creator"]["email"],
                    "nickname": info["creator"]["nick"],
                }
                self.add_auto_ni(bugid, winner)

        if no_nick:

            def user_handler(user, data):
                data[user["name"]] = user["nick"]

            data = {}
            BugzillaUser(
                user_names=list(no_nick.keys()),
                include_fields=["name", "nick"],
                user_handler=user_handler,
                user_data=data,
            ).wait()

            for bzmail, bugids in no_nick.items():
                nick = data[bzmail]
                for bugid in bugids:
                    self.add_auto_ni(bugid, {"mail": bzmail, "nickname": nick})
github mozilla / relman-auto-nag / auto_nag / round_robin.py View on Github external
def get_nick(self, bzmail, prod_comp, cal):
        if bzmail not in self.nicks:

            def handler(user):
                self.nicks[bzmail] = user["nick"]

            BugzillaUser(user_names=[bzmail], user_handler=handler).wait()

        if bzmail not in self.nicks:
            self.add_erroneous_bzmail(bzmail, prod_comp, cal)
            return None

        return self.nicks[bzmail]
github mozilla / relman-auto-nag / auto_nag / scripts / no_assignee.py View on Github external
def get_user_info(self, bzdata):
        """Get the user info from Bugzilla to have his real name.
        """

        def handler(user, data):
            data[user["name"]] = user["real_name"]

        users = set()
        for info in bzdata.values():
            users |= info["creators"]
            users |= set(info["commenters"].keys())

        data = {}

        if users:
            BugzillaUser(
                user_names=list(users), user_handler=handler, user_data=data
            ).wait()

        return data