qontract-reconcile 0.10.2.dev37__py3-none-any.whl → 0.10.2.dev39__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.4
2
2
  Name: qontract-reconcile
3
- Version: 0.10.2.dev37
3
+ Version: 0.10.2.dev39
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Project-URL: homepage, https://github.com/app-sre/qontract-reconcile
6
6
  Project-URL: repository, https://github.com/app-sre/qontract-reconcile
@@ -46,7 +46,7 @@ reconcile/jenkins_roles.py,sha256=HadmoNhgOoKMFZJmCe_Gdg0_a9k_1MuOXidtr801nUU,45
46
46
  reconcile/jenkins_webhooks.py,sha256=dzMT1ywXjeAo5sHj-ittW06Ed3beAUPjnc_oCAtD-Rg,2150
47
47
  reconcile/jenkins_webhooks_cleaner.py,sha256=JsN_NVPfZJwv1JtSzZXDIHUqGiefL-DRffFnDGau9aY,1539
48
48
  reconcile/jenkins_worker_fleets.py,sha256=L2wEXpd4xuEHrXGss4iH788nG8UlLSYduZe1EY2IVw4,5377
49
- reconcile/jira_permissions_validator.py,sha256=DCKUyaqwUcIN4BuNtdREQW44K9yFxa1RUuA8a-dzXFE,13336
49
+ reconcile/jira_permissions_validator.py,sha256=Sw7l-EMHwPk5HXA0LqOs2vmvDd-zraVHouUX1Ak2cVM,13524
50
50
  reconcile/jira_watcher.py,sha256=L_UL2MKm2SoIGNsCLThm28pnqCkoFc154JWsD6bURug,3593
51
51
  reconcile/ldap_users.py,sha256=7hdO5CAPl-VNBvDRmKHg13LoblHXXPt7YEKNGomAoGg,3158
52
52
  reconcile/mr_client_gateway.py,sha256=WhjMd-sIXDFCV8-rt8CEjurJ5OYB1pOD0K3o0tZRXQg,1885
@@ -195,7 +195,7 @@ reconcile/endpoints_discovery/integration.py,sha256=fzy5tv4c_6WoAZGGBNJ276NVNB1O
195
195
  reconcile/endpoints_discovery/merge_request.py,sha256=_yLb4tnvoZMCko8rta2C_CvOInJa9pa3HzSmHNtjgGU,2978
196
196
  reconcile/endpoints_discovery/merge_request_manager.py,sha256=wUMsumxv8RnWaRattax4HfoRlhtVzmgro3GiJJ1C4Vc,6392
197
197
  reconcile/external_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
198
- reconcile/external_resources/aws.py,sha256=NSaOeHqFEcMaMxNjJwuQZosolgsJ8XRVvwkEEBj9vrw,7730
198
+ reconcile/external_resources/aws.py,sha256=2vimGEtcwcIyVaFvt5Ab2PAAWu2hawJyCu4fuZWSobI,7783
199
199
  reconcile/external_resources/factories.py,sha256=ldvm3n13IdE899Ei850NSf0RQ35rzsKJBCUkROrbE5Y,5579
200
200
  reconcile/external_resources/integration.py,sha256=JF38M7R0Z4ADUTx57TZqSZH9k_xpPlbAxQAcGyIISuM,6925
201
201
  reconcile/external_resources/integration_secrets_sync.py,sha256=dX09O3r6KURziUYYfiki10orNjOGVma-XojhVqd0ww4,1667
@@ -215,7 +215,7 @@ reconcile/glitchtip_project_alerts/integration.py,sha256=BgMx-NyV9mTuv7Sotb2OioC
215
215
  reconcile/glitchtip_project_dsn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
216
216
  reconcile/glitchtip_project_dsn/integration.py,sha256=2iugub-kHYkHNK33n0v9_TeWonuxCPah_VkoTPvaajE,8077
217
217
  reconcile/gql_definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
218
- reconcile/gql_definitions/introspection.json,sha256=WWQ1wCVxaP7aNIvIttoxVfFtZkODTopzAUv_bCZVNR4,2217602
218
+ reconcile/gql_definitions/introspection.json,sha256=ErIjLKDbNw4SLyGXhp9iGmL1RSfT0U7gU1A3tsn1674,2217790
219
219
  reconcile/gql_definitions/acs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
