qontract-reconcile 0.10.1rc197__py3-none-any.whl → 0.10.1rc199__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.1rc197
3
+ Version: 0.10.1rc199
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
@@ -33,7 +33,7 @@ reconcile/gitlab_permissions.py,sha256=ciEKj_wnRbS_vs_ZwcUeD6HkWVe3osAuotFqJSmvd
33
33
  reconcile/gitlab_projects.py,sha256=K3tFf_aD1W4Ijp5q-9Qek3kwFGEWPcZ1kd7tzFJ4GyQ,1781
34
34
  reconcile/integrations_manager.py,sha256=zUCh1bYrnNoT_6SSQO-yYA2QdDxfCuzwb1tjcByIOaE,8885
35
35
  reconcile/jenkins_base.py,sha256=0Gocu3fU2YTltaxBlbDQOUvP-7CP2OSQV1ZRwtWeVXw,875
36
- reconcile/jenkins_job_builder.py,sha256=tfar8m5dyYlOZxgoMBvs1Woa698PftZCrCsvTzL3tLg,3930
36
+ reconcile/jenkins_job_builder.py,sha256=8mcvvkPvcgw0hZnYTcuh9P-ltSHwqg8zihXh7oxGuzI,3957
37
37
  reconcile/jenkins_job_builds_cleaner.py,sha256=zK8gQgXY5Ab5aDk8yPiXg0ogUEBOGmbyo8wEEtK342k,3190
38
38
  reconcile/jenkins_job_cleaner.py,sha256=8DetVJsUFf68ZtUwaO9Vg9ohAsua2uA0Q6ykI4j3K0w,1794
39
39
  reconcile/jenkins_roles.py,sha256=hOLPiPs2Juv7l8mGBj5-e88DqgvLbLldf0Xk0ylUzHE,4577
@@ -510,7 +510,7 @@ reconcile/utils/instrumented_wrappers.py,sha256=eVwMoa6FCrYxLv3RML3WpZF9qKVfCTjM
510
510
  reconcile/utils/jenkins_api.py,sha256=BlHOUDG3Nn5K4qPU-js2ewV_IhciISfCnQwfaZlewu8,7054
511
511
  reconcile/utils/jinja2_ext.py,sha256=l628RR9r9dAGBWLVegoCbSqnjojeizNGiq9Cstt02nE,1129
512
512
  reconcile/utils/jira_client.py,sha256=pQw4LKZL5d-Guaj4BMiIVrL6EZsmAMYII1-b8xYZ8Yk,5021
513
- reconcile/utils/jjb_client.py,sha256=bj40UNRbvQ93K-1tndzJI6Drt_sebRXq-qUpfDx2ozw,14496
513
+ reconcile/utils/jjb_client.py,sha256=0kpEsLI-cN-k-J_79x-NR2nr_h0Hz74GC9st7XVpX88,14682
514
514
  reconcile/utils/jsonpath.py,sha256=NRpAEijKN4cMDjo7qivNPqpm0__GQQ1TiE0PBEBO45s,5572
515
515
  reconcile/utils/jump_host.py,sha256=yJZBRnoCJ-fknhT9f_cli_1J5hBRh1PsRVDyDWpjhws,4935
516
516
  reconcile/utils/keycloak.py,sha256=tGOzfmG7wyOGUV8fn6XMrFWB1QAI02_3jf_8GCo5bKI,3144
@@ -530,7 +530,7 @@ reconcile/utils/output.py,sha256=htcMXMe0y2dNnwu8MW8x0JZ5YBaEJRy5w4tR8yLF0OU,173
530
530
  reconcile/utils/pagerduty_api.py,sha256=ckZZMn_ri7mUFsmMb8Lejuw5Lf_0-OWv8MbOzPc2zkQ,7567
531
531
  reconcile/utils/parse_dhms_duration.py,sha256=ZJGlB43MjhgckgO3OF_nacwTiKVRpxb5Yv7m-PnaQLk,1616
532
532
  reconcile/utils/password_validator.py,sha256=XwuWg-8CPlcuG7dl_oQ1G1h2gSVSnfMym_VkuprpWVg,2183
533
- reconcile/utils/promotion_state.py,sha256=OIxVOsmIMp22V5m2Lt-SdalJXMkLzg23EN2XxVGTHJ8,3987
533
+ reconcile/utils/promotion_state.py,sha256=nnoQIwg89Oil37WBY0KrdBbq7znHKyZWLoN91xedjJc,3740
534
534
  reconcile/utils/promtool.py,sha256=IYNCjj5xDAEdxv6Z0pLdrIcybDfHHtWE9Z6f4LSPcG4,2791
535
535
  reconcile/utils/quay_api.py,sha256=EuOegpb-7ntEjkKLFwM2Oo4Nw7SyFtmyl3sQ9aXMtrM,8152
