qontract-reconcile 0.10.1rc1117__py3-none-any.whl → 0.10.1rc1119__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.1rc1117
3
+ Version: 0.10.1rc1119
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
@@ -10,7 +10,7 @@ reconcile/aws_iam_password_reset.py,sha256=q96mwr2KeEQ5bpNniGlgIMZTxiuLSodcYfX-t
10
10
  reconcile/aws_support_cases_sos.py,sha256=hl_9L53yQYRQxKs3IWrd69Cc60XK067g_bJRM9B0udo,2975
11
11
  reconcile/blackbox_exporter_endpoint_monitoring.py,sha256=O1wFp52EyF538c6txaWBs8eMtUIy19gyHZ6VzJ6QXS8,3512
12
12
  reconcile/checkpoint.py,sha256=_JhMxrye5BgkRMxWYuf7Upli6XayPINKSsuo3ynHTRc,5010
13
- reconcile/cli.py,sha256=ipCFQNRFmaoo_DoeAvMY3bTYfaovOgWhRvL6TYuk1G8,107605
13
+ reconcile/cli.py,sha256=-RT8biWI5mY9o6gYZ7HxXowePxmxbnfGKKqhMeUdiDc,107720
14
14
  reconcile/closedbox_endpoint_monitoring_base.py,sha256=rLh16BOlBOxTmJ8Si3wWyyEpmMlhh4Znx1Gc36qsmOc,4865
15
15
  reconcile/cluster_deployment_mapper.py,sha256=5gumAaRCcFXsabUJ1dnuUy9WrP_FEEM5JnOnE8ch9sE,2326
16
16
  reconcile/dashdotdb_base.py,sha256=l34QDu1G96_Ctnh7ZXdxXgSeCE93GQMdLAkWxmN6vDA,4775
@@ -161,7 +161,7 @@ reconcile/aws_version_sync/merge_request_manager/merge_request_manager.py,sha256
161
161
  reconcile/change_owners/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
162
162
  reconcile/change_owners/approver.py,sha256=Z3_11vnK2WNOxjEEXVDh0224-_-qbt9d6mBeVE-7fsc,2259
163
163
  reconcile/change_owners/bundle.py,sha256=h30fU-JmLH5a-rCAovpzTeTkkkgZztsZ5A2raee0YuU,5355
164
- reconcile/change_owners/change_log_tracking.py,sha256=qEGSH3C6FUxmz-rPNyQCqwM8kYK3tNtHVgQHzQjIWh0,7814
164
+ reconcile/change_owners/change_log_tracking.py,sha256=3cIS-evZbU1SGkFzKDa7y9GL6uvSBZ0xbTl_qiqp4ss,7937
165
165
  reconcile/change_owners/change_owners.py,sha256=0HRJhDm0oW3uYJFgzynqA1gA0lbhalhSkmWOiQmr-NM,17062
166
166
  reconcile/change_owners/change_types.py,sha256=HEsoBduhcczAXZHwT26mr5sVPxtf8J6tsvjSDDI1ceI,32077
167
167
  reconcile/change_owners/changes.py,sha256=YblT-JPFagctTphzd38SjVmj3k1YsgMzN48zGpnLYKM,18222
@@ -196,9 +196,9 @@ reconcile/external_resources/aws.py,sha256=7W-6d-lXO6JGwaxtO1Uc3Lw0p8csJ1EVgz__O
196
196
  reconcile/external_resources/factories.py,sha256=nhdTqf1WEfRfgd5-70KAUJVz0ZvZ19C3Pz7wmotSdrs,4857
197
197
  reconcile/external_resources/integration.py,sha256=y1gJ16woMBC3J9qniMmS5y3lCkAs7V_ETZRUwjKqaO0,6628
198
198
  reconcile/external_resources/integration_secrets_sync.py,sha256=cMEZhgCvABAMf-DWF051L6CRnJQdfbsISA_b1xuS940,1670
