qontract-reconcile 0.10.1rc908__py3-none-any.whl → 0.10.1rc909__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.1rc909
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
@@ -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.1rc909.dist-info/METADATA,sha256=4xlbiQ_CqGDzQWvfDN7K-JbCPpAyZwGmtccuEI9RAdU,2273
848
+ qontract_reconcile-0.10.1rc909.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
849
+ qontract_reconcile-0.10.1rc909.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
850
+ qontract_reconcile-0.10.1rc909.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
851
+ qontract_reconcile-0.10.1rc909.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