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

mozilla / relman-auto-nag / #4349

pending completion
#4349

push

coveralls-python

sosa-e
Revert "Minimizing config file"

This reverts commit 614159597.

564 of 3081 branches covered (18.31%)

24 of 24 new or added lines in 24 files covered. (100.0%)

1804 of 7980 relevant lines covered (22.61%)

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
import csv
×
6
from typing import List
×
7

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

14

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

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

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

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

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

39
            problems = []
×
40

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

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

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

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

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

73
        return data
×
74

75

76
if __name__ == "__main__":
×
77
    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