220
220
  reconcile/gql_definitions/acs/acs_instances.py,sha256=L91WW9LbhJbBSrECqShQpFtjoBOsmNIYLRpMbx1io5o,2181
221
221
  reconcile/gql_definitions/acs/acs_policies.py,sha256=bN5i4mks10Z23KJSj7jqp966Osq2dps4d-sPH9gjxEA,7008
@@ -300,7 +300,7 @@ reconcile/gql_definitions/endpoints_discovery/apps.py,sha256=aBWRAwDUJQ32ghJS4cP
300
300
  reconcile/gql_definitions/external_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
301
301
  reconcile/gql_definitions/external_resources/aws_accounts.py,sha256=XR69j9dpTQ0gv8y-AZN7AJ0dPvO-wbHscyCDgrax6Bk,2046
302
302
  reconcile/gql_definitions/external_resources/external_resources_modules.py,sha256=cbbvGq1Te9DP8XiFg3bp4Y0q6LxpGYov8ugcROPyPLI,2647
303
- reconcile/gql_definitions/external_resources/external_resources_namespaces.py,sha256=iW8zsC0eFULUVBTW9i2OHh3o7BTHiQIdmrJSk4CmjMo,45335
303
+ reconcile/gql_definitions/external_resources/external_resources_namespaces.py,sha256=dW7RrIA9gAJS7AHQwHggsJXhlSVnX0jV1c4W9e7a7Jc,45393
304
304
  reconcile/gql_definitions/external_resources/external_resources_settings.py,sha256=K8m9EKlfIVGP2KyqTduo7MMSKFjVC3yk5ZfO9hgdA7A,3192
305
305
  reconcile/gql_definitions/fragments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
306
306
  reconcile/gql_definitions/fragments/aus_organization.py,sha256=uBKbTuBa3CZmTXR5HOcGhRcu2U9kM93KbYmoWTxcpB0,4767
@@ -323,7 +323,7 @@ reconcile/gql_definitions/fragments/prometheus_instance.py,sha256=12ltnV9kdEw6Ln
323
323
  reconcile/gql_definitions/fragments/resource_limits_requirements.py,sha256=ucskQ_a8RxvFl5-IWxz5kk3g4-5Pvh_W4N3nLmuKxi0,744
324
324
  reconcile/gql_definitions/fragments/resource_requests_requirements.py,sha256=TFKO4YALFPanSvZvIJFz0dCioBU7i73Q6hkDtGMvs9I,736
325
325
  reconcile/gql_definitions/fragments/resource_values.py,sha256=-N2lNRhWp8PgocmIeX3U9f3l90Q97N2lXoq1pXdb_LE,742
326
- reconcile/gql_definitions/fragments/saas_target_namespace.py,sha256=8kMXeD7u2bmdjn10zHmMJ80ScOhUp6KqSfWfjWZW-40,4001
326
+ reconcile/gql_definitions/fragments/saas_target_namespace.py,sha256=6f6WaerElaRi9_Ro-0CyWUkMHsbXlm0h9YXklftBwag,3991
327
327
  reconcile/gql_definitions/fragments/serviceaccount_token.py,sha256=2pG4rxAjvT-YsFBnm4zl301i7DCYznp99HOEGA-216I,1117
328
328
  reconcile/gql_definitions/fragments/terraform_state.py,sha256=S5QuTR9YlvUObiU7hevS9ybxZEssWoRGqCR9YtGwePs,1024
329
329
  reconcile/gql_definitions/fragments/upgrade_policy.py,sha256=cVza8zfra1E3yBsHiS-hKbys17fvv572GFnKshJjluE,1246
@@ -387,7 +387,7 @@ reconcile/gql_definitions/slack_usergroups/users.py,sha256=-_iOFxctoVpX2wJt1Drrk
387
387
  reconcile/gql_definitions/slo_documents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
