qontract-reconcile 0.10.1rc1008__py3-none-any.whl → 0.10.1rc1010__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.1rc1008
3
+ Version: 0.10.1rc1010
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
@@ -765,7 +765,7 @@ reconcile/utils/membershipsources/resolver.py,sha256=meERrCZqeVJZR2lHdZEznaZDsCs
765
765
  reconcile/utils/merge_request_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
766
766
  reconcile/utils/merge_request_manager/merge_request_manager.py,sha256=3EP6Yw_zB7nY0OkU8D_32nDqta1TITgtRI0cSmOlNQg,3332
767
767
  reconcile/utils/merge_request_manager/parser.py,sha256=5pGoz8Q6EuYXlUc1z-D0FahdRP2YLO8CpACoa9HcgtQ,2098
768
- reconcile/utils/mr/__init__.py,sha256=JQS8xmLZdG4TgjAFZp2ltuV9c1sDFHIHJmpn1bkY9rM,2386
768
+ reconcile/utils/mr/__init__.py,sha256=uvqxcp-uSlJExaH00XNCX9DSvA57jHTlPTg5dbZ_xvk,2487
769
769
  reconcile/utils/mr/app_interface_reporter.py,sha256=6Kpg93V9FvcOke9Jimkva359MQ-ZyBIkUpf8QIA6-to,1793
770
770
  reconcile/utils/mr/aws_access.py,sha256=w-UJutB_OfBJOvr-gsPzhtBPkDfKcNZZWGGuI9cN3HI,2605
771
771
  reconcile/utils/mr/base.py,sha256=TP6xaxznxsF_v2KcC_D3ut1cX_4KCcx4pjIC1-4eZUY,7307
@@ -775,6 +775,7 @@ reconcile/utils/mr/labels.py,sha256=9QRTRjZAtq45zELd9SwavaraczMjwjn5no3RK1YxFTg,
775
775
  reconcile/utils/mr/notificator.py,sha256=cp80wFzu_ZzrJPye7L1pI0H6JRGb7hOGuNxJYUq4Yr8,2967
776
776
  reconcile/utils/mr/ocm_update_recommended_version.py,sha256=p_aVP0TGrlKk9WBwgQnYWqUDsED_Hg6G5Bqj0UvtRwA,1536
777
777
  reconcile/utils/mr/ocm_upgrade_scheduler_org_updates.py,sha256=ojnIjw-8vRnmCCxOGBOEgPZLH4nC1hcuef74LWw2Rpk,3004
778
+ reconcile/utils/mr/promote_qontract.py,sha256=AgA7AXizYvUoycLMZb1zaa4BCLi4stsokWfEH4B0eWY,1266
778
779
  reconcile/utils/mr/user_maintenance.py,sha256=cHPBn8zrReWLHalyk-EFdkFJe9zjVjRoZhT4t2zZfGE,3956
779
780
  reconcile/utils/ocm/__init__.py,sha256=xv7CJp7K9LCQfa4gL_W0MMCOD1P4qOy8t5aZj1xXNUE,808
780
781
  reconcile/utils/ocm/addons.py,sha256=_LDdJ-gapM3s5exKlIUt-MlXZTAUoHezbYBU0QmvfWQ,7335
@@ -807,7 +808,7 @@ reconcile/utils/runtime/sharding.py,sha256=r0ieUtNed7NvknSw6qQrCkKpVXE1shuHGnfFc
807
808
  reconcile/utils/saasherder/__init__.py,sha256=J3MBZBFa5YmhqYm08QsjBXz8mFcVOCiOCkyIcw41t7E,343
808
809
  reconcile/utils/saasherder/interfaces.py,sha256=C2wrw34OXypshVocAsPrVZsSHptgw4g9u7Haa2wulZQ,9087
809
810
  reconcile/utils/saasherder/models.py,sha256=z8ln03zi2a8cu716NcNUDHp8Dv1VcVbhqdWVxCl7x9A,10148
810
- reconcile/utils/saasherder/saasherder.py,sha256=vaTQtDrJdm5wU8z0ROqEI-ewbzCkKAlHsEpP01Royvg,85048
811
+ reconcile/utils/saasherder/saasherder.py,sha256=rTsBaQrCY7StLWkkHnMLVil8luLMsZ9hRED6SDw4Cds,85698
811
812
  reconcile/utils/terraform/__init__.py,sha256=zNbiyTWo35AT1sFTElL2j_AA0jJ_yWE_bfFn-nD2xik,250
812
813
  reconcile/utils/terraform/config.py,sha256=5UVrd563TMcvi4ooa5JvWVDW1I3bIWg484u79evfV_8,164
813
814
  reconcile/utils/terraform/config_client.py,sha256=gRL1rQ0AqvShei_rcGqC3HDYGskOFKE1nPrJyJE9yno,4676