199
- reconcile/external_resources/manager.py,sha256=AvBYpC4p2BaGrxYEV1ut3V2FtJfs1h2z0Vk8Px6dCaQ,15641
199
+ reconcile/external_resources/manager.py,sha256=cs6QEirz9EaLiuxybZ_1ugUn61vNWlKAC4NKouqpd5I,16148
200
200
  reconcile/external_resources/meta.py,sha256=noaytFzmShpzLA_ebGh7wuP45mOfHIOnnoUxivjDa1I,672
201
- reconcile/external_resources/metrics.py,sha256=Ihhe39BX0h2w7eLvvdijJuCXjj-f7w1E3MfDL0YiGNU,668
201
+ reconcile/external_resources/metrics.py,sha256=jsN3IF78Su23d3Qp4BTKXkgZPN6AKjdS8sZFEXmYCek,863
202
202
  reconcile/external_resources/model.py,sha256=UuQgrnv-SSkvSEQQGeCE2IZkhXjLTCVkP_mw8zBZsIQ,8349
203
203
  reconcile/external_resources/reconciler.py,sha256=3KFmkHsN7YAwJUSBpN1Xd_D2zM9Ea5_c2uMGWsfruZo,9707
204
204
  reconcile/external_resources/secrets_sync.py,sha256=6n0oDPLjd9Ql0lf6zsr1AZw8A6EEe3yCzl20XodtgkE,16229
@@ -869,8 +869,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
869
869
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
870
870
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
871
871
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
872
- qontract_reconcile-0.10.1rc1117.dist-info/METADATA,sha256=eFQI6iom-hmLWzKt9WhHMix-S8ijZ1vRdMmH0hVXCjw,2213
873
- qontract_reconcile-0.10.1rc1117.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
874
- qontract_reconcile-0.10.1rc1117.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
875
- qontract_reconcile-0.10.1rc1117.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
876
- qontract_reconcile-0.10.1rc1117.dist-info/RECORD,,
872
+ qontract_reconcile-0.10.1rc1119.dist-info/METADATA,sha256=1GY523CTqDMLC8c80r56VSDiAn0dyKrkGnIH4b81HlE,2213
873
+ qontract_reconcile-0.10.1rc1119.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
874
+ qontract_reconcile-0.10.1rc1119.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
875
+ qontract_reconcile-0.10.1rc1119.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
876
+ qontract_reconcile-0.10.1rc1119.dist-info/RECORD,,
@@ -50,6 +50,7 @@ class ChangeLog:
50
50
  class ChangeLogIntegrationParams(PydanticRunParams):
51
51
  gitlab_project_id: str
52
52
  process_existing: bool = False
53
+ commit: str | None = None
53
54
 
54
55
 
55
56
  class ChangeLogIntegration(QontractReconcileIntegration[ChangeLogIntegrationParams]):
