qontract-reconcile 0.10.1rc833__py3-none-any.whl → 0.10.1rc834__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.1rc833
3
+ Version: 0.10.1rc834
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
@@ -420,7 +420,7 @@ reconcile/saas_auto_promotions_manager/integration.py,sha256=8IXLEvpblgZRr2UPfTs
420
420
  reconcile/saas_auto_promotions_manager/meta.py,sha256=76Jp50r6Y_KyJoXFfSjrt5YrCtXyg_A4FXXxHYiS3TE,161
421
421
  reconcile/saas_auto_promotions_manager/publisher.py,sha256=am8b0uLZIhWjSAgUHPtSOu2fRpa5wXaMl_WnVe4gv2k,3009
422
422
  reconcile/saas_auto_promotions_manager/s3_exporter.py,sha256=IKlVWZmiPnvl7sKeF6JgAlhXZe5CovKTxQc0SNkNSx4,2583
423
- reconcile/saas_auto_promotions_manager/subscriber.py,sha256=SL-LsUhdhOLnlSremXStIlpVCZx-0zLcTkxSJPIScdQ,10338
423
+ reconcile/saas_auto_promotions_manager/subscriber.py,sha256=gz6l6xSeyYrs2KyEcXJoYbiH5JGSWE_T3VIqWl03A7k,10501
424
424
  reconcile/saas_auto_promotions_manager/merge_request_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
425
425
  reconcile/saas_auto_promotions_manager/merge_request_manager/batcher.py,sha256=lHIULPE8nmPN9pJVfZFdD0l48EB20o4cAy4owahJenw,7848
426
426
  reconcile/saas_auto_promotions_manager/merge_request_manager/desired_state.py,sha256=isY8frVsL3PlcdZmdZ4O0qyp76oczl4DUMX9uMArs5Y,1222
@@ -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.1rc833.dist-info/METADATA,sha256=WiY9GyFtzMyUhW54XPKPssR2mfN6z4na_hFP5Iw6NdQ,2275
816
- qontract_reconcile-0.10.1rc833.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
817
- qontract_reconcile-0.10.1rc833.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
818
- qontract_reconcile-0.10.1rc833.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
819
- qontract_reconcile-0.10.1rc833.dist-info/RECORD,,
815
+ qontract_reconcile-0.10.1rc834.dist-info/METADATA,sha256=GwMy-WLj9_4L9kW4KPlgRfD7XUInbC5v6Kn7gHcOVNg,2275
816
+ qontract_reconcile-0.10.1rc834.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
817
+ qontract_reconcile-0.10.1rc834.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
818
+ qontract_reconcile-0.10.1rc834.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
819
+ qontract_reconcile-0.10.1rc834.dist-info/RECORD,,
@@ -2,6 +2,7 @@ import hashlib
2
2
  import logging
3
3
  from collections.abc import Iterable, Mapping
4
4
  from dataclasses import dataclass
5
+ from datetime import datetime, timedelta, timezone
5
6
  from typing import Any, Optional
6
7
 
7
8
  from reconcile.gql_definitions.fragments.saas_target_namespace import (
@@ -152,18 +153,19 @@ class Subscriber:
152
153
  We accumulate the time a ref is running on all publishers for this subscriber.
153
154
  We compare that accumulated time with the soak_days setting of the subscriber.
154
155
  """
155
- # now = datetime.now(timezone.utc)
156
- # delta = timedelta(days=0)
157
- # for channel in self.channels:
158
- # for publisher in channel.publishers:
159
- # deployed_at = publisher.deployment_info_by_channel.get(
160
- # channel.name
161
- # ).check_in
162
- # if not deployed_at:
163
- # continue
164
- # delta += now - deployed_at
165
- # return delta >= timedelta(days=self.soak_days)
166
- return True
156
+ now = datetime.now(timezone.utc)
157
+ delta = timedelta(days=0)
158
+ for channel in self.channels:
159
+ for publisher in channel.publishers:
160
+ deploy_info = publisher.deployment_info_by_channel.get(channel.name)
161
+ if not deploy_info:
162
+ # At this stage we always expect a deploy_info to be present
163
+ return False
164
+ deployed_at = deploy_info.check_in
165
+ if not deployed_at:
166
+ continue
167
+ delta += now - deployed_at
168
+ return delta >= timedelta(days=self.soak_days)
167
169
 
168
170
  def _compute_desired_ref(self) -> None:
169
171
  """