388
388
  reconcile/gql_definitions/slo_documents/slo_documents.py,sha256=pOrm9NXAonlo6Lxq6NkD3mHkZ53ZeBnZOZMkDvOEwds,3746
389
389
  reconcile/gql_definitions/status_board/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
390
- reconcile/gql_definitions/status_board/status_board.py,sha256=vHEzncabujkqbjJ-ibMYNJTODgTc4DMf4y6TW3I_7II,4700
390
+ reconcile/gql_definitions/status_board/status_board.py,sha256=BYq-1g_-AjNKHIKmY2rQT8l3ql4Mcwa_CIxN_FS4F6M,4690
391
391
  reconcile/gql_definitions/statuspage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
392
392
  reconcile/gql_definitions/statuspage/statuspages.py,sha256=CTRzjiR9k41LqlkgyoNHwC2JERsoD_Run_aK7jw_Ono,5299
393
393
  reconcile/gql_definitions/templating/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -579,7 +579,7 @@ reconcile/utils/environ.py,sha256=psk07d2xyjbUzjOCDdNWgavaNolL_t2sq3sn2gFfY9k,50
579
579
  reconcile/utils/exceptions.py,sha256=DwfnWUpVOotpP79RWZ2pycmG6nKCL00RBIeZLYkQPW4,635
580
580
  reconcile/utils/expiration.py,sha256=3JaXH4psksR7z262k7FmdyREjCLqm66OpVMEbcfdWRo,1213
581
581
  reconcile/utils/extended_early_exit.py,sha256=QSktrmfw37zSRMNk930tDbQsVeKxaPPPD43e79DGwZw,6754
582
- reconcile/utils/external_resource_spec.py,sha256=bhH_xneFwATdFumTPkiQmcVKYI0gcaWuqV6FpFdf_P0,7006
582
+ reconcile/utils/external_resource_spec.py,sha256=qeupz4t4trd2uPjlHjf_AFA9Y-EKrMnaXi72tAuCxig,7177
583
583
  reconcile/utils/external_resources.py,sha256=YzTb0xAcNdmKO326mGQy7BmST56CZcdru4lX7ai_7kw,7579
584
584
  reconcile/utils/filtering.py,sha256=S4PbMHuFr3ED0P2Q_ea5CAaB7FimI62B-F5YTaKrphA,402
585
585
  reconcile/utils/git.py,sha256=wzVIYAeKlMGW538U1mkJWUI6h_mFRUY4lawh2AR8hw4,2345
@@ -773,7 +773,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
773
773
  tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
774
774
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
775
775
  tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
776
- qontract_reconcile-0.10.2.dev37.dist-info/METADATA,sha256=B0DOY2hcUnomQwibz-MLpISYAdAAMhgxFiXS0R5M7ZI,24665
777
- qontract_reconcile-0.10.2.dev37.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
778
- qontract_reconcile-0.10.2.dev37.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
779
- qontract_reconcile-0.10.2.dev37.dist-info/RECORD,,
776
+ qontract_reconcile-0.10.2.dev39.dist-info/METADATA,sha256=qNWXDceNJDCX6MHXiNnvS4CYUjAhGUt88jYj9js7f0A,24665
777
+ qontract_reconcile-0.10.2.dev39.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
778
+ qontract_reconcile-0.10.2.dev39.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
779
+ qontract_reconcile-0.10.2.dev39.dist-info/RECORD,,
@@ -58,6 +58,8 @@ class AWSElasticacheFactory(AWSDefaultResourceFactory):
58
58
  if "replication_group_id" not in data:
59
59
  data["replication_group_id"] = spec.identifier
60
60
 
61
+ data["environment"] = spec.environment_type
62
+
61
63
  if cluster_mode := data.pop("cluster_mode", {}):
62
64
  for k, v in cluster_mode.items():
63
65
  data[k] = v
@@ -505,6 +505,7 @@ query ExternalResourcesNamespaces {
505
505
  }
506
506
  environment {
507
507
  name
508
+ labels
508
509
  }
