• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / relman-auto-nag / #4350

pending completion
#4350

push

coveralls-python

web-flow
Update the protocol from git to https in Readme file (#1984)

563 of 3079 branches covered (18.29%)

1795 of 7971 relevant lines covered (22.52%)

0.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/auto_nag/scripts/triage_rotations_outdated.py
1
# This Source Code Form is subject to the terms of the Mozilla Public
2
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
3
# You can obtain one at http://mozilla.org/MPL/2.0/.
4

5
from typing import List
×
6

7
from auto_nag.bzcleaner import BzCleaner
×
8
from auto_nag.component_triagers import ComponentName
×
9
from auto_nag.components import Components
×
10
from auto_nag.people import People
×
11
from auto_nag.round_robin import RotationDefinitions
×
12

13

14
class TriageRotationsOutdated(BzCleaner):
×
15
    """Find outdated triage owner rotation definitions"""
16

17
    def __init__(self) -> None:
×
18
        super().__init__()
×
19
        self.query_url = None
×
20

21
    def description(self) -> str:
×
22
        return "Outdated triage rotation definitions"
×
23

24
    def get_email_data(self, date: str) -> List[dict]:
×
25
        active_components = {
×
26
            component: team_name
27
            for team_name, team_components in Components.get_instance().team_components.items()
28
            for component in team_components
29
        }
30
        people = People.get_instance()
×
31

32
        data = []
×
33
        for row in RotationDefinitions().get_definitions_records():
×
34
            team_name = row["Team Name"]
×
35
            scope = row["Calendar Scope"]
×
36
            fallback_triager = row["Fallback Triager"]
×
37

38
            problems = []
×
39

40
            if not people.get_bzmail_from_name(fallback_triager):
×
41
                problems.append(
×
42
                    "The fallback person is not in the list of current employees."
43
                )
44

45
            if "::" in scope:
×
46
                component_name = ComponentName.from_str(scope)
×
47
                team_name_on_bugzilla = active_components.get(component_name)
×
48

49
                if not team_name_on_bugzilla:
×
50
                    problems.append(
×
51
                        "The component is not in the list of active components."
52
                    )
53

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

62
            if problems:
×
63
                data.append(
×
64
                    {
65
                        "team_name": team_name,
66
                        "scope": scope,
67
                        "fallback_triager": fallback_triager,
68
                        "problems": problems,
69
                    }
70
                )
71

72
        return data
×
73

74

75
if __name__ == "__main__":
×
76
    TriageRotationsOutdated().run()
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc