qontract-reconcile 0.10.1rc623__py3-none-any.whl → 0.10.1rc625__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.1rc623
3
+ Version: 0.10.1rc625
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
@@ -102,7 +102,7 @@ reconcile/sendgrid_teammates.py,sha256=oO8QbLb4s1o8A6CGiCagN9CmS05BSS_WLztuY0Ym9
102
102
  reconcile/service_dependencies.py,sha256=PMKP9vc6oL-78rzyF_RE8DzLSQMSqN8vCqt9sWpBLAM,4470
103
103
  reconcile/signalfx_endpoint_monitoring.py,sha256=D1m8iq0EAKie0OD59FOcVCtpWWZ7xlo6lwBS9urwMIk,2894
104
104
  reconcile/slack_base.py,sha256=K3fSYx46G1djoPb07_C9j6ChhMCt5LgV5l6v2TFkNZk,3479
105
- reconcile/slack_usergroups.py,sha256=4Xikz_zKPHE5Q_hf2vOOs9vlItxgCqZPn7YJgn1Brik,27294
105
+ reconcile/slack_usergroups.py,sha256=XC7bYHP322EFWrEaR4Orw_sOoMFmuV3o08OC0UE4xLQ,27592
106
106
  reconcile/sql_query.py,sha256=qLTUU2Hc0BmJoSl9cCUsIfdEaEaOQp7y__E4KLjjcaA,25732
107
107
  reconcile/status.py,sha256=cY4IJFXemhxptRJqR4qaaOWqei9e4jgLXuVSGajMsjg,544
108
108
  reconcile/status_board.py,sha256=nA74_133jukxVShjPKJpkXOA3vggDTTEhYTegoXbN1M,8632
@@ -457,7 +457,7 @@ reconcile/test/test_saasherder.py,sha256=1_GyiXxxNqKSKE7PrtFJL7tUFg77d1oQPZzNBZW
457
457
  reconcile/test/test_saasherder_allowed_secret_paths.py,sha256=5NHQwNJO66at6HiyMZ5sVRTQDwxdvlOQo0KmkBWCw5Q,4853
458
458
  reconcile/test/test_secret_reader.py,sha256=kz7nzcPjvA08cytnvcA_PMA98AEyqJWsESkYeRn5xCk,4994
459
459
  reconcile/test/test_slack_base.py,sha256=gpbWOLNxMMX6fyAbs1JakhLTnwfedb3f7WpUae4tQZE,5060
460
- reconcile/test/test_slack_usergroups.py,sha256=VOIxxPgB5aIkDem4ZcvffHrrJzZvcReuKzFKjdnor1c,23533
460
+ reconcile/test/test_slack_usergroups.py,sha256=UO-OzqbGMSpNsyddu2TbWOzSiVze6Bq95Ph1QIJqLWY,23990
461
461
  reconcile/test/test_sql_query.py,sha256=rC-lf1_isT9i2ZIV9W0hkUkLi2oBIjZMRMhk-6mV-34,11029
462
462
  reconcile/test/test_status_board.py,sha256=WdAq4pFoWWqcOcfgMzssZD3xfvT1QLrEHJqUARldtvA,7875
463
463
  reconcile/test/test_terraform_aws_route53.py,sha256=xHggb8K1P76OyCfFcogbkmyKle-NlUylcbDnuv3IqvY,771
@@ -591,7 +591,7 @@ reconcile/utils/ocm_base_client.py,sha256=dBmO7y82u7G1RhhHAldj5fnNd8p8V5vx4dN_PJ
591
591
  reconcile/utils/openshift_resource.py,sha256=Ft1LpKrG71pU-gEA95Xp0G6a6Prmru0SzBSzxjaJ8no,24516
592
592
  reconcile/utils/openssl.py,sha256=QVvhzhpChq_4Daf_5wE1qeZJr4thg3DDjJPn4bOPD4E,365
593
593
  reconcile/utils/output.py,sha256=4tObxIS_-EdJY_YCOOOmaYvHY40Q72IpYjWhjpJR1Ec,1856
594
- reconcile/utils/pagerduty_api.py,sha256=938KW_hjV-kyxV7sfYijU6rSzSdyaWy_pKV7HLwuX8A,7644
594
+ reconcile/utils/pagerduty_api.py,sha256=fcSAUez6w51woDvbm0plJW2qSw6_NXQs1Fit_KTNitc,7653
595
595
  reconcile/utils/parse_dhms_duration.py,sha256=TONpLnec5gHeF7k815YNJpQyDjXhkxZIcv9s8ffbTSY,1840
596
596
  reconcile/utils/password_validator.py,sha256=XwuWg-8CPlcuG7dl_oQ1G1h2gSVSnfMym_VkuprpWVg,2183
