def get_email_data()

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


    def get_email_data(self, date: str) -> List[dict]:
        active_components = {
            component: team_name
            for team_name, team_components in Components.get_instance().team_components.items()
            for component in team_components
        }
        people = People.get_instance()

        data = []
        for row in RotationDefinitions().get_definitions_records():
            team_name = row["Team Name"]
            scope = row["Calendar Scope"]
            fallback_triager = row["Fallback Triager"]

            problems = []

            if not people.get_bzmail_from_name(fallback_triager):
                problems.append(
                    "The fallback person is not in the list of current employees."
                )

            if "::" in scope:
                component_name = ComponentName.from_str(scope)
                team_name_on_bugzilla = active_components.get(component_name)

                if not team_name_on_bugzilla:
                    problems.append(
                        "The component is not in the list of active components."
                    )

                elif team_name_on_bugzilla != team_name:
                    problems.append(
                        f"The team name on Bugzilla is '{team_name_on_bugzilla}'."
                    )
            elif scope != "All Team's Components":
                # This should never happen, but just in case.
                problems.append("Unexpected calendar scope.")

            if problems:
                data.append(
                    {
                        "team_name": team_name,
                        "scope": scope,
                        "fallback_triager": fallback_triager,
                        "problems": problems,
                    }
                )

        return data