qontract-reconcile 0.10.1rc306__py3-none-any.whl → 0.10.1rc307__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.1rc306.dist-info → qontract_reconcile-0.10.1rc307.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc306.dist-info → qontract_reconcile-0.10.1rc307.dist-info}/RECORD +12 -12
- reconcile/change_owners/change_owners.py +9 -2
- reconcile/change_owners/change_types.py +11 -0
- reconcile/change_owners/changes.py +11 -0
- reconcile/change_owners/self_service_roles.py +10 -0
- reconcile/gql_definitions/change_owners/queries/self_service_roles.py +2 -0
- reconcile/utils/mr/labels.py +4 -0
- tools/qontract_cli.py +6 -1
- {qontract_reconcile-0.10.1rc306.dist-info → qontract_reconcile-0.10.1rc307.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc306.dist-info → qontract_reconcile-0.10.1rc307.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc306.dist-info → qontract_reconcile-0.10.1rc307.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc306.dist-info → qontract_reconcile-0.10.1rc307.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.1rc307
|
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
|
{qontract_reconcile-0.10.1rc306.dist-info → qontract_reconcile-0.10.1rc307.dist-info}/RECORD
RENAMED
@@ -129,13 +129,13 @@ reconcile/aws_cloudwatch_log_retention/integration.py,sha256=W3Zct0o7677LvEt99Ui
|
|
129
129
|
reconcile/change_owners/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
130
130
|
reconcile/change_owners/approver.py,sha256=L7XJWJ-rgn8BOmeMb6lBDV8lHFCUaNoHGDSD7OH03vA,2244
|
131
131
|
reconcile/change_owners/bundle.py,sha256=Bh9v08tIw8TieG4EE9kVI9iFN1sW7Z6Zyb8DTbsv6F0,5371
|
132
|
-
reconcile/change_owners/change_owners.py,sha256=
|
133
|
-
reconcile/change_owners/change_types.py,sha256=
|
134
|
-
reconcile/change_owners/changes.py,sha256=
|
132
|
+
reconcile/change_owners/change_owners.py,sha256=Lo69xee7s1pPuGOyTcDkVBeku1NcE--N3LxtMRMmSNA,14244
|
133
|
+
reconcile/change_owners/change_types.py,sha256=nbACmO21txQY2DDF1qWFKjK9yYQTY2lr4rnAZMxYmag,31912
|
134
|
+
reconcile/change_owners/changes.py,sha256=6-byArOCi3DCA1jFpAVMZkyhu2mh7La3eIGp07OkUX0,17242
|
135
135
|
reconcile/change_owners/decision.py,sha256=JBMhNG8UqaKzTZgaKQLTPn8KW8CSEvq8clP76ZfQT6s,6381
|
136
136
|
reconcile/change_owners/diff.py,sha256=H6_Xizh2BrBdU-JPQvwNPx1-cELECmtKwRD_nOfOz9E,9253
|
137
137
|
reconcile/change_owners/implicit_ownership.py,sha256=yFUm8W5fR4B8xDQwvzKIzZmdDFGbNqCbk9L_812CyGc,4324
|
138
|
-
reconcile/change_owners/self_service_roles.py,sha256=
|
138
|
+
reconcile/change_owners/self_service_roles.py,sha256=_XtqpZ29viSJ0bCDnWqRU1Vi_oX-eC9JwQ_scbEFPAE,9209
|
139
139
|
reconcile/change_owners/tester.py,sha256=sytxJVNJPRXWc3E8zT1ERLx7ikuSfT-7Zt1KbnS01lg,8948
|
140
140
|
reconcile/cna/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
141
141
|
reconcile/cna/client.py,sha256=t9gJDrKf4ApBlgu8c4QUbmzrYoSo1QPsnAGfucva2_U,1562
|
@@ -161,7 +161,7 @@ reconcile/gql_definitions/aws_ami_cleanup/asg_namespaces.py,sha256=hu0f4DQ5a6mP4
|
|
161
161
|
reconcile/gql_definitions/change_owners/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
162
162
|
reconcile/gql_definitions/change_owners/queries/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
163
163
|
reconcile/gql_definitions/change_owners/queries/change_types.py,sha256=PibaJdWLxHYflYfLFEaub-0fvVcp8C8Apw3LRU6ScD8,5131
|
164
|
-
reconcile/gql_definitions/change_owners/queries/self_service_roles.py,sha256=
|
164
|
+
reconcile/gql_definitions/change_owners/queries/self_service_roles.py,sha256=bR3RM5GQjIiC2hgBOZowsJyLoIIo4ey0E3KvUxnyLrI,3987
|
165
165
|
reconcile/gql_definitions/cna/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
166
166
|
reconcile/gql_definitions/cna/queries/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
167
167
|
reconcile/gql_definitions/cna/queries/cna_provisioners.py,sha256=MxCdDVZkB_tBYTVevJhpymtLV93gT6cdDZfTPHX5bRc,3014
|
@@ -541,7 +541,7 @@ reconcile/utils/mr/aws_access.py,sha256=SOo2jPMexscMnKwtIU4s6mMDBOXW3Hxjdi6xDG9s
|
|
541
541
|
reconcile/utils/mr/base.py,sha256=in_t7LhCiN2QwmGqUnMXIPF_EPnfqjRZjYyPKLWrRrk,7142
|
542
542
|
reconcile/utils/mr/clusters_updates.py,sha256=0ibxkcBNyQWsgdG5hTaN1THHuQCAwGqXR1bSp6V2ov0,2123
|
543
543
|
reconcile/utils/mr/glitchtip_access_reporter.py,sha256=_k-FN244Zu5IrQU1sa4bktfChY3HqDDiweMP_OXDrHE,5065
|
544
|
-
reconcile/utils/mr/labels.py,sha256=
|
544
|
+
reconcile/utils/mr/labels.py,sha256=4OMgZbQZw2MUcfq8Bee_g583LmwHB5YIEoVrW7TcTRo,634
|
545
545
|
reconcile/utils/mr/notificator.py,sha256=2Xyg5Xh3xFQITdTmZ8Nry5qe0uC_w_On4uMPdlN5Bl4,2998
|
546
546
|
reconcile/utils/mr/ocm_update_recommended_version.py,sha256=qypdCoH_P3UBY_GpF6tWowSwSp1ZHN0BwoPy0kjxOLE,1530
|
547
547
|
reconcile/utils/mr/ocm_upgrade_scheduler_org_updates.py,sha256=u6J9zxvqNFXZW681B9dfPIO5zJWa-Z6PLDIow4uIg0A,2736
|
@@ -587,7 +587,7 @@ tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
587
587
|
tools/app_interface_reporter.py,sha256=8HUH8kkW50-plKgiTgCiFINJNN_cl4ZFzmY4aSnRaNk,18270
|
588
588
|
tools/glitchtip_access_reporter.py,sha256=oPBnk_YoDuljU3v0FaChzOwwnk4vap1xEE67QEjzdqs,2948
|
589
589
|
tools/glitchtip_access_revalidation.py,sha256=PXN5wxl6OX8sxddPaakDF3X79nFLvpm-lz0mWLVelw0,2806
|
590
|
-
tools/qontract_cli.py,sha256=
|
590
|
+
tools/qontract_cli.py,sha256=oXeUs9wMv7S3u4CzmnAXuK8nn9bcmMB2873lzeEwMlE,96717
|
591
591
|
tools/sd_app_sre_alert_report.py,sha256=utFZCreITuTZTiOaFNCaVPyFK0zxFZbc_ElcngGbiW8,4346
|
592
592
|
tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
593
593
|
tools/cli_commands/gpg_encrypt.py,sha256=JryinrDdvztN931enUY3FuDeLVnfs6y58mnK7itNK6Y,4940
|
@@ -597,8 +597,8 @@ tools/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
597
597
|
tools/test/test_qontract_cli.py,sha256=awwTHEc2DWlykuqGIYM0WOBoSL0KRnOraCLk3C7izis,1401
|
598
598
|
tools/test/test_sd_app_sre_alert_report.py,sha256=JeLhgzpKCPgLvptwg_4ZvJHLVWKNG1T5845HXTkMBxA,1826
|
599
599
|
tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
|
600
|
-
qontract_reconcile-0.10.
|
601
|
-
qontract_reconcile-0.10.
|
602
|
-
qontract_reconcile-0.10.
|
603
|
-
qontract_reconcile-0.10.
|
604
|
-
qontract_reconcile-0.10.
|
600
|
+
qontract_reconcile-0.10.1rc307.dist-info/METADATA,sha256=Ad4be8KypBclzvWnBfRX2UtI_M_2YIb69AtKEroAkrs,2284
|
601
|
+
qontract_reconcile-0.10.1rc307.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
602
|
+
qontract_reconcile-0.10.1rc307.dist-info/entry_points.txt,sha256=ErVY2Jp-0Rtuq5KOtMlW5yvna4nIEuc_1YbEdEdcy9o,301
|
603
|
+
qontract_reconcile-0.10.1rc307.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
604
|
+
qontract_reconcile-0.10.1rc307.dist-info/RECORD,,
|
@@ -40,6 +40,7 @@ from reconcile.utils.mr.labels import (
|
|
40
40
|
HOLD,
|
41
41
|
NOT_SELF_SERVICEABLE,
|
42
42
|
SELF_SERVICEABLE,
|
43
|
+
change_owner_label,
|
43
44
|
prioritized_approval_label,
|
44
45
|
)
|
45
46
|
from reconcile.utils.output import format_table
|
@@ -94,7 +95,7 @@ def manage_conditional_label(
|
|
94
95
|
current_labels: list[str],
|
95
96
|
conditional_labels: dict[str, bool],
|
96
97
|
dry_run: bool = True,
|
97
|
-
) ->
|
98
|
+
) -> set[str]:
|
98
99
|
new_labels = current_labels.copy()
|
99
100
|
for label, condition in conditional_labels.items():
|
100
101
|
if condition and label not in new_labels:
|
@@ -105,7 +106,7 @@ def manage_conditional_label(
|
|
105
106
|
logging.info(f"removing label {label}")
|
106
107
|
if not dry_run:
|
107
108
|
new_labels.remove(label)
|
108
|
-
return new_labels
|
109
|
+
return set(new_labels)
|
109
110
|
|
110
111
|
|
111
112
|
def write_coverage_report_to_mr(
|
@@ -377,6 +378,12 @@ def run(
|
|
377
378
|
conditional_labels=conditional_labels,
|
378
379
|
dry_run=False,
|
379
380
|
)
|
381
|
+
|
382
|
+
# change-owner labels
|
383
|
+
for bc in changes:
|
384
|
+
for label in bc.change_owner_labels:
|
385
|
+
labels.add(change_owner_label(label))
|
386
|
+
|
380
387
|
if mr_management_enabled:
|
381
388
|
gl.set_labels_on_merge_request(merge_request, labels)
|
382
389
|
else:
|
@@ -79,6 +79,16 @@ class DiffCoverage:
|
|
79
79
|
|
80
80
|
parent: Optional["DiffCoverage"] = None
|
81
81
|
|
82
|
+
@property
|
83
|
+
def change_owner_labels(self) -> set[str]:
|
84
|
+
"""
|
85
|
+
Returns a list of change-owner labels of all involved change-type contexts.
|
86
|
+
"""
|
87
|
+
labels = {label for c in self.coverage for label in c.change_owner_labels or {}}
|
88
|
+
for _split in self._split_into:
|
89
|
+
labels.update(_split.change_owner_labels)
|
90
|
+
return labels
|
91
|
+
|
82
92
|
def relative_path(self) -> jsonpath_ng.JSONPath:
|
83
93
|
if self.parent:
|
84
94
|
path = remove_prefix_from_path(self.diff.path, self.parent.diff.path)
|
@@ -831,6 +841,7 @@ class ChangeTypeContext:
|
|
831
841
|
context_file: FileRef
|
832
842
|
approvers: list[Approver]
|
833
843
|
approver_reachability: Optional[list[ApproverReachability]] = None
|
844
|
+
change_owner_labels: Optional[set[str]] = None
|
834
845
|
|
835
846
|
@property
|
836
847
|
def disabled(self) -> bool:
|
@@ -196,6 +196,17 @@ class BundleFileChange:
|
|
196
196
|
coverages.extend(dc.fine_grained_diff_coverages().values())
|
197
197
|
return coverages
|
198
198
|
|
199
|
+
@property
|
200
|
+
def change_owner_labels(self) -> set[str]:
|
201
|
+
"""
|
202
|
+
returns the set of change owner labels that are attached to the
|
203
|
+
BundleFileChanges DiffCoverage
|
204
|
+
"""
|
205
|
+
labels = set()
|
206
|
+
for dc in self.diff_coverage:
|
207
|
+
labels.update(dc.change_owner_labels)
|
208
|
+
return labels
|
209
|
+
|
199
210
|
def involved_change_types(self) -> list[ChangeTypeProcessor]:
|
200
211
|
"""
|
201
212
|
returns all the change-types that are involved in the coverage
|
@@ -21,6 +21,8 @@ from reconcile.gql_definitions.change_owners.queries.self_service_roles import (
|
|
21
21
|
)
|
22
22
|
from reconcile.utils import gql
|
23
23
|
|
24
|
+
CHANGE_OWNERS_LABELS_LABEL = "change-owners-labels"
|
25
|
+
|
24
26
|
|
25
27
|
class NoApproversInSelfServiceRoleError(Exception):
|
26
28
|
"""
|
@@ -201,6 +203,7 @@ def change_type_contexts_for_self_service_roles(
|
|
201
203
|
approver_reachability=approver_reachability_from_role(
|
202
204
|
role
|
203
205
|
),
|
206
|
+
change_owner_labels=change_type_labels_from_role(role),
|
204
207
|
context_file=ownership.context_file_ref,
|
205
208
|
),
|
206
209
|
)
|
@@ -208,6 +211,13 @@ def change_type_contexts_for_self_service_roles(
|
|
208
211
|
return change_type_contexts
|
209
212
|
|
210
213
|
|
214
|
+
def change_type_labels_from_role(role: RoleV1) -> set[str]:
|
215
|
+
change_owner_labels = (
|
216
|
+
role.labels.get(CHANGE_OWNERS_LABELS_LABEL, "") if role.labels else ""
|
217
|
+
)
|
218
|
+
return {label.strip() for label in change_owner_labels.split(",")}
|
219
|
+
|
220
|
+
|
211
221
|
def approver_reachability_from_role(role: RoleV1) -> list[ApproverReachability]:
|
212
222
|
reachability: list[ApproverReachability] = []
|
213
223
|
for permission in role.permissions or []:
|
@@ -22,6 +22,7 @@ DEFINITION = """
|
|
22
22
|
query SelfServiceRolesQuery($name: String) {
|
23
23
|
roles: roles_v1(name: $name) {
|
24
24
|
name
|
25
|
+
labels
|
25
26
|
path
|
26
27
|
self_service {
|
27
28
|
change_type {
|
@@ -107,6 +108,7 @@ class PermissionGitlabGroupMembershipV1(PermissionV1):
|
|
107
108
|
|
108
109
|
class RoleV1(ConfiguredBaseModel):
|
109
110
|
name: str = Field(..., alias="name")
|
111
|
+
labels: Optional[Json] = Field(..., alias="labels")
|
110
112
|
path: str = Field(..., alias="path")
|
111
113
|
self_service: Optional[list[SelfServiceConfigV1]] = Field(..., alias="self_service")
|
112
114
|
users: list[UserV1] = Field(..., alias="users")
|
reconcile/utils/mr/labels.py
CHANGED
tools/qontract_cli.py
CHANGED
@@ -98,6 +98,7 @@ from reconcile.utils.keycloak import (
|
|
98
98
|
from reconcile.utils.mr.labels import (
|
99
99
|
SAAS_FILE_UPDATE,
|
100
100
|
SELF_SERVICEABLE,
|
101
|
+
change_owner_label,
|
101
102
|
)
|
102
103
|
from reconcile.utils.oc import (
|
103
104
|
OC_Map,
|
@@ -1847,7 +1848,11 @@ def app_interface_review_queue(ctx) -> None:
|
|
1847
1848
|
continue
|
1848
1849
|
if SAAS_FILE_UPDATE in labels:
|
1849
1850
|
continue
|
1850
|
-
if
|
1851
|
+
if (
|
1852
|
+
SELF_SERVICEABLE in labels
|
1853
|
+
and change_owner_label("show-self-serviceable-in-review-queue")
|
1854
|
+
not in labels
|
1855
|
+
):
|
1851
1856
|
continue
|
1852
1857
|
|
1853
1858
|
pipelines = mr.pipelines()
|
File without changes
|
File without changes
|
{qontract_reconcile-0.10.1rc306.dist-info → qontract_reconcile-0.10.1rc307.dist-info}/top_level.txt
RENAMED
File without changes
|