qontract-reconcile 0.10.1rc828__py3-none-any.whl → 0.10.1rc830__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.1rc828
3
+ Version: 0.10.1rc830
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
@@ -35,7 +35,7 @@ reconcile/gitlab_labeler.py,sha256=IxE1XM5o4rDOFuR4cM2yAHTy4Uzdg3Nyz2mp7b8Fx1g,4
35
35
  reconcile/gitlab_members.py,sha256=M6LwFOrwgvl1NNdOJa1mrQFUon-bEVv1AyhGeLed454,8443
36
36
  reconcile/gitlab_mr_sqs_consumer.py,sha256=O46mdziPgGOndbU-0_UJKJVUaiEoVzJPEgKm4_UvYoI,2571
37
37
  reconcile/gitlab_owners.py,sha256=sn9njaKOtqcvnhi2qtm-faAfAR4zNqflbSuusA9RUuI,13456
38
- reconcile/gitlab_permissions.py,sha256=Q_vGh8F_7-fUIDWZFigZpwkY4fvjxS7Tmq4jQCS56zw,2166
38
+ reconcile/gitlab_permissions.py,sha256=K6Ta59c_Hib2DI5DnryiQbDNSOJTiY5B8cGy5a9xNkI,2199
39
39
  reconcile/gitlab_projects.py,sha256=K3tFf_aD1W4Ijp5q-9Qek3kwFGEWPcZ1kd7tzFJ4GyQ,1781
40
40
  reconcile/integrations_manager.py,sha256=J_VV-HINI7YNav2NPIolePZkll-7VBuBXWAyMNhsM_Q,9535
41
41
  reconcile/jenkins_base.py,sha256=0Gocu3fU2YTltaxBlbDQOUvP-7CP2OSQV1ZRwtWeVXw,875
@@ -93,7 +93,7 @@ reconcile/quay_mirror.py,sha256=9NzbNoxl-NdD8CwImcXNG5xTdHmUJxBfeVk5XHH41J8,1488
93
93
  reconcile/quay_mirror_org.py,sha256=Oq-t3kSkgfeSAOUDjLCDRBeEvOIEBacfX38qrX_s0oc,10801
94
94
  reconcile/quay_permissions.py,sha256=9KOutS1w4RFQqkvMSy54VtsKNx56-phzP6yI_rEW-B8,4244
95
95
  reconcile/quay_repos.py,sha256=cuEYG0HUe0ut5yvLdEwOF5-CmccpXQHRb_wDazvDrvQ,6895
96
- reconcile/queries.py,sha256=hgQizeUT5_a1ZI9i8wH-ajr7e956u5ynIp90zKMeRCA,50560
96
+ reconcile/queries.py,sha256=oubToFx19Dm-5Dx47Xajuwg9F5YcROmxKTrXg1WGjMA,50749
97
97
  reconcile/query_validator.py,sha256=BAjGrU8_VhzTOv5k0-uz0hY9ziZyconv8VAhgre1Auc,1497
98
98
  reconcile/requests_sender.py,sha256=914iluuF4UVgG3VyxxtnHOu4yf6YKS2fIy6PViSsFTQ,3875
99
99
  reconcile/resource_scraper.py,sha256=vo1N9vLJCYWvXlTwFRIpEuWjx_39ZV9zxJlpoPq4g3U,2330
@@ -178,8 +178,8 @@ reconcile/cna/assets/asset.py,sha256=1v51uYSaD1NOc9cI_YxG7h0NOcR1ng-mkmD2UzQ8PXE
178
178
  reconcile/cna/assets/asset_factory.py,sha256=7T7X_J6xIsoGETqBRI45_EyIKEdQcnRPt_GAuVuLQcc,785
179
179
  reconcile/cna/assets/null.py,sha256=Fby1Fbn7oNRIGNasdyhRDvXJ0ktpxv-pUAPN0lZWSzk,1684
180
180
  reconcile/dynatrace_token_provider/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
181
- reconcile/dynatrace_token_provider/integration.py,sha256=d13ulyEYD9U32D6s641o_Oibx1g4f6jr1vHQL_KbZts,16257
182
- reconcile/dynatrace_token_provider/metrics.py,sha256=F92Vh8CQBFs-bCF3pNpd8ZqsBwqgyK-A6pOCu_eAI1s,1074
181
+ reconcile/dynatrace_token_provider/integration.py,sha256=NZOwk6t5X8p5fUo2FNsBgGHhAXq4vXsj3GCowiu0UWk,16531
182
+ reconcile/dynatrace_token_provider/metrics.py,sha256=xiKkl8fTEBQaXJelGCPNTZhHAWdO1M3pCXNr_Tei63c,1285
183
183
  reconcile/external_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
