def identify_vacant_teams()

in bugbot/rules/vacant_team_manager.py [0:0]


    def identify_vacant_teams(self) -> List[dict]:
        # We need team names for active components only.
        teams = {
            component["team_name"]
            for product in self.fetch_teams()
            if product["is_active"]
            for component in product["components"]
            if component["is_active"]
        }
        # Remove catch-all teams
        teams -= {"Mozilla", "Other"}
        # Add "fallback" so we make sure the "fallback" is active.
        teams.add("fallback")

        team_managers = TeamManagers()
        vacant_teams = []
        for team in teams:
            manager = team_managers.get_team_manager(team, fallback=False)

            if manager is not None and manager["mozilla_email"] is not None:
                continue

            if manager is not None:
                name = manager["name"]
            else:
                name = "Nobody"

            info = {
                "manager": name,
                "team": team,
                "status": "No longer in people" if manager is not None else "Undefined",
            }

            vacant_teams.append(info)

        return vacant_teams