qontract-reconcile 0.10.1rc1110__py3-none-any.whl → 0.10.1rc1112__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.1rc1110
3
+ Version: 0.10.1rc1112
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
@@ -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=vNStA0B7LjI56K9AGFNsN0sb47KlTvEhCFCbhIzc4sQ,7714
164
+ reconcile/change_owners/change_log_tracking.py,sha256=QuXVWIfLMasGDe_9f_IJnDSf-iHed10bv0S_x43YxXc,7771
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=qdw4ZxOVbTzSATxmLUtJ9HA6BZXwxkHfQljrWv-Q8sU,18244
@@ -676,14 +676,14 @@ reconcile/utils/extended_early_exit.py,sha256=QSktrmfw37zSRMNk930tDbQsVeKxaPPPD4
676
676
  reconcile/utils/external_resource_spec.py,sha256=bhH_xneFwATdFumTPkiQmcVKYI0gcaWuqV6FpFdf_P0,7006
677
677
  reconcile/utils/external_resources.py,sha256=GC4wYuSXwk2ifr3aDEwnEiumaYqWhzgKK-hXp6pXemA,7516
678
678
  reconcile/utils/filtering.py,sha256=S4PbMHuFr3ED0P2Q_ea5CAaB7FimI62B-F5YTaKrphA,402
679
- reconcile/utils/git.py,sha256=JkpbUO10oBTtNHZ1IhjyG6dTOUizc7I5H0vm7NvDVNw,1409
679
+ reconcile/utils/git.py,sha256=wzVIYAeKlMGW538U1mkJWUI6h_mFRUY4lawh2AR8hw4,2345
680
680
  reconcile/utils/git_secrets.py,sha256=y1rEhwA8DyDpBSAEuhMS7Y2X3mpxT2zQ4zyDFkhLe_g,1936
681
681
  reconcile/utils/github_api.py,sha256=R8OvqyPdnRqvP-Efnv9RvIcbBlb4M0KC4RlbnJMD0Tg,2426
682
682
  reconcile/utils/gitlab_api.py,sha256=C1nsHQKKybsmFdaG9vsItBjJm69ym4VWbqbKfAEf7oY,29305
683
683
  reconcile/utils/gpg.py,sha256=EKG7_fdMv8BMlV5yUdPiqoTx-KrzmVSEAl2sLkaKwWI,1123
684
684
  reconcile/utils/gql.py,sha256=C0thIm_k9MBldfqwHzyqtYZk9sIvMdm9IbbnXLGwjD8,14158
685
685
  reconcile/utils/grouping.py,sha256=vr9SFHZ7bqmHYrvYcEZt-Er3-yQYfAAdq5sHLZVmXPY,456
686
- reconcile/utils/helm.py,sha256=cbvmmdjtfPfHhD5SPqf922P6IKO4Ll9FYiCAIRfQtTk,3830
686
+ reconcile/utils/helm.py,sha256=hr4J_9mBZwbc1FDNfFh4QKAj0h3eLxyTN2Y3UxIRp8U,3893
687
687
  reconcile/utils/helpers.py,sha256=k9svgFFZG7H5FvHYY0g5jJyvgvh2UDZxf0Ib221teag,1179
688
688
  reconcile/utils/imap_client.py,sha256=h8YDiCSCvroErhpH_-KGYI7Y2WU2Q2oSpuxDFbOkSbY,1989
689
689
  reconcile/utils/instrumented_wrappers.py,sha256=eVwMoa6FCrYxLv3RML3WpZF9qKVfCTjMxphgVXG03OM,1073
@@ -819,7 +819,7 @@ reconcile/utils/runtime/sharding.py,sha256=r0ieUtNed7NvknSw6qQrCkKpVXE1shuHGnfFc
819
819
  reconcile/utils/saasherder/__init__.py,sha256=3U8plqMAPRE1kjwZ5YnIsYsggTf4_gS7flRUEuXVBAs,343
820
820
  reconcile/utils/saasherder/interfaces.py,sha256=C2wrw34OXypshVocAsPrVZsSHptgw4g9u7Haa2wulZQ,9087
821
821
  reconcile/utils/saasherder/models.py,sha256=z8ln03zi2a8cu716NcNUDHp8Dv1VcVbhqdWVxCl7x9A,10148
822
- reconcile/utils/saasherder/saasherder.py,sha256=dG7Qw4lMkU-3YMKZDNnXBdJQV9kdfVe984R_8iwR_eU,85333
822
+ reconcile/utils/saasherder/saasherder.py,sha256=t7dqcXj9FFULROG_gUmdoSNQOLKfhdlquzwxw710yOA,85358
823
823
  reconcile/utils/terraform/__init__.py,sha256=zNbiyTWo35AT1sFTElL2j_AA0jJ_yWE_bfFn-nD2xik,250
824
824
  reconcile/utils/terraform/config.py,sha256=5UVrd563TMcvi4ooa5JvWVDW1I3bIWg484u79evfV_8,164