@@ -858,8 +859,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
858
859
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
859
860
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
860
861
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
861
- qontract_reconcile-0.10.1rc1008.dist-info/METADATA,sha256=VmMKYU9MT90uAli1QKXS-ONvBiTqQC9yJ8yyltbFB0I,2263
862
- qontract_reconcile-0.10.1rc1008.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
863
- qontract_reconcile-0.10.1rc1008.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
864
- qontract_reconcile-0.10.1rc1008.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
865
- qontract_reconcile-0.10.1rc1008.dist-info/RECORD,,
862
+ qontract_reconcile-0.10.1rc1010.dist-info/METADATA,sha256=7cFnKb9RaHgWUrwtmYqUUsZ2MHpPoQNg5MZJ6U8U8Qg,2263
863
+ qontract_reconcile-0.10.1rc1010.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
864
+ qontract_reconcile-0.10.1rc1010.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
865
+ qontract_reconcile-0.10.1rc1010.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
866
+ qontract_reconcile-0.10.1rc1010.dist-info/RECORD,,
@@ -12,6 +12,7 @@ from reconcile.utils.mr.ocm_update_recommended_version import (
12
12
  from reconcile.utils.mr.ocm_upgrade_scheduler_org_updates import (
13
13
  CreateOCMUpgradeSchedulerOrgUpdates,
14
14
  )
15
+ from reconcile.utils.mr.promote_qontract import PromoteQontractSchemas
15
16
  from reconcile.utils.mr.user_maintenance import (
16
17
  CreateDeleteUserAppInterface,
17
18
  CreateDeleteUserInfra,
@@ -29,6 +30,7 @@ __all__ = [
29
30
  "CreateAppInterfaceNotificator",
30
31
  "CreateDeleteUserAppInterface",
31
32
  "CreateDeleteUserInfra",
33
+ "PromoteQontractSchemas",
32
34
  ]
33
35
 
34
36
 
@@ -0,0 +1,41 @@
1
+ from reconcile.utils.gitlab_api import GitLabApi
2
+ from reconcile.utils.mr.base import MergeRequestBase
3
+
4
+
5
+ class PromoteQontractSchemas(MergeRequestBase):
6
+ name = "promote_qontract_schemas"
7
+
8
+ def __init__(self, version: str):
9
+ self.path = ".env"
10
+ self.version = version
11
+
12
+ super().__init__()
13
+
14
+ self.labels = []
15
+
16
+ @property
17
+ def title(self) -> str:
18
+ return f"[{self.name}] promote qontract-schemas to version {self.version}"
19
+
20
+ @property
21
+ def description(self) -> str:
22
+ return f"promote qontract-schemas to version {self.version}"
23
+
24
+ def process(self, gitlab_cli: GitLabApi) -> None:
25
+ raw_file = gitlab_cli.project.files.get(
26
+ file_path=self.path, ref=gitlab_cli.main_branch
27
+ )
28
+ content = raw_file.decode().decode("utf-8")
29
+ lines = content.splitlines()
30
+ for index, text in enumerate(lines):
31
+ if text.startswith("export SCHEMAS_IMAGE_TAG="):
32
+ lines[index] = f"export SCHEMAS_IMAGE_TAG={self.version}"
33
+
34
+ new_content = "\n".join(lines) + "\n"
35
+
36
+ gitlab_cli.update_file(
37
+ branch_name=self.branch,
38
+ file_path=self.path,
39
+ commit_message=self.description,
40
+ content=new_content,
41
+ )
@@ -1947,6 +1947,21 @@ class SaasHerder: # pylint: disable=too-many-public-methods
1947
1947
  if current_state and current_state.has_succeeded_once:
1948
1948
  has_succeeded_once = True
1949
1949
 
1950
+ check_in = str(now)
1951
+ if (
1952
+ success
1953
+ and current_state
1954
+ and current_state.check_in
1955
+ and current_state.success
1956
+ ):
1957
+ # We want to avoid an override of the timestamp.
1958
+ # This can happen on re-deployments of the same ref.
1959
+ # We only re-use the check_in time if the previous
1960
+ # and current deployment was successful.
1961
+ # On unsuccessful deployments, we
1962
+ # update the check_in time to current time.
1963
+ check_in = current_state.check_in
1964
+
1950
1965
  # publish to state to pass promotion gate
1951
1966
  self._promotion_state.publish_promotion_data(
1952
1967
  sha=promotion.commit_sha,
@@ -1957,8 +1972,7 @@ class SaasHerder: # pylint: disable=too-many-public-methods
1957
1972
  success=success,
1958
1973
  target_config_hash=promotion.target_config_hash,
1959
1974
  has_succeeded_once=has_succeeded_once,
1960
- # TODO: do not override - check if timestamp already exists
1961
- check_in=str(now),
1975
+ check_in=check_in,
1962
1976
  ),
1963
1977
  )
1964
1978
  logging.info(