-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmodels_enums.py
More file actions
125 lines (91 loc) · 3.24 KB
/
models_enums.py
File metadata and controls
125 lines (91 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Copyright 2023 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3, as
# published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# SPDX-FileCopyrightText: Copyright 2023 Canonical Ltd.
# SPDX-License-Identifier: AGPL-3.0-only
from enum import StrEnum
class FamilyName(StrEnum):
snap = "snap"
deb = "deb"
charm = "charm"
image = "image"
class StageName(StrEnum):
proposed = "proposed"
updates = "updates"
edge = "edge"
beta = "beta"
candidate = "candidate"
stable = "stable"
pending = "pending"
current = "current"
def _compare(self, other: str) -> int:
stages = list(StageName.__members__.values())
return stages.index(self) - stages.index(StageName(other))
def __lt__(self, other: str) -> bool:
return self._compare(other) < 0
def __le__(self, other: str) -> bool:
return self._compare(other) <= 0
def __gt__(self, other: str) -> bool:
return self._compare(other) > 0
def __ge__(self, other: str) -> bool:
return self._compare(other) >= 0
class SnapStage(StrEnum):
edge = StageName.edge
beta = StageName.beta
candidate = StageName.candidate
stable = StageName.stable
class DebStage(StrEnum):
proposed = StageName.proposed
updates = StageName.updates
class CharmStage(StrEnum):
edge = StageName.edge
beta = StageName.beta
candidate = StageName.candidate
stable = StageName.stable
class ImageStage(StrEnum):
pending = StageName.pending
current = StageName.current
class TestExecutionStatus(StrEnum):
__test__ = False
NOT_STARTED = "NOT_STARTED"
IN_PROGRESS = "IN_PROGRESS"
PASSED = "PASSED"
FAILED = "FAILED"
NOT_TESTED = "NOT_TESTED"
ENDED_PREMATURELY = "ENDED_PREMATURELY"
class ArtefactBuildEnvironmentReviewDecision(StrEnum):
REJECTED = "REJECTED"
APPROVED_INCONSISTENT_TEST = "APPROVED_INCONSISTENT_TEST"
APPROVED_UNSTABLE_PHYSICAL_INFRA = "APPROVED_UNSTABLE_PHYSICAL_INFRA"
APPROVED_CUSTOMER_PREREQUISITE_FAIL = "APPROVED_CUSTOMER_PREREQUISITE_FAIL"
APPROVED_FAULTY_HARDWARE = "APPROVED_FAULTY_HARDWARE"
APPROVED_ALL_TESTS_PASS = "APPROVED_ALL_TESTS_PASS"
class ArtefactStatus(StrEnum):
APPROVED = "APPROVED"
MARKED_AS_FAILED = "MARKED_AS_FAILED"
UNDECIDED = "UNDECIDED"
class TestResultStatus(StrEnum):
__test__ = False
PASSED = "PASSED"
FAILED = "FAILED"
SKIPPED = "SKIPPED"
class IssueSource(StrEnum):
JIRA = "jira"
GITHUB = "github"
LAUNCHPAD = "launchpad"
class IssueStatus(StrEnum):
UNKNOWN = "unknown"
OPEN = "open"
CLOSED = "closed"
class NotificationType(StrEnum):
USER_ASSIGNED_ARTEFACT_REVIEW = "USER_ASSIGNED_ARTEFACT_REVIEW"
USER_ASSIGNED_ENVIRONMENT_REVIEW = "USER_ASSIGNED_ENVIRONMENT_REVIEW"