597
597
  reconcile/utils/promotion_state.py,sha256=avYxHUf4zK3dBhXEdUEry79EOSgJ7gfStvvOpcedZnI,2575
@@ -714,8 +714,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
714
714
  tools/test/test_qontract_cli.py,sha256=OvalpVRfY4pNmpMaWHHYqBjV68b1eGQjX8SCyTAXb1w,3501
715
715
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
716
716
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
717
- qontract_reconcile-0.10.1rc623.dist-info/METADATA,sha256=xjFvDyYPpdcxB53kEXuqdxPzfzczGv39b5Lwe5-e7MI,2382
718
- qontract_reconcile-0.10.1rc623.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
719
- qontract_reconcile-0.10.1rc623.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
720
- qontract_reconcile-0.10.1rc623.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
721
- qontract_reconcile-0.10.1rc623.dist-info/RECORD,,
717
+ qontract_reconcile-0.10.1rc625.dist-info/METADATA,sha256=zHAp9JWVyX5qDHsnC7BAbcN2EjAMiPlwm2AwJIi2KLI,2382
718
+ qontract_reconcile-0.10.1rc625.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
719
+ qontract_reconcile-0.10.1rc625.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
720
+ qontract_reconcile-0.10.1rc625.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
721
+ qontract_reconcile-0.10.1rc625.dist-info/RECORD,,
@@ -799,11 +799,20 @@ def run(
799
799
 
800
800
  def early_exit_desired_state(*args: Any, **kwargs: Any) -> dict[str, Any]:
801
801
  gqlapi = gql.get_api()
802
+ # exclude user.roles (cluster access roles) with tag_on_cluster_updates: false
803
+ # to speedup PR checks
804
+ users = get_users(gqlapi.query)
805
+ for user in users:
806
+ user.roles = [
807
+ role
808
+ for role in user.roles or []
809
+ if role.tag_on_cluster_updates is not False
810
+ ]
802
811
  return {
803
812
  "permissions": [p.dict() for p in get_permissions(gqlapi.query)],
804
813
  "pagerduty_instances": [
805
814
  p.dict() for p in get_pagerduty_instances(gqlapi.query)
806
815
  ],
807
- "users": [u.dict() for u in get_users(gqlapi.query)],
816
+ "users": [u.dict() for u in users],
808
817
  "clusters": [c.dict() for c in get_clusters(gqlapi.query)],
809
818
  }
@@ -19,7 +19,7 @@ from pytest_mock import MockerFixture
19
19
 
20
20
  import reconcile.slack_base as slackbase
21
21
  import reconcile.slack_usergroups as integ
22
- from reconcile.gql_definitions.slack_usergroups.clusters import ClusterV1
22
+ from reconcile.gql_definitions.slack_usergroups.clusters import ClusterAuthV1, ClusterV1
23
23
  from reconcile.gql_definitions.slack_usergroups.permissions import (
24
24
  PagerDutyInstanceV1,
25
25
  PagerDutyTargetV1,
@@ -131,6 +131,8 @@ def test_get_users(fxt: Fixtures) -> None:
131
131
  users = get_users(q)
132
132
  assert len(users) == 2
133
133
  assert users[0].org_username == "user1-org-username"
134
+ assert users[0].roles
135
+ assert len(users[0].roles) == 1
134
136
  assert (
135
137
  users[1].roles
136
138
  and users[1].roles[0].access
@@ -242,6 +244,16 @@ def test_include_user_to_cluster_usergroup_user_has_cluster_access(
242
244
  assert not integ.include_user_to_cluster_usergroup(user, cluster, ["user1"])
243
245
 
244
246
 
247
+ def test_user_has_cluster_access(mocker: MockerFixture, user: UserV1) -> None:
248
+ cluster = ClusterV1(
249
+ name="cluster",
250
+ auth=[ClusterAuthV1(service="oidc")],
251
+ disable={"integrations": []},
252
+ )
253
+ assert integ.user_has_cluster_access(user, cluster, [user.org_username])
254
+ assert not integ.user_has_cluster_access(user, cluster, ["just-another-user"])
255
+
256
+
245
257
  def test_include_user_to_cluster_usergroup(mocker: MockerFixture, user: UserV1) -> None:
246
258
  mocker.patch.object(
247
259
  integ,
@@ -76,7 +76,7 @@ class PagerDutyApi:
76
76
  self.users: list[pypd.User] = []
77
77
 
78
78
  def init_users(self) -> None:
79
- self.users = pypd.User.find()
79
+ self.users = pypd.User.find(limit=100)
80
80
 
81
81
  def get_pagerduty_users(
82
82
  self, resource_type: str, resource_id: str