509
510
  app {
510
511
  path
@@ -1071,6 +1072,7 @@ class NamespaceTerraformProviderResourceAWSV1(NamespaceExternalResourceV1):
1071
1072
 
1072
1073
  class EnvironmentV1(ConfiguredBaseModel):
1073
1074
  name: str = Field(..., alias="name")
1075
+ labels: str = Field(..., alias="labels")
1074
1076
 
1075
1077
 
1076
1078
  class AppV1(ConfiguredBaseModel):
@@ -34,7 +34,7 @@ class SaasSecretParametersV1(ConfiguredBaseModel):
34
34
 
35
35
  class EnvironmentV1(ConfiguredBaseModel):
36
36
  name: str = Field(..., alias="name")
37
- labels: Optional[Json] = Field(..., alias="labels")
37
+ labels: Json = Field(..., alias="labels")
38
38
  parameters: Optional[Json] = Field(..., alias="parameters")
39
39
  secret_parameters: Optional[list[SaasSecretParametersV1]] = Field(..., alias="secretParameters")
40
40
 
@@ -16224,9 +16224,13 @@
16224
16224
  "description": null,
16225
16225
  "args": [],
16226
16226
  "type": {
16227
- "kind": "SCALAR",
16228
- "name": "JSON",
16229
- "ofType": null
16227
+ "kind": "NON_NULL",
16228
+ "name": null,
16229
+ "ofType": {
16230
+ "kind": "SCALAR",
16231
+ "name": "JSON",
16232
+ "ofType": null
16233
+ }
16230
16234
  },
16231
16235
  "isDeprecated": false,
16232
16236
  "deprecationReason": null
@@ -119,7 +119,7 @@ class NamespaceV1(ConfiguredBaseModel):
119
119
 
120
120
  class EnvironmentV1(ConfiguredBaseModel):
121
121
  name: str = Field(..., alias="name")
122
- labels: Optional[Json] = Field(..., alias="labels")
122
+ labels: Json = Field(..., alias="labels")
123
123
  product: ProductV1 = Field(..., alias="product")
124
124
  namespaces: Optional[list[NamespaceV1]] = Field(..., alias="namespaces")
125
125
 
@@ -2,7 +2,7 @@ import logging
2
2
  import random
3
3
  import sys
4
4
  import time
5
- from collections.abc import Callable, Iterable
5
+ from collections.abc import Callable, Iterable, Sequence
6
6
  from enum import IntFlag, auto
7
7
  from typing import Any, TypedDict
8
8
 
@@ -199,7 +199,7 @@ def validate_boards(
199
199
  metrics_container: metrics.MetricsContainer,
200
200
  secret_reader: SecretReaderBase,
201
201
  jira_client_settings: JiraWatcherSettings | None,
202
- jira_boards: Iterable[JiraBoardV1],
202
+ jira_boards: Sequence[JiraBoardV1],
203
203
  default_issue_type: str,
204
204
  default_reopen_state: str,
205
205
  board_check_interval_sec: int,
@@ -211,9 +211,14 @@ def validate_boards(
211
211
  jira_clients: dict[str, JiraClient] = {}
212
212
  for board in jira_boards:
213
213
  next_run_time = state.get(board.name, 0)
214
- if not dry_run and time.time() <= next_run_time:
215
- logging.debug(f"[{board.name}] Skipping board")
216
- continue
214
+ if time.time() <= next_run_time:
215
+ if not dry_run:
216
+ # always skip for non-dry-run mode
217
+ continue
218
+ # dry-run mode
219
+ elif len(jira_boards) > 1:
220
+ logging.info(f"[{board.name}] Use cache results. Skipping ...")
221
+ continue
217
222
 
218
223
  logging.debug(f"[{board.name}] checking ...")
219
224
  if board.server.server_url not in jira_clients:
@@ -116,6 +116,11 @@ class ExternalResourceSpec:
116
116
  def cluster_name(self) -> str:
117
117
  return self.namespace["cluster"]["name"]
118
118
 
119
+ @property
120
+ def environment_type(self) -> str:
121
+ labels = json.loads(self.namespace["environment"]["labels"])
122
+ return labels.get("type", "production")
123
+
119
124
  @property
120
125
  def output_prefix(self) -> str:
121
126
  # Adhere to DNS-1123 subdomain names spec. It's reasonable to have provider