825
825
  reconcile/utils/terraform/config_client.py,sha256=gRL1rQ0AqvShei_rcGqC3HDYGskOFKE1nPrJyJE9yno,4676
@@ -870,8 +870,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
870
870
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
871
871
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
872
872
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
873
- qontract_reconcile-0.10.1rc1110.dist-info/METADATA,sha256=_zirPDusBEjVZlm4_iZZ18epfv7-X0dL3liL66u5o8M,2213
874
- qontract_reconcile-0.10.1rc1110.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
875
- qontract_reconcile-0.10.1rc1110.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
876
- qontract_reconcile-0.10.1rc1110.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
877
- qontract_reconcile-0.10.1rc1110.dist-info/RECORD,,
873
+ qontract_reconcile-0.10.1rc1112.dist-info/METADATA,sha256=jkBPZb4lP4Bc1Mkkf2qwJBozeU5pM6FhMy6qy3vCsz8,2213
874
+ qontract_reconcile-0.10.1rc1112.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
875
+ qontract_reconcile-0.10.1rc1112.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
876
+ qontract_reconcile-0.10.1rc1112.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
877
+ qontract_reconcile-0.10.1rc1112.dist-info/RECORD,,
@@ -153,6 +153,7 @@ class ChangeLogIntegration(QontractReconcileIntegration[ChangeLogIntegrationPara
153
153
  | "/openshift/namespace-1.yml"
154
154
  | "/dependencies/jenkins-config-1.yml"
155
155
  | "/dependencies/status-page-component-1.yml"
156
+ | "/app-sre/app-changelog-1.yml"
156
157
  ):
157
158
  changed_apps = {
158
159
  name
reconcile/utils/git.py CHANGED
@@ -19,11 +19,45 @@ def clone(repo_url, wd, depth=None, verify=True):
19
19
  raise GitError(f"git clone failed: {repo_url}")
20
20
 
21
21
 
22
- def checkout(commit, wd):
23
- cmd = ["git", "checkout", commit]
24
- result = subprocess.run(cmd, cwd=wd, capture_output=True, check=False)
22
+ def rev_parse(ref: str, wd: str) -> str:
23
+ cmd = ["git", "rev-parse", ref]
24
+ result = subprocess.run(cmd, cwd=wd, capture_output=True, text=True, check=True)
25
+ return result.stdout.strip()
26
+
27
+
28
+ def is_current_ref(ref: str, wd: str) -> bool:
29
+ return rev_parse("HEAD", wd) == rev_parse(ref, wd)
30
+
31
+
32
+ def fetch(
33
+ ref: str,
34
+ wd: str,
35
+ remote: str = "origin",
36
+ depth: int | None = None,
37
+ verify: bool = True,
38
+ ):
39
+ cmd = ["git"]
40
+ if not verify:
41
+ cmd += ["-c", "http.sslVerify=false"]
42
+ cmd += ["fetch", remote, ref]
43
+ if depth:
44
+ cmd += ["--depth", str(depth)]
45
+ result = subprocess.run(cmd, cwd=wd, capture_output=True, text=True, check=False)
46
+ if result.returncode != 0:
47
+ raise GitError(f"git fetch failed for {ref}: {result.stderr}")
48
+
49
+
50
+ def checkout(
51
+ ref: str,
52
+ wd: str,
53
+ verify: bool = True,
54
+ ):
55
+ if not is_current_ref(ref, wd):
56
+ fetch(ref, wd, depth=1, verify=verify)
57
+ cmd = ["git", "checkout", ref]
58
+ result = subprocess.run(cmd, cwd=wd, capture_output=True, text=True, check=False)
25
59
  if result.returncode != 0:
26
- raise GitError(f"git checkout failed: {commit}")
60
+ raise GitError(f"git checkout failed for {ref}: {result.stderr}")
27
61
 
28
62
 
29
63
  def is_file_in_git_repo(file_path):
reconcile/utils/helm.py CHANGED
@@ -108,12 +108,14 @@ def template(
108
108
  def template_all(
109
109
  url: str,
110
110
  path: str,
111
+ ref: str,
111
112
  namespace: str,
112
113
  values: Mapping[str, Any],
113
114
  ssl_verify: bool = True,
114
115
  ) -> Iterable[Mapping[str, Any]]:
115
116
  with tempfile.TemporaryDirectory() as wd:
116
117
  git.clone(url, wd, depth=1, verify=ssl_verify)
118
+ git.checkout(ref, wd, verify=ssl_verify)
117
119
  return yaml.safe_load_all(
118
120
  do_template(values=values, path=f"{wd}{path}", namespace=namespace)
119
121
  )
@@ -979,6 +979,7 @@ class SaasHerder: # pylint: disable=too-many-public-methods
979
979
  resources = helm.template_all(
980
980
  url=url,
981
981
  path=path,
982
+ ref=ref,
982
983
  namespace=spec.target.namespace.name,
983
984
  values=consolidated_parameters,
984
985
  ssl_verify=ssl_verify,