qontract-reconcile 0.10.1rc908__py3-none-any.whl → 0.10.1rc910__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qontract-reconcile
3
- Version: 0.10.1rc908
3
+ Version: 0.10.1rc910
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
@@ -31,7 +31,7 @@ reconcile/github_users.py,sha256=nfTq78QRONIfDVj-5O3bD6psllJjzWFnog-EJ1WqFPU,367
31
31
  reconcile/github_validator.py,sha256=cVTVxJIGR4a1Jz8wrdXEAb_CMpXUzvykVmUURX4cook,917
32
32
  reconcile/gitlab_fork_compliance.py,sha256=5h9yovk_21SPvv-bDjF02TW4C3uuDBS20I3UQXo7RPI,4154
33
33
  reconcile/gitlab_housekeeping.py,sha256=3swjgFPhQC5M1Dthyf6Xu-ZcWdE3-2cvDpoLvr3Gvls,21181
34
- reconcile/gitlab_labeler.py,sha256=4xJHmVX155fclrHqkR926sL1GH6RTN5XfZ8PnqNXbRA,4534
34
+ reconcile/gitlab_labeler.py,sha256=a7HToXqv4S72TBp6Dmu2OkjjO60k81kH3B0J4UXHs3A,4768
35
35
  reconcile/gitlab_members.py,sha256=PrJE9OhDRdGG_gHM_77nQojLb4B18jtUu8DxgLsRS88,8417
36
36
  reconcile/gitlab_mr_sqs_consumer.py,sha256=O46mdziPgGOndbU-0_UJKJVUaiEoVzJPEgKm4_UvYoI,2571
37
37
  reconcile/gitlab_owners.py,sha256=sn9njaKOtqcvnhi2qtm-faAfAR4zNqflbSuusA9RUuI,13456
@@ -778,7 +778,7 @@ reconcile/utils/ocm/service_log.py,sha256=RG1f0MMn6joKaRCAm2xveSJCavdOPP1BVo9FXe
778
778
  reconcile/utils/ocm/sre_capability_labels.py,sha256=nqh0imrYczNeeeC7ZNX3pEwuAIVkKLTKZf0YHSPZYpE,1537
779
779
  reconcile/utils/ocm/status_board.py,sha256=fOuyzkykxU9Rr7zhW5VaY0Vkn8Ur-GxvElzb8No-DZg,2283
780
780
  reconcile/utils/ocm/subscriptions.py,sha256=6_blQPcgZYyy19WCFjYiolVk3O1jyNlK1yMqfkwK5sI,2536
781
- reconcile/utils/ocm/syncsets.py,sha256=VMAtF_PLU6Ed-PzNe09N2lwiO6f6r4gFd37gzbbWLsM,954
781
+ reconcile/utils/ocm/syncsets.py,sha256=9IQm1l5BodOVZa2OFbQmow3afmh4nXe5pn-CCJ5LxTI,1169
782
782
  reconcile/utils/ocm/upgrades.py,sha256=VSpW_B3ux7XZjnxV7klW2OjPYW8Wh0rN7snDuiN0q2c,4861
783
783
  reconcile/utils/rosa/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
784
784
  reconcile/utils/rosa/rosa_cli.py,sha256=Wj57nmeXMeBILRXTk27xpQcaU5uQR8JZeEFySP09NFg,11338
@@ -844,8 +844,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
844
844
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
845
845
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
846
846
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
847
- qontract_reconcile-0.10.1rc908.dist-info/METADATA,sha256=v1ZB3592JHiaRQ_ChjbdZO8zxdKuPxVIAwDHTay0_0A,2273
848
- qontract_reconcile-0.10.1rc908.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
849
- qontract_reconcile-0.10.1rc908.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
850
- qontract_reconcile-0.10.1rc908.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
851
- qontract_reconcile-0.10.1rc908.dist-info/RECORD,,
847
+ qontract_reconcile-0.10.1rc910.dist-info/METADATA,sha256=boTuxu6Nk52lbr0BIuxN2q3SC5o3ffs4x7CyScm5GkI,2273
848
+ qontract_reconcile-0.10.1rc910.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
849
+ qontract_reconcile-0.10.1rc910.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
850
+ qontract_reconcile-0.10.1rc910.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
851
+ qontract_reconcile-0.10.1rc910.dist-info/RECORD,,
@@ -1,9 +1,6 @@
1
1
  import logging
2
2
  import os
3
- from collections.abc import (
4
- Iterable,
5
- Set,
6
- )
3
+ from collections.abc import Iterable
7
4
 
8
5
  from reconcile import queries
9
6
  from reconcile.gitlab_housekeeping import (
@@ -14,6 +11,7 @@ from reconcile.utils.gitlab_api import GitLabApi
14
11
 
15
12
  LABEL_COLOR = "#0000FF" # Color blue in hex for labels
16
13
  QONTRACT_INTEGRATION = "gitlab-labeler"
14
+ TEST_ON_RHEL8_AI = "test-on-rhel8-ai"
17
15
 
18
16
 
19
17
  def get_app_list() -> dict:
@@ -80,7 +78,7 @@ def guess_onboarding_status(
80
78
 
81
79
  def guess_labels(
82
80
  project_labels: Iterable[str], changed_paths: Iterable[str]
83
- ) -> Set[str]:
81
+ ) -> set[str]:
84
82
  """
85
83
  Guess labels returns a list of labels from the project labels
86
84
  that contain parts of the changed paths.
@@ -129,8 +127,14 @@ def run(dry_run, gitlab_project_id=None, gitlab_merge_request_id=None) -> None:
129
127
  project_labels = gl.get_project_labels()
130
128
  merge_request = gl.get_merge_request(gitlab_merge_request_id)
131
129
  changed_paths = gl.get_merge_request_changed_paths(merge_request)
132
- guessed_labels = guess_labels(project_labels, changed_paths)
133
- labels_to_add = guessed_labels - set(merge_request.labels)
130
+ new_labels = guess_labels(project_labels, changed_paths)
131
+
132
+ author = merge_request.author["username"]
133
+ app_sre_team_members = [u.username for u in gl.get_app_sre_group_users()]
134
+ if author in app_sre_team_members:
135
+ new_labels.add(TEST_ON_RHEL8_AI)
136
+
137
+ labels_to_add = new_labels - set(merge_request.labels)
134
138
  labels_to_create = labels_to_add - project_labels
135
139
 
136
140
  # This integration cannot check dry-run mode as it's always running with
@@ -1,4 +1,4 @@
1
- from collections.abc import Mapping
1
+ from collections.abc import Generator, Mapping
2
2
  from dataclasses import dataclass
3
3
  from typing import Any
4
4
 
@@ -13,6 +13,13 @@ class SyncSet:
13
13
  href: str
14
14
 
15
15
 
16
+ def get_syncsets(
17
+ ocm_client: OCMBaseClient, cluster_id: str
18
+ ) -> Generator[dict[str, Any], None, None]:
19
+ syncset = SyncSet(cluster_id)
20
+ return ocm_client.get_paginated(api_path=syncset.href)
21
+
22
+
16
23
  def get_syncset(ocm_client: OCMBaseClient, cluster_id: str, syncset_id: str) -> Any:
17
24
  syncset = SyncSet(cluster_id)
18
25
  return ocm_client.get(api_path=syncset.href + "/" + syncset_id)