536
536
  reconcile/utils/raw_github_api.py,sha256=ZHC-SZuAyRe1zaMoOU7Krt1-zecDxENd9c_NzQYqK9g,2968
@@ -612,8 +612,8 @@ tools/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
612
612
  tools/test/test_qontract_cli.py,sha256=awwTHEc2DWlykuqGIYM0WOBoSL0KRnOraCLk3C7izis,1401
613
613
  tools/test/test_sd_app_sre_alert_report.py,sha256=JeLhgzpKCPgLvptwg_4ZvJHLVWKNG1T5845HXTkMBxA,1826
614
614
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
615
- qontract_reconcile-0.10.1rc197.dist-info/METADATA,sha256=5wRolgRrcQ5khN7NZ4bC-J6CL_MIKV66l3u_Wj-sMJI,2320
616
- qontract_reconcile-0.10.1rc197.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
617
- qontract_reconcile-0.10.1rc197.dist-info/entry_points.txt,sha256=Af70EWPJxsTiCNF6gA-pWdw1A0Heqn-PZF-oBc5NmiU,302
618
- qontract_reconcile-0.10.1rc197.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
619
- qontract_reconcile-0.10.1rc197.dist-info/RECORD,,
615
+ qontract_reconcile-0.10.1rc199.dist-info/METADATA,sha256=LpCVban2xudrlx6MYnsN5BqsQDySsC9njyXLe6mP7vM,2320
616
+ qontract_reconcile-0.10.1rc199.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
617
+ qontract_reconcile-0.10.1rc199.dist-info/entry_points.txt,sha256=Af70EWPJxsTiCNF6gA-pWdw1A0Heqn-PZF-oBc5NmiU,302
618
+ qontract_reconcile-0.10.1rc199.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
619
+ qontract_reconcile-0.10.1rc199.dist-info/RECORD,,
@@ -20,6 +20,9 @@ QUERY = """
20
20
  {
21
21
  jenkins_configs: jenkins_configs_v1 {
22
22
  name
23
+ app {
24
+ name
25
+ }
23
26
  instance {
24
27
  name
25
28
  serverUrl
@@ -77,8 +77,12 @@ class JJB: # pylint: disable=too-many-public-methods
77
77
  config = c["config"]
78
78
  config_file_path = "{}/config.yaml".format(working_dirs[instance_name])
79
79
  if config:
80
+ content = yaml.load(config, Loader=yaml.FullLoader)
81
+ if c["type"] == "jobs":
82
+ for item in content:
83
+ item["project"]["app_name"] = c["app"]["name"]
80
84
  with open(config_file_path, "a") as f:
81
- yaml.dump(yaml.load(config, Loader=yaml.FullLoader), f)
85
+ yaml.dump(content, f)
82
86
  f.write("\n")
83
87
  else:
84
88
  config = c["config_path"]["content"]
@@ -81,6 +81,13 @@ class PromotionState:
81
81
  # Lets reduce unecessary calls to S3
82
82
  return None
83
83
 
84
+ path_v2 = f"promotions_v2/{channel}/{target_uid}/{sha}"
85
+ try:
86
+ data = self._state.get(path_v2)
87
+ return PromotionData(**data)
88
+ except KeyError:
89
+ pass
90
+
84
91
  # BACKWARDS-COMPAT BLOCK
85
92
  # Keep for backwards-compatibility with v1 promotions
86
93
  # We wait a couple of months to be sure all pipelines have
@@ -90,25 +97,13 @@ class PromotionState:
90
97
  try:
91
98
  data = self._state.get(path_v1)
92
99
  return PromotionData(**data)
93
- except KeyError:
94
- pass
95
- # / BACKWARDS-COMPAT BLOCK
96
-
97
- path_v2 = f"promotions_v2/{channel}/{target_uid}/{sha}"
98
- try:
99
- data = self._state.get(path_v2)
100
- return PromotionData(**data)
101
100
  except KeyError:
102
101
  return None
102
+ # / BACKWARDS-COMPAT BLOCK
103
103
 
104
104
  def publish_promotion_data(
105
105
  self, sha: str, channel: str, target_uid: str, data: PromotionData
106
106
  ) -> None:
107
- # TODO: this will be deprecated once we fully moved to promotions_v2
108
- state_key = f"promotions/{channel}/{sha}"
109
- self._state.add(state_key, data.dict(), force=True)
110
- logging.info("Uploaded %s to %s", data, state_key)
111
-
112
107
  state_key_v2 = f"promotions_v2/{channel}/{target_uid}/{sha}"
113
108
  self._state.add(state_key_v2, data.dict(), force=True)
114
109
  logging.info("Uploaded %s to %s", data, state_key_v2)