184
184
  reconcile/external_resources/aws.py,sha256=JvjKaABy2Pg8u8Lq82Acv4zMvpE3_qGKes7OG-zlHOM,2956
185
185
  reconcile/external_resources/factories.py,sha256=bLboXX5Dq0xN60mtDGNjCOLC6HlKofXMWQxVbRwMMwo,4485
@@ -812,8 +812,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
812
812
  tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jrss,4941
813
813
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
814
814
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
815
- qontract_reconcile-0.10.1rc828.dist-info/METADATA,sha256=zn9mUDpdoboyaXrhQNN2Qq2Msqp99DriqAcjRMCgJmM,2314
816
- qontract_reconcile-0.10.1rc828.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
817
- qontract_reconcile-0.10.1rc828.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
818
- qontract_reconcile-0.10.1rc828.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
819
- qontract_reconcile-0.10.1rc828.dist-info/RECORD,,
815
+ qontract_reconcile-0.10.1rc830.dist-info/METADATA,sha256=dFJyqmQPBYPDrL163PxcGXf0YY_SvLi75h_E5O5d5nQ,2314
816
+ qontract_reconcile-0.10.1rc830.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
817
+ qontract_reconcile-0.10.1rc830.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
818
+ qontract_reconcile-0.10.1rc830.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
819
+ qontract_reconcile-0.10.1rc830.dist-info/RECORD,,
@@ -12,6 +12,7 @@ from dynatrace import Dynatrace
12
12
  from dynatrace.environment_v2.tokens_api import ApiTokenCreated
13
13
 
14
14
  from reconcile.dynatrace_token_provider.metrics import (
15
+ DTPClustersManagedGauge,
15
16
  DTPOrganizationErrorRate,
16
17
  )
17
18
  from reconcile.gql_definitions.common.ocm_environments import (
@@ -93,6 +94,13 @@ class DynatraceTokenProviderIntegration(
93
94
  "key", dtp_label_key("%")
94
95
  ),
95
96
  )
97
+ metrics.set_gauge(
98
+ DTPClustersManagedGauge(
99
+ integration=self.name,
100
+ ocm_env=env.name,
101
+ ),
102
+ len(clusters),
103
+ )
96
104
  if not clusters:
97
105
  continue
98
106
  if self.params.ocm_organization_ids:
@@ -3,6 +3,7 @@ from pydantic import BaseModel
3
3
  from reconcile.utils.metrics import (
4
4
  CounterMetric,
5
5
  ErrorRateMetricSet,
6
+ GaugeMetric,
6
7
  )
7
8
 
8
9
 
@@ -41,3 +42,11 @@ class DTPOrganizationErrorRate(ErrorRateMetricSet):
41
42
  org_id=org_id,
42
43
  ),
43
44
  )
45
+
46
+
47
+ class DTPClustersManagedGauge(DTPBaseMetric, GaugeMetric):
48
+ "Gauge for the number of clusters DTP manages"
49
+
50
+ @classmethod
51
+ def name(cls) -> str:
52
+ return "dtp_clusters_managed"
@@ -49,7 +49,7 @@ def run(dry_run, thread_pool_size=10, defer=None):
49
49
  gl = GitLabApi(instance, settings=settings)
50
50
  if defer:
51
51
  defer(gl.cleanup)
52
- repos = queries.get_repos(server=gl.server)
52
+ repos = queries.get_repos(server=gl.server, exclude_manage_permissions=True)
53
53
  app_sre = gl.get_app_sre_group_users()
54
54
  results = threaded.run(
55
55
  get_members_to_add, repos, thread_pool_size, gl=gl, app_sre=app_sre
reconcile/queries.py CHANGED
@@ -1724,6 +1724,7 @@ CODE_COMPONENT_REPO_QUERY = """
1724
1724
  apps: apps_v1 {
1725
1725
  codeComponents {
1726
1726
  url
1727
+ managePermissions
1727
1728
  }
1728
1729
  }
1729
1730
  }
@@ -1756,7 +1757,7 @@ def get_review_repos():
1756
1757
  ]
1757
1758
 
1758
1759
 
1759
- def get_repos(server="") -> list[str]:
1760
+ def get_repos(server: str = "", exclude_manage_permissions: bool = False) -> list[str]:
1760
1761
  """Returns all repos defined under codeComponents
1761
1762
  Optional arguments:
1762
1763
  server: url of the server to return. for example: https://github.com
@@ -1766,6 +1767,8 @@ def get_repos(server="") -> list[str]:
1766
1767
  for a in apps:
1767
1768
  if a["codeComponents"] is not None:
1768
1769
  for c in a["codeComponents"]:
1770
+ if exclude_manage_permissions and c.get("managePermissions") is False:
1771
+ continue
1769
1772
  if c["url"].startswith(server):
1770
1773
  repos.append(c["url"])
1771
1774
  return repos