qontract-reconcile 0.10.1rc58__py3-none-any.whl → 0.10.1rc59__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qontract_reconcile-0.10.1rc58.dist-info → qontract_reconcile-0.10.1rc59.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc58.dist-info → qontract_reconcile-0.10.1rc59.dist-info}/RECORD +7 -7
- reconcile/change_owners/change_owners.py +2 -32
- reconcile/change_owners/self_service_roles.py +49 -7
- {qontract_reconcile-0.10.1rc58.dist-info → qontract_reconcile-0.10.1rc59.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc58.dist-info → qontract_reconcile-0.10.1rc59.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc58.dist-info → qontract_reconcile-0.10.1rc59.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc58.dist-info → qontract_reconcile-0.10.1rc59.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.1rc59
|
4
4
|
Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
|
5
5
|
Home-page: https://github.com/app-sre/qontract-reconcile
|
6
6
|
Author: Red Hat App-SRE Team
|
@@ -130,13 +130,13 @@ reconcile/aus/ocm_upgrade_scheduler_org.py,sha256=tH0oQFJsO4UrEYspqiq-ne6-ULXA4N
|
|
130
130
|
reconcile/change_owners/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
131
131
|
reconcile/change_owners/approver.py,sha256=L7XJWJ-rgn8BOmeMb6lBDV8lHFCUaNoHGDSD7OH03vA,2244
|
132
132
|
reconcile/change_owners/bundle.py,sha256=VTRXDMlcNYykqCPRIcCDTCA188Ouxglt7Sxeu1qep4E,5102
|
133
|
-
reconcile/change_owners/change_owners.py,sha256=
|
133
|
+
reconcile/change_owners/change_owners.py,sha256=WX-ekjI3IhdrJtvwieyeE32ho6cOsIOzFY3uzS25X5E,13268
|
134
134
|
reconcile/change_owners/change_types.py,sha256=rWYmrw3rcE-lEZ-SQb3D38an5GhasaydpAtYpg5nPBU,28405
|
135
135
|
reconcile/change_owners/changes.py,sha256=uGFukXgMkcO9xAXzF_LL0HLdNcQtSq0IyojsI1YIJTs,15889
|
136
136
|
reconcile/change_owners/decision.py,sha256=uFuk06kzgifCg4ExaMRHEX6LIKnwaMkSQG8AeNG2uJo,4811
|
137
137
|
reconcile/change_owners/diff.py,sha256=84pbx19C-QL1SgK16MxPqv3Ssiy1g8j0i978iSDb2kM,8840
|
138
138
|
reconcile/change_owners/implicit_ownership.py,sha256=xga4X0OiZityQf5YRGLUSaIdr2Ij74H879-sjWzgTDk,4161
|
139
|
-
reconcile/change_owners/self_service_roles.py,sha256=
|
139
|
+
reconcile/change_owners/self_service_roles.py,sha256=Ya5NPHCFpzMCDmxHrrjueXCYAap7jXzm0woudUEH6lc,6754
|
140
140
|
reconcile/change_owners/tester.py,sha256=BfJM8dsurubnyDF9UR3oV2N3ClyjLsqDNq0Hy_UdjOk,8949
|
141
141
|
reconcile/cna/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
142
142
|
reconcile/cna/client.py,sha256=t9gJDrKf4ApBlgu8c4QUbmzrYoSo1QPsnAGfucva2_U,1562
|
@@ -584,8 +584,8 @@ tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y
|
|
584
584
|
tools/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
585
585
|
tools/test/test_qontract_cli.py,sha256=awwTHEc2DWlykuqGIYM0WOBoSL0KRnOraCLk3C7izis,1401
|
586
586
|
tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
|
587
|
-
qontract_reconcile-0.10.
|
588
|
-
qontract_reconcile-0.10.
|
589
|
-
qontract_reconcile-0.10.
|
590
|
-
qontract_reconcile-0.10.
|
591
|
-
qontract_reconcile-0.10.
|
587
|
+
qontract_reconcile-0.10.1rc59.dist-info/METADATA,sha256=yWzIW1zwhAEPW3eHJrXNtN0Ccq3SlMTwZy-WA1tTvh0,2290
|
588
|
+
qontract_reconcile-0.10.1rc59.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
589
|
+
qontract_reconcile-0.10.1rc59.dist-info/entry_points.txt,sha256=Af70EWPJxsTiCNF6gA-pWdw1A0Heqn-PZF-oBc5NmiU,302
|
590
|
+
qontract_reconcile-0.10.1rc59.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
591
|
+
qontract_reconcile-0.10.1rc59.dist-info/RECORD,,
|
@@ -29,12 +29,9 @@ from reconcile.change_owners.implicit_ownership import (
|
|
29
29
|
)
|
30
30
|
from reconcile.change_owners.self_service_roles import (
|
31
31
|
cover_changes_with_self_service_roles,
|
32
|
+
fetch_self_service_roles,
|
32
33
|
)
|
33
|
-
from reconcile.gql_definitions.change_owners.queries import
|
34
|
-
change_types,
|
35
|
-
self_service_roles,
|
36
|
-
)
|
37
|
-
from reconcile.gql_definitions.change_owners.queries.self_service_roles import RoleV1
|
34
|
+
from reconcile.gql_definitions.change_owners.queries import change_types
|
38
35
|
from reconcile.utils import gql
|
39
36
|
from reconcile.utils.gitlab_api import GitLabApi
|
40
37
|
from reconcile.utils.mr.labels import (
|
@@ -78,33 +75,6 @@ def cover_changes(
|
|
78
75
|
)
|
79
76
|
|
80
77
|
|
81
|
-
def validate_self_service_role(role: RoleV1) -> None:
|
82
|
-
for ssc in role.self_service or []:
|
83
|
-
if ssc.change_type.context_schema:
|
84
|
-
# check that all referenced datafiles have a schema that
|
85
|
-
# is compatible with the change-type
|
86
|
-
incompatible_datafiles = [
|
87
|
-
df.path
|
88
|
-
for df in ssc.datafiles or []
|
89
|
-
if df.datafile_schema != ssc.change_type.context_schema
|
90
|
-
]
|
91
|
-
if incompatible_datafiles:
|
92
|
-
raise ValueError(
|
93
|
-
f"The datafiles {incompatible_datafiles} are not compatible with the "
|
94
|
-
f"{ssc.change_type.name} change-types contextSchema {ssc.change_type.context_schema}"
|
95
|
-
)
|
96
|
-
|
97
|
-
|
98
|
-
def fetch_self_service_roles(gql_api: gql.GqlApi) -> list[RoleV1]:
|
99
|
-
roles: list[RoleV1] = []
|
100
|
-
for r in self_service_roles.query(gql_api.query).roles or []:
|
101
|
-
if not r.self_service:
|
102
|
-
continue
|
103
|
-
validate_self_service_role(r)
|
104
|
-
roles.append(r)
|
105
|
-
return roles
|
106
|
-
|
107
|
-
|
108
78
|
def fetch_change_type_processors(
|
109
79
|
gql_api: gql.GqlApi, file_diff_resolver: FileDiffResolver
|
110
80
|
) -> list[ChangeTypeProcessor]:
|
@@ -12,15 +12,62 @@ from reconcile.change_owners.change_types import (
|
|
12
12
|
ChangeTypeProcessor,
|
13
13
|
)
|
14
14
|
from reconcile.change_owners.changes import BundleFileChange
|
15
|
+
from reconcile.gql_definitions.change_owners.queries import self_service_roles
|
15
16
|
from reconcile.gql_definitions.change_owners.queries.self_service_roles import (
|
16
17
|
PermissionGitlabGroupMembershipV1,
|
17
18
|
PermissionSlackUsergroupV1,
|
18
19
|
RoleV1,
|
19
20
|
)
|
21
|
+
from reconcile.utils import gql
|
20
22
|
|
21
23
|
|
22
|
-
class
|
23
|
-
|
24
|
+
class NoApproversInSelfServiceRoleError(Exception):
|
25
|
+
"""
|
26
|
+
Thrown when a self-service role has no approvers
|
27
|
+
"""
|
28
|
+
|
29
|
+
|
30
|
+
class DatafileIncompatibleWithChangeTypeError(Exception):
|
31
|
+
"""
|
32
|
+
Thrown when a datafile and a change type are hooked up
|
33
|
+
in a self-service role, but are not compatible schema wise.
|
34
|
+
"""
|
35
|
+
|
36
|
+
|
37
|
+
def fetch_self_service_roles(gql_api: gql.GqlApi) -> list[RoleV1]:
|
38
|
+
roles: list[RoleV1] = []
|
39
|
+
for r in self_service_roles.query(gql_api.query).roles or []:
|
40
|
+
if not r.self_service:
|
41
|
+
continue
|
42
|
+
validate_self_service_role(r)
|
43
|
+
roles.append(r)
|
44
|
+
return roles
|
45
|
+
|
46
|
+
|
47
|
+
def validate_self_service_role(role: RoleV1) -> None:
|
48
|
+
"""
|
49
|
+
Validate that a self-service role has approvers and that the referenced
|
50
|
+
change-types and datafiles/resources are compatible.
|
51
|
+
"""
|
52
|
+
if not role.users and not role.bots:
|
53
|
+
raise NoApproversInSelfServiceRoleError(
|
54
|
+
f"The role {role.name} has no users or bots "
|
55
|
+
"to drive the self-service process. Add approvers to the roles."
|
56
|
+
)
|
57
|
+
for ssc in role.self_service or []:
|
58
|
+
if ssc.change_type.context_schema:
|
59
|
+
# check that all referenced datafiles have a schema that
|
60
|
+
# is compatible with the change-type
|
61
|
+
incompatible_datafiles = [
|
62
|
+
df.path
|
63
|
+
for df in ssc.datafiles or []
|
64
|
+
if df.datafile_schema != ssc.change_type.context_schema
|
65
|
+
]
|
66
|
+
if incompatible_datafiles:
|
67
|
+
raise DatafileIncompatibleWithChangeTypeError(
|
68
|
+
f"The datafiles {incompatible_datafiles} are not compatible with the "
|
69
|
+
f"{ssc.change_type.name} change-types contextSchema {ssc.change_type.context_schema}"
|
70
|
+
)
|
24
71
|
|
25
72
|
|
26
73
|
def cover_changes_with_self_service_roles(
|
@@ -66,11 +113,6 @@ def change_type_contexts_for_self_service_roles(
|
|
66
113
|
role_lookup[
|
67
114
|
(BundleFileType.RESOURCEFILE, res, ss.change_type.name)
|
68
115
|
].append(r)
|
69
|
-
if orphaned_roles:
|
70
|
-
raise EmptySelfServiceRoleError(
|
71
|
-
f"The roles {', '.join([r.name for r in orphaned_roles])} have no users or bots "
|
72
|
-
"to drive the self-service process. Add approvers to the roles."
|
73
|
-
)
|
74
116
|
|
75
117
|
# match every BundleChange with every relevant ChangeTypeV1
|
76
118
|
change_type_contexts = []
|
File without changes
|
{qontract_reconcile-0.10.1rc58.dist-info → qontract_reconcile-0.10.1rc59.dist-info}/entry_points.txt
RENAMED
File without changes
|
{qontract_reconcile-0.10.1rc58.dist-info → qontract_reconcile-0.10.1rc59.dist-info}/top_level.txt
RENAMED
File without changes
|