@@ -105,6 +106,8 @@ class ChangeLogIntegration(QontractReconcileIntegration[ChangeLogIntegrationPara
105
106
  for item in diff_state.ls():
106
107
  key = item.lstrip("/")
107
108
  commit = key.rstrip(".json")
109
+ if self.params.commit and self.params.commit != commit:
110
+ continue
108
111
  if not self.params.process_existing:
109
112
  existing_change_log_item = next(
110
113
  (i for i in existing_change_log_items if i.commit == commit), None
reconcile/cli.py CHANGED
@@ -3564,8 +3564,9 @@ def change_owners(
3564
3564
  default=False,
3565
3565
  help="wait for pending/running pipelines before acting.",
3566
3566
  )
3567
+ @click.option("--commit", help="Reconcile just this commit.", default=None)
3567
3568
  @click.pass_context
3568
- def change_log_tracking(ctx, gitlab_project_id, process_existing):
3569
+ def change_log_tracking(ctx, gitlab_project_id, process_existing, commit):
3569
3570
  from reconcile.change_owners.change_log_tracking import (
3570
3571
  ChangeLogIntegration,
3571
3572
  ChangeLogIntegrationParams,
@@ -3576,6 +3577,7 @@ def change_log_tracking(ctx, gitlab_project_id, process_existing):
3576
3577
  ChangeLogIntegrationParams(
3577
3578
  gitlab_project_id=gitlab_project_id,
3578
3579
  process_existing=process_existing,
3580
+ commit=commit,
3579
3581
  )
3580
3582
  ),
3581
3583
  ctx=ctx.obj,
@@ -16,6 +16,7 @@ from reconcile.external_resources.factories import (
16
16
  from reconcile.external_resources.metrics import (
17
17
  ExternalResourcesReconcileErrorsCounter,
18
18
  ExternalResourcesReconcileTimeGauge,
19
+ ExternalResourcesResourceStatus,
19
20
  )
20
21
  from reconcile.external_resources.model import (
21
22
  Action,
@@ -212,7 +213,7 @@ class ExternalResourcesManager:
212
213
  return to_reconcile
213
214
 
214
215
  def _update_in_progress_state(
215
- self, r: Reconciliation, state: ExternalResourceState
216
+ self, r: Reconciliation, state: ExternalResourceState, job_name: str
216
217
  ) -> bool:
217
218
  """Gets the resource reconciliation state from the Job and updates the
218
219
  Resource state accordingly. It also returns if the target outputs secret needs
@@ -238,7 +239,6 @@ class ExternalResourcesManager:
238
239
 
239
240
  # Need to check the reconciliation set in the state, not the desired one
240
241
  # as the reconciliation object might be from a previous desired state
241
- job_name = ReconciliationK8sJob(reconciliation=r).name()
242
242
  error = False
243
243
  match self.reconciler.get_resource_reconcile_status(state.reconciliation):
244
244
  case ReconcileStatus.SUCCESS:
@@ -291,7 +291,6 @@ class ExternalResourcesManager:
291
291
  job_name=job_name,
292
292
  )
293
293
  )
294
-
295
294
  return need_secret_sync
296
295
 
297
296
  def _update_state(self, r: Reconciliation, state: ExternalResourceState) -> None:
@@ -353,7 +352,8 @@ class ExternalResourcesManager:
353
352
  to_sync_keys: set[ExternalResourceKey] = set()
354
353
  for r in desired_r.union(deleted_r):
355
354
  state = self.state_mgr.get_external_resource_state(r.key)
356
- need_sync = self._update_in_progress_state(r, state)
355
+ job_name = ReconciliationK8sJob(reconciliation=r).name()
356
+ need_sync = self._update_in_progress_state(r, state, job_name)
357
357
  if need_sync:
358
358
  to_sync_keys.add(r.key)
359
359
 
@@ -361,6 +361,18 @@ class ExternalResourcesManager:
361
361
  self.reconciler.reconcile_resource(reconciliation=r)
362
362
  self._update_state(r, state)
363
363
 
364
+ metrics.set_gauge(
365
+ ExternalResourcesResourceStatus(
366
+ provision_provider=r.key.provision_provider,
367
+ provisioner_name=r.key.provisioner_name,
368
+ provider=r.key.provider,
369
+ identifier=r.key.identifier,
370
+ job_name=job_name,
371
+ status=state.resource_status,
372
+ ),
373
+ 1,
374
+ )
375
+
364
376
  pending_sync_keys = self.state_mgr.get_keys_by_status(
365
377
  ResourceStatus.PENDING_SECRET_SYNC
366
378
  )
@@ -24,3 +24,11 @@ class ExternalResourcesReconcileTimeGauge(ExternalResourcesBaseMetric, GaugeMetr
24
24
  @classmethod
25
25
  def name(cls) -> str:
26
26
  return "external_resources_reconcile_time"
27
+
28
+
29
+ class ExternalResourcesResourceStatus(ExternalResourcesBaseMetric, GaugeMetric):
30
+ status: str
31
+
32
+ @classmethod
33
+ def name(cls) -> str:
34
+ return "external_resources_resource_status"