qontract-reconcile 0.10.1rc884__py3-none-any.whl → 0.10.1rc886__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.
Files changed (279) hide show
  1. {qontract_reconcile-0.10.1rc884.dist-info → qontract_reconcile-0.10.1rc886.dist-info}/METADATA +1 -1
  2. {qontract_reconcile-0.10.1rc884.dist-info → qontract_reconcile-0.10.1rc886.dist-info}/RECORD +279 -276
  3. reconcile/acs_rbac.py +1 -2
  4. reconcile/aus/advanced_upgrade_service.py +14 -14
  5. reconcile/aus/aus_label_source.py +1 -2
  6. reconcile/aus/base.py +23 -26
  7. reconcile/aus/cluster_version_data.py +4 -4
  8. reconcile/aus/models.py +2 -3
  9. reconcile/aus/version_gate_approver.py +2 -6
  10. reconcile/aus/version_gates/__init__.py +1 -3
  11. reconcile/aus/version_gates/sts_version_gate_handler.py +2 -3
  12. reconcile/aws_account_manager/integration.py +2 -2
  13. reconcile/aws_ami_cleanup/integration.py +3 -4
  14. reconcile/aws_iam_password_reset.py +2 -5
  15. reconcile/aws_version_sync/integration.py +2 -2
  16. reconcile/blackbox_exporter_endpoint_monitoring.py +2 -5
  17. reconcile/change_owners/approver.py +4 -5
  18. reconcile/change_owners/bundle.py +20 -22
  19. reconcile/change_owners/change_types.py +23 -24
  20. reconcile/change_owners/changes.py +13 -16
  21. reconcile/change_owners/decision.py +2 -5
  22. reconcile/change_owners/diff.py +11 -15
  23. reconcile/change_owners/self_service_roles.py +1 -2
  24. reconcile/change_owners/tester.py +7 -10
  25. reconcile/checkpoint.py +2 -5
  26. reconcile/cli.py +9 -12
  27. reconcile/closedbox_endpoint_monitoring_base.py +8 -11
  28. reconcile/cluster_deployment_mapper.py +2 -5
  29. reconcile/cna/assets/asset.py +4 -7
  30. reconcile/cna/assets/null.py +2 -5
  31. reconcile/cna/integration.py +2 -3
  32. reconcile/cna/state.py +2 -5
  33. reconcile/dashdotdb_base.py +8 -11
  34. reconcile/dashdotdb_cso.py +3 -6
  35. reconcile/dashdotdb_dora.py +10 -14
  36. reconcile/dashdotdb_dvo.py +10 -13
  37. reconcile/dashdotdb_slo.py +5 -8
  38. reconcile/database_access_manager.py +5 -6
  39. reconcile/dynatrace_token_provider/integration.py +2 -5
  40. reconcile/external_resources/integration.py +1 -1
  41. reconcile/external_resources/manager.py +4 -4
  42. reconcile/external_resources/model.py +3 -3
  43. reconcile/external_resources/secrets_sync.py +5 -5
  44. reconcile/external_resources/state.py +5 -5
  45. reconcile/gabi_authorized_users.py +3 -6
  46. reconcile/gcr_mirror.py +1 -1
  47. reconcile/github_org.py +1 -3
  48. reconcile/github_repo_invites.py +2 -5
  49. reconcile/gitlab_housekeeping.py +7 -11
  50. reconcile/gitlab_labeler.py +1 -2
  51. reconcile/gitlab_members.py +2 -5
  52. reconcile/gitlab_permissions.py +1 -3
  53. reconcile/glitchtip/integration.py +2 -5
  54. reconcile/glitchtip_project_alerts/integration.py +3 -6
  55. reconcile/glitchtip_project_dsn/integration.py +4 -7
  56. reconcile/integrations_manager.py +5 -8
  57. reconcile/jenkins/types.py +5 -6
  58. reconcile/jenkins_job_builder.py +9 -12
  59. reconcile/jenkins_roles.py +1 -1
  60. reconcile/jira_watcher.py +2 -2
  61. reconcile/ldap_groups/integration.py +2 -5
  62. reconcile/ocm/types.py +21 -26
  63. reconcile/ocm_addons_upgrade_tests_trigger.py +3 -6
  64. reconcile/ocm_clusters.py +8 -8
  65. reconcile/ocm_internal_notifications/integration.py +1 -2
  66. reconcile/ocm_labels/integration.py +2 -5
  67. reconcile/ocm_machine_pools.py +11 -15
  68. reconcile/ocm_upgrade_scheduler_org_updater.py +2 -5
  69. reconcile/openshift_base.py +27 -29
  70. reconcile/openshift_groups.py +15 -20
  71. reconcile/openshift_namespace_labels.py +8 -14
  72. reconcile/openshift_namespaces.py +5 -8
  73. reconcile/openshift_network_policies.py +2 -4
  74. reconcile/openshift_resources_base.py +19 -29
  75. reconcile/openshift_saas_deploy.py +9 -10
  76. reconcile/openshift_saas_deploy_change_tester.py +7 -10
  77. reconcile/openshift_saas_deploy_trigger_base.py +4 -7
  78. reconcile/openshift_saas_deploy_trigger_cleaner.py +5 -8
  79. reconcile/openshift_saas_deploy_trigger_configs.py +1 -2
  80. reconcile/openshift_saas_deploy_trigger_images.py +1 -2
  81. reconcile/openshift_saas_deploy_trigger_moving_commits.py +1 -2
  82. reconcile/openshift_saas_deploy_trigger_upstream_jobs.py +1 -2
  83. reconcile/openshift_tekton_resources.py +7 -11
  84. reconcile/openshift_upgrade_watcher.py +10 -13
  85. reconcile/openshift_users.py +8 -11
  86. reconcile/oum/base.py +3 -4
  87. reconcile/oum/labelset.py +1 -2
  88. reconcile/oum/metrics.py +2 -2
  89. reconcile/oum/models.py +1 -2
  90. reconcile/oum/standalone.py +2 -3
  91. reconcile/prometheus_rules_tester/integration.py +6 -9
  92. reconcile/quay_membership.py +1 -2
  93. reconcile/quay_mirror.py +12 -13
  94. reconcile/quay_mirror_org.py +10 -10
  95. reconcile/queries.py +4 -7
  96. reconcile/resource_scraper.py +3 -4
  97. reconcile/rhidp/common.py +2 -2
  98. reconcile/saas_auto_promotions_manager/integration.py +5 -6
  99. reconcile/saas_auto_promotions_manager/merge_request_manager/batcher.py +1 -2
  100. reconcile/saas_auto_promotions_manager/publisher.py +5 -6
  101. reconcile/saas_auto_promotions_manager/subscriber.py +3 -4
  102. reconcile/saas_file_validator.py +2 -5
  103. reconcile/signalfx_endpoint_monitoring.py +2 -5
  104. reconcile/skupper_network/integration.py +3 -6
  105. reconcile/skupper_network/models.py +3 -5
  106. reconcile/slack_base.py +4 -7
  107. reconcile/slack_usergroups.py +15 -17
  108. reconcile/sql_query.py +5 -9
  109. reconcile/status_board.py +4 -5
  110. reconcile/statuspage/atlassian.py +14 -15
  111. reconcile/statuspage/integrations/maintenances.py +3 -3
  112. reconcile/statuspage/page.py +8 -8
  113. reconcile/statuspage/state.py +4 -5
  114. reconcile/statuspage/status.py +7 -8
  115. reconcile/templating/lib/rendering.py +8 -8
  116. reconcile/templating/renderer.py +10 -11
  117. reconcile/templating/validator.py +4 -4
  118. reconcile/terraform_aws_route53.py +3 -6
  119. reconcile/terraform_cloudflare_dns.py +9 -12
  120. reconcile/terraform_cloudflare_resources.py +9 -11
  121. reconcile/terraform_cloudflare_users.py +8 -11
  122. reconcile/terraform_init/integration.py +2 -2
  123. reconcile/terraform_repo.py +11 -14
  124. reconcile/terraform_resources.py +20 -21
  125. reconcile/terraform_tgw_attachments.py +32 -36
  126. reconcile/terraform_users.py +6 -7
  127. reconcile/terraform_vpc_resources/integration.py +5 -5
  128. reconcile/test/conftest.py +7 -10
  129. reconcile/test/fixtures.py +1 -1
  130. reconcile/test/saas_auto_promotions_manager/conftest.py +2 -2
  131. reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/conftest.py +2 -2
  132. reconcile/test/test_database_access_manager.py +3 -6
  133. reconcile/test/test_gitlab_labeler.py +2 -5
  134. reconcile/test/test_jump_host.py +5 -8
  135. reconcile/test/test_ocm_machine_pools.py +1 -4
  136. reconcile/test/test_openshift_base.py +3 -6
  137. reconcile/test/test_openshift_cluster_bots.py +5 -5
  138. reconcile/test/test_openshift_namespace_labels.py +2 -3
  139. reconcile/test/test_openshift_saas_deploy_trigger_cleaner.py +2 -2
  140. reconcile/test/test_saasherder.py +9 -12
  141. reconcile/test/test_slack_base.py +4 -6
  142. reconcile/test/test_status_board.py +4 -7
  143. reconcile/test/test_terraform_tgw_attachments.py +14 -20
  144. reconcile/typed_queries/alerting_services_settings.py +1 -2
  145. reconcile/typed_queries/app_interface_custom_messages.py +2 -3
  146. reconcile/typed_queries/app_interface_deadmanssnitch_settings.py +1 -3
  147. reconcile/typed_queries/app_interface_repo_url.py +1 -2
  148. reconcile/typed_queries/app_interface_state_settings.py +1 -3
  149. reconcile/typed_queries/app_interface_vault_settings.py +1 -2
  150. reconcile/typed_queries/aws_vpc_requests.py +1 -3
  151. reconcile/typed_queries/aws_vpcs.py +1 -3
  152. reconcile/typed_queries/clusters.py +2 -4
  153. reconcile/typed_queries/clusters_minimal.py +1 -3
  154. reconcile/typed_queries/clusters_with_dms.py +1 -3
  155. reconcile/typed_queries/external_resources.py +3 -4
  156. reconcile/typed_queries/pagerduty_instances.py +1 -2
  157. reconcile/typed_queries/repos.py +2 -3
  158. reconcile/typed_queries/reserved_networks.py +1 -3
  159. reconcile/typed_queries/saas_files.py +49 -59
  160. reconcile/typed_queries/slo_documents.py +1 -3
  161. reconcile/typed_queries/status_board.py +3 -7
  162. reconcile/typed_queries/tekton_pipeline_providers.py +1 -2
  163. reconcile/typed_queries/terraform_namespaces.py +1 -2
  164. reconcile/typed_queries/terraform_tgw_attachments/aws_accounts.py +1 -3
  165. reconcile/utils/acs/base.py +2 -3
  166. reconcile/utils/acs/notifiers.py +3 -3
  167. reconcile/utils/acs/policies.py +3 -3
  168. reconcile/utils/aggregated_list.py +1 -1
  169. reconcile/utils/amtool.py +1 -2
  170. reconcile/utils/aws_api.py +28 -31
  171. reconcile/utils/binary.py +1 -3
  172. reconcile/utils/clusterhealth/providerbase.py +1 -2
  173. reconcile/utils/clusterhealth/telemeter.py +2 -2
  174. reconcile/utils/deadmanssnitch_api.py +1 -2
  175. reconcile/utils/disabled_integrations.py +4 -6
  176. reconcile/utils/environ.py +1 -1
  177. reconcile/utils/expiration.py +3 -7
  178. reconcile/utils/external_resource_spec.py +3 -4
  179. reconcile/utils/external_resources.py +4 -7
  180. reconcile/utils/filtering.py +1 -2
  181. reconcile/utils/git.py +3 -9
  182. reconcile/utils/git_secrets.py +5 -5
  183. reconcile/utils/github_api.py +5 -9
  184. reconcile/utils/gitlab_api.py +2 -3
  185. reconcile/utils/glitchtip/client.py +2 -4
  186. reconcile/utils/glitchtip/models.py +8 -11
  187. reconcile/utils/gql.py +26 -35
  188. reconcile/utils/grouping.py +1 -3
  189. reconcile/utils/imap_client.py +2 -5
  190. reconcile/utils/internal_groups/client.py +1 -2
  191. reconcile/utils/internal_groups/models.py +8 -9
  192. reconcile/utils/jenkins_api.py +4 -4
  193. reconcile/utils/jinja2/extensions.py +1 -1
  194. reconcile/utils/jinja2/filters.py +4 -4
  195. reconcile/utils/jinja2/utils.py +16 -16
  196. reconcile/utils/jira_client.py +10 -11
  197. reconcile/utils/jjb_client.py +14 -17
  198. reconcile/utils/jobcontroller/controller.py +5 -5
  199. reconcile/utils/jobcontroller/models.py +2 -2
  200. reconcile/utils/jsonpath.py +4 -5
  201. reconcile/utils/jump_host.py +7 -8
  202. reconcile/utils/keycloak.py +3 -7
  203. reconcile/utils/ldap_client.py +2 -3
  204. reconcile/utils/lean_terraform_client.py +13 -17
  205. reconcile/utils/membershipsources/app_interface_resolver.py +1 -1
  206. reconcile/utils/membershipsources/models.py +19 -22
  207. reconcile/utils/metrics.py +13 -15
  208. reconcile/utils/mr/base.py +7 -11
  209. reconcile/utils/mr/glitchtip_access_reporter.py +2 -2
  210. reconcile/utils/mr/notificator.py +1 -2
  211. reconcile/utils/oc.py +32 -38
  212. reconcile/utils/oc_connection_parameters.py +24 -25
  213. reconcile/utils/oc_filters.py +2 -3
  214. reconcile/utils/oc_map.py +9 -15
  215. reconcile/utils/ocm/addons.py +7 -10
  216. reconcile/utils/ocm/base.py +38 -39
  217. reconcile/utils/ocm/clusters.py +6 -9
  218. reconcile/utils/ocm/label_sources.py +1 -2
  219. reconcile/utils/ocm/labels.py +3 -6
  220. reconcile/utils/ocm/ocm.py +11 -14
  221. reconcile/utils/ocm/products.py +1 -3
  222. reconcile/utils/ocm/search_filters.py +16 -17
  223. reconcile/utils/ocm/service_log.py +2 -3
  224. reconcile/utils/ocm/sre_capability_labels.py +4 -8
  225. reconcile/utils/ocm/subscriptions.py +1 -3
  226. reconcile/utils/ocm/syncsets.py +2 -4
  227. reconcile/utils/ocm/upgrades.py +5 -9
  228. reconcile/utils/ocm_base_client.py +13 -16
  229. reconcile/utils/openshift_resource.py +5 -11
  230. reconcile/utils/output.py +2 -3
  231. reconcile/utils/pagerduty_api.py +4 -5
  232. reconcile/utils/prometheus.py +2 -2
  233. reconcile/utils/promotion_state.py +4 -5
  234. reconcile/utils/promtool.py +2 -8
  235. reconcile/utils/quay_api.py +12 -22
  236. reconcile/utils/raw_github_api.py +3 -5
  237. reconcile/utils/rosa/rosa_cli.py +6 -6
  238. reconcile/utils/rosa/session.py +6 -7
  239. reconcile/utils/runtime/desired_state_diff.py +3 -8
  240. reconcile/utils/runtime/environment.py +4 -7
  241. reconcile/utils/runtime/integration.py +4 -4
  242. reconcile/utils/runtime/meta.py +1 -2
  243. reconcile/utils/runtime/runner.py +7 -10
  244. reconcile/utils/runtime/sharding.py +22 -27
  245. reconcile/utils/saasherder/interfaces.py +63 -69
  246. reconcile/utils/saasherder/models.py +30 -35
  247. reconcile/utils/saasherder/saasherder.py +37 -53
  248. reconcile/utils/secret_reader.py +17 -19
  249. reconcile/utils/slack_api.py +15 -17
  250. reconcile/utils/smtp_client.py +1 -2
  251. reconcile/utils/sqs_gateway.py +1 -3
  252. reconcile/utils/state.py +1 -2
  253. reconcile/utils/terraform/config_client.py +4 -5
  254. reconcile/utils/terraform_client.py +3 -8
  255. reconcile/utils/terrascript/cloudflare_client.py +4 -10
  256. reconcile/utils/terrascript/cloudflare_resources.py +10 -13
  257. reconcile/utils/terrascript/models.py +2 -3
  258. reconcile/utils/terrascript/resources.py +1 -2
  259. reconcile/utils/terrascript_aws_client.py +30 -38
  260. reconcile/utils/unleash/client.py +4 -7
  261. reconcile/utils/unleash/server.py +2 -2
  262. reconcile/utils/vault.py +8 -11
  263. reconcile/utils/vaultsecretref.py +2 -3
  264. reconcile/utils/vcs.py +7 -8
  265. reconcile/vault_replication.py +4 -8
  266. reconcile/vpc_peerings_validator.py +4 -9
  267. release/version.py +6 -7
  268. tools/app_interface_reporter.py +2 -2
  269. tools/cli_commands/gpg_encrypt.py +3 -6
  270. tools/cli_commands/systems_and_tools.py +4 -7
  271. tools/qontract_cli.py +31 -17
  272. tools/saas_promotion_state/__init__.py +0 -0
  273. tools/saas_promotion_state/saas_promotion_state.py +72 -0
  274. tools/template_validation.py +1 -1
  275. tools/test/conftest.py +45 -6
  276. tools/test/test_saas_promotion_state.py +86 -0
  277. {qontract_reconcile-0.10.1rc884.dist-info → qontract_reconcile-0.10.1rc886.dist-info}/WHEEL +0 -0
  278. {qontract_reconcile-0.10.1rc884.dist-info → qontract_reconcile-0.10.1rc886.dist-info}/entry_points.txt +0 -0
  279. {qontract_reconcile-0.10.1rc884.dist-info → qontract_reconcile-0.10.1rc886.dist-info}/top_level.txt +0 -0
@@ -4,10 +4,7 @@ from collections.abc import (
4
4
  Callable,
5
5
  Iterable,
6
6
  )
7
- from typing import (
8
- Any,
9
- Optional,
10
- )
7
+ from typing import Any
11
8
  from urllib.parse import urlencode
12
9
 
13
10
  from reconcile import jira_permissions_validator
@@ -46,7 +43,7 @@ ProjectStates = dict[str, Project]
46
43
 
47
44
 
48
45
  class GlitchtipProjectAlertsIntegrationParams(PydanticRunParams):
49
- instance: Optional[str] = None
46
+ instance: str | None = None
50
47
 
51
48
 
52
49
  def webhook_urls_are_unique(alerts: Iterable[ProjectAlert]) -> bool:
@@ -70,7 +67,7 @@ class GlitchtipProjectAlertsIntegration(
70
67
  def name(self) -> str:
71
68
  return QONTRACT_INTEGRATION
72
69
 
73
- def get_early_exit_desired_state(self) -> Optional[dict[str, Any]]:
70
+ def get_early_exit_desired_state(self) -> dict[str, Any] | None:
74
71
  return {"projects": [c.dict() for c in self.get_projects(gql.get_api().query)]}
75
72
 
76
73
  def get_projects(self, query_func: Callable) -> list[GlitchtipProjectV1]:
@@ -3,10 +3,7 @@ from collections.abc import (
3
3
  Callable,
4
4
  Iterable,
5
5
  )
6
- from typing import (
7
- Any,
8
- Optional,
9
- )
6
+ from typing import Any
10
7
 
11
8
  from sretoolbox.utils import threaded
12
9
 
@@ -169,10 +166,10 @@ def projects_query(query_func: Callable) -> list[GlitchtipProjectV1]:
169
166
  def run(
170
167
  dry_run: bool,
171
168
  thread_pool_size: int = 10,
172
- internal: Optional[bool] = None,
169
+ internal: bool | None = None,
173
170
  use_jump_host: bool = True,
174
- instance: Optional[str] = None,
175
- defer: Optional[Callable] = None,
171
+ instance: str | None = None,
172
+ defer: Callable | None = None,
176
173
  ) -> None:
177
174
  # settings
178
175
  vault_settings = get_app_interface_vault_settings()
@@ -6,10 +6,7 @@ from collections.abc import (
6
6
  Mapping,
7
7
  Sequence,
8
8
  )
9
- from typing import (
10
- Any,
11
- Optional,
12
- )
9
+ from typing import Any
13
10
 
14
11
  from github import Github
15
12
  from pydantic import BaseModel
@@ -76,7 +73,7 @@ def collect_parameters(
76
73
  environment: EnvironmentV1,
77
74
  upstream: str,
78
75
  image: str,
79
- image_tag_from_ref: Optional[Mapping[str, str]],
76
+ image_tag_from_ref: Mapping[str, str] | None,
80
77
  ) -> dict[str, Any]:
81
78
  parameters: dict[str, Any] = {}
82
79
  if environment.parameters:
@@ -180,7 +177,7 @@ def construct_oc_resources(
180
177
  integrations_environment: IntegrationsEnvironment,
181
178
  upstream: str,
182
179
  image: str,
183
- image_tag_from_ref: Optional[Mapping[str, str]],
180
+ image_tag_from_ref: Mapping[str, str] | None,
184
181
  ) -> list[OpenshiftResource]:
185
182
  # Generate the openshift template with the helm chart. The resulting template
186
183
  # contains all the integrations in the environment
@@ -213,7 +210,7 @@ def fetch_desired_state(
213
210
  ri: ResourceInventory,
214
211
  upstream: str,
215
212
  image: str,
216
- image_tag_from_ref: Optional[Mapping[str, str]],
213
+ image_tag_from_ref: Mapping[str, str] | None,
217
214
  ):
218
215
  for ie in integrations_environments:
219
216
  oc_resources = construct_oc_resources(ie, upstream, image, image_tag_from_ref)
@@ -224,7 +221,7 @@ def fetch_desired_state(
224
221
 
225
222
 
226
223
  def filter_integrations(
227
- integrations: Iterable[IntegrationV1], upstream: Optional[str] = None
224
+ integrations: Iterable[IntegrationV1], upstream: str | None = None
228
225
  ) -> list[IntegrationV1]:
229
226
  if upstream is None:
230
227
  return list(integrations)
@@ -1,7 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from enum import Enum
4
- from typing import Optional
5
4
 
6
5
  from pydantic import (
7
6
  BaseModel,
@@ -22,11 +21,11 @@ class SSHHostKeyVerificationStrategy(Enum):
22
21
 
23
22
  class SSHConnector(BaseModel):
24
23
  credentials_id: str = Field(..., alias="credentialsId")
25
- launch_timeout_seconds: Optional[int] = Field(None, alias="launchTimeoutSeconds")
26
- max_num_retries: Optional[int] = Field(None, alias="maxNumRetries")
27
- retry_wait_time: Optional[int] = Field(None, alias="retryWaitTime")
28
- port: Optional[int] = 22
29
- jvm_options: Optional[str] = Field(None, alias="jvmOptions")
24
+ launch_timeout_seconds: int | None = Field(None, alias="launchTimeoutSeconds")
25
+ max_num_retries: int | None = Field(None, alias="maxNumRetries")
26
+ retry_wait_time: int | None = Field(None, alias="retryWaitTime")
27
+ port: int | None = 22
28
+ jvm_options: str | None = Field(None, alias="jvmOptions")
30
29
  ssh_host_key_verification_strategy: SSHHostKeyVerificationStrategy = Field(
31
30
  SSHHostKeyVerificationStrategy.NON_VERIFYING_KEY_VERIFICATION_STRATEGY,
32
31
  alias="sshHostKeyVerificationStrategy",
@@ -1,10 +1,7 @@
1
1
  import logging
2
2
  import sys
3
3
  from collections.abc import Callable
4
- from typing import (
5
- Any,
6
- Optional,
7
- )
4
+ from typing import Any
8
5
 
9
6
  from reconcile import queries
10
7
  from reconcile.utils.defer import defer
@@ -20,7 +17,7 @@ GENERATE_TYPE = ["jobs", "views"]
20
17
 
21
18
 
22
19
  def collect_configs(
23
- instance_name: Optional[str], config_name: Optional[str]
20
+ instance_name: str | None, config_name: str | None
24
21
  ) -> list[dict[str, Any]]:
25
22
  configs = queries.get_jenkins_configs()
26
23
  if instance_name is not None:
@@ -41,8 +38,8 @@ def collect_configs(
41
38
 
42
39
  def init_jjb(
43
40
  secret_reader: SecretReaderBase,
44
- instance_name: Optional[str] = None,
45
- config_name: Optional[str] = None,
41
+ instance_name: str | None = None,
42
+ config_name: str | None = None,
46
43
  print_only: bool = False,
47
44
  ) -> JJB:
48
45
  configs = collect_configs(instance_name, config_name)
@@ -66,7 +63,7 @@ def validate_repos_and_admins(jjb: JJB):
66
63
  )
67
64
  unknown_admins = [a for a in jjb_admins if a not in github_usernames]
68
65
  for a in unknown_admins:
69
- logging.warning("admin is missing from users: {}".format(a))
66
+ logging.warning(f"admin is missing from users: {a}")
70
67
  if missing_repos:
71
68
  sys.exit(1)
72
69
 
@@ -76,10 +73,10 @@ def run(
76
73
  dry_run: bool,
77
74
  io_dir: str = "throughput/",
78
75
  print_only: bool = False,
79
- config_name: Optional[str] = None,
80
- job_name: Optional[str] = None,
81
- instance_name: Optional[str] = None,
82
- defer: Optional[Callable] = None,
76
+ config_name: str | None = None,
77
+ job_name: str | None = None,
78
+ instance_name: str | None = None,
79
+ defer: Callable | None = None,
83
80
  ) -> None:
84
81
  if not print_only and config_name is not None:
85
82
  raise Exception("--config-name must works with --print-only mode")
@@ -170,7 +170,7 @@ def act(diff, jenkins_map):
170
170
  elif action == "unassign_role_from_user":
171
171
  jenkins_map[instance].unassign_role_from_user(role, user)
172
172
  else:
173
- raise Exception("invalid action: {}".format(action))
173
+ raise Exception(f"invalid action: {action}")
174
174
 
175
175
 
176
176
  def run(dry_run):
reconcile/jira_watcher.py CHANGED
@@ -34,8 +34,8 @@ def format_message(server, key, data, event, previous_state=None, current_state=
34
34
  if previous_state and current_state
35
35
  else ""
36
36
  )
37
- url = "{}/browse/{}".format(server, key)
38
- return "{} ({}) {}{}".format(url, summary, event, info)
37
+ url = f"{server}/browse/{key}"
38
+ return f"{url} ({summary}) {event}{info}"
39
39
 
40
40
 
41
41
  def calculate_diff(server, current_state, previous_state):
@@ -3,10 +3,7 @@ from collections.abc import (
3
3
  Callable,
4
4
  Iterable,
5
5
  )
6
- from typing import (
7
- Any,
8
- Optional,
9
- )
6
+ from typing import Any
10
7
 
11
8
  from reconcile.gql_definitions.ldap_groups.roles import RoleV1
12
9
  from reconcile.gql_definitions.ldap_groups.roles import query as roles_query
@@ -62,7 +59,7 @@ class LdapGroupsIntegration(QontractReconcileIntegration[LdapGroupsIntegrationPa
62
59
  return {"roles": [c.dict() for c in self.get_roles(query_func)]}
63
60
 
64
61
  @defer
65
- def run(self, dry_run: bool, defer: Optional[Callable] = None) -> None:
62
+ def run(self, dry_run: bool, defer: Callable | None = None) -> None:
66
63
  """Run the integration."""
67
64
  gql_api = gql.get_api()
68
65
  roles = self.get_roles(gql_api.query)
reconcile/ocm/types.py CHANGED
@@ -1,10 +1,5 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import (
4
- Optional,
5
- Union,
6
- )
7
-
8
3
  from pydantic import (
9
4
  BaseModel,
10
5
  Extra,
@@ -18,29 +13,29 @@ class OCMClusterAutoscale(BaseModel):
18
13
 
19
14
 
20
15
  class OCMClusterNetwork(BaseModel):
21
- type: Optional[str]
16
+ type: str | None
22
17
  vpc: str
23
18
  service: str
24
19
  pod: str
25
20
 
26
21
 
27
22
  class OCMClusterSpec(BaseModel):
28
- autoscale: Optional[OCMClusterAutoscale]
23
+ autoscale: OCMClusterAutoscale | None
29
24
  channel: str
30
- disable_user_workload_monitoring: Optional[bool]
31
- external_id: Optional[str]
32
- id: Optional[str]
33
- instance_type: Optional[str]
34
- multi_az: Optional[bool]
35
- nodes: Optional[int]
25
+ disable_user_workload_monitoring: bool | None
26
+ external_id: str | None
27
+ id: str | None
28
+ instance_type: str | None
29
+ multi_az: bool | None
30
+ nodes: int | None
36
31
  private: bool
37
32
  product: str
38
33
  provider: str
39
- provision_shard_id: Optional[str]
34
+ provision_shard_id: str | None
40
35
  region: str
41
- initial_version: Optional[str]
36
+ initial_version: str | None
42
37
  version: str
43
- hypershift: Optional[bool]
38
+ hypershift: bool | None
44
39
 
45
40
  class Config:
46
41
  extra = Extra.forbid
@@ -57,7 +52,7 @@ class OSDClusterSpec(OCMClusterSpec):
57
52
  class ROSAOcmAwsStsAttrs(BaseModel):
58
53
  installer_role_arn: str
59
54
  support_role_arn: str
60
- controlplane_role_arn: Optional[str]
55
+ controlplane_role_arn: str | None
61
56
  worker_role_arn: str
62
57
 
63
58
  class Config:
@@ -66,7 +61,7 @@ class ROSAOcmAwsStsAttrs(BaseModel):
66
61
 
67
62
  class ROSAOcmAwsAttrs(BaseModel):
68
63
  creator_role_arn: str
69
- sts: Optional[ROSAOcmAwsStsAttrs]
64
+ sts: ROSAOcmAwsStsAttrs | None
70
65
 
71
66
  class Config:
72
67
  extra = Extra.forbid
@@ -82,9 +77,9 @@ class ROSAClusterAWSAccount(BaseModel):
82
77
 
83
78
  class ROSAClusterSpec(OCMClusterSpec):
84
79
  account: ROSAClusterAWSAccount
85
- subnet_ids: Optional[list[str]]
86
- availability_zones: Optional[list[str]]
87
- oidc_endpoint_url: Optional[str]
80
+ subnet_ids: list[str] | None
81
+ availability_zones: list[str] | None
82
+ oidc_endpoint_url: str | None
88
83
 
89
84
  class Config:
90
85
  extra = Extra.forbid
@@ -93,18 +88,18 @@ class ROSAClusterSpec(OCMClusterSpec):
93
88
  class ClusterMachinePool(BaseModel):
94
89
  id: str
95
90
  instance_type: str
96
- replicas: Optional[int]
97
- autoscale: Optional[OCMClusterAutoscale]
91
+ replicas: int | None
92
+ autoscale: OCMClusterAutoscale | None
98
93
 
99
94
 
100
95
  class OCMSpec(BaseModel):
101
- path: Optional[str]
102
- spec: Union[OSDClusterSpec, ROSAClusterSpec, OCMClusterSpec]
96
+ path: str | None
97
+ spec: OSDClusterSpec | ROSAClusterSpec | OCMClusterSpec
103
98
  machine_pools: list[ClusterMachinePool] = Field(
104
99
  default_factory=list, alias="machinePools"
105
100
  )
106
101
  network: OCMClusterNetwork
107
- domain: Optional[str]
102
+ domain: str | None
108
103
  server_url: str = Field("", alias="serverUrl")
109
104
  console_url: str = Field("", alias="consoleUrl")
110
105
  elb_fqdn: str = Field("", alias="elbFQDN")
@@ -1,8 +1,5 @@
1
1
  import logging
2
- from typing import (
3
- Callable,
4
- Optional,
5
- )
2
+ from collections.abc import Callable
6
3
 
7
4
  from reconcile import queries
8
5
  from reconcile.typed_queries.app_interface_vault_settings import (
@@ -18,7 +15,7 @@ QONTRACT_INTEGRATION = "ocm-addons-upgrade-tests-trigger"
18
15
 
19
16
 
20
17
  @defer
21
- def run(dry_run: bool, defer: Optional[Callable] = None) -> None:
18
+ def run(dry_run: bool, defer: Callable | None = None) -> None:
22
19
  settings = queries.get_app_interface_settings()
23
20
  vault_settings = get_app_interface_vault_settings()
24
21
  secret_reader = create_secret_reader(use_vault=vault_settings.vault)
@@ -40,7 +37,7 @@ def run(dry_run: bool, defer: Optional[Callable] = None) -> None:
40
37
  )
41
38
 
42
39
  ocm = ocm_map[ocm_name]
43
- state_updates: dict[str, Optional[str]] = {}
40
+ state_updates: dict[str, str | None] = {}
44
41
  for aut in addon_upgrade_tests:
45
42
  addon_name = aut["addon"]["name"]
46
43
  addon_org_version = None
reconcile/ocm_clusters.py CHANGED
@@ -4,7 +4,7 @@ from collections.abc import (
4
4
  Iterable,
5
5
  Mapping,
6
6
  )
7
- from typing import Any, Optional
7
+ from typing import Any
8
8
 
9
9
  import reconcile.utils.mr.clusters_updates as cu
10
10
  import reconcile.utils.ocm as ocmmod
@@ -283,7 +283,7 @@ def get_cluster_ocm_update_spec(
283
283
 
284
284
 
285
285
  def _app_interface_updates_mr(
286
- clusters_updates: Mapping[str, Any], gitlab_project_id: Optional[str], dry_run: bool
286
+ clusters_updates: Mapping[str, Any], gitlab_project_id: str | None, dry_run: bool
287
287
  ):
288
288
  """Creates an MR to app-interface with the necessary cluster manifest updates
289
289
 
@@ -318,15 +318,15 @@ def _cluster_is_compatible(cluster: Mapping[str, Any]) -> bool:
318
318
 
319
319
 
320
320
  class OcmClustersParams(PydanticRunParams):
321
- gitlab_project_id: Optional[str] = None
321
+ gitlab_project_id: str | None = None
322
322
  thread_pool_size: int = 10
323
323
 
324
324
  # rosa job controller params
325
- job_controller_cluster: Optional[str] = None
326
- job_controller_namespace: Optional[str] = None
327
- rosa_job_service_account: Optional[str] = None
328
- rosa_role: Optional[str] = None
329
- rosa_job_image: Optional[str] = None
325
+ job_controller_cluster: str | None = None
326
+ job_controller_namespace: str | None = None
327
+ rosa_job_service_account: str | None = None
328
+ rosa_role: str | None = None
329
+ rosa_job_image: str | None = None
330
330
 
331
331
 
332
332
  class OcmClusters(QontractReconcileIntegration[OcmClustersParams]):
@@ -5,7 +5,6 @@ from collections.abc import (
5
5
  Callable,
6
6
  )
7
7
  from functools import lru_cache
8
- from typing import Optional
9
8
 
10
9
  from reconcile.gql_definitions.common.ocm_environments import (
11
10
  query as ocm_environment_query,
@@ -48,7 +47,7 @@ class OcmInternalNotifications(QontractReconcileIntegration[NoParams]):
48
47
  @lru_cache
49
48
  def slack_get_user_id_by_name(
50
49
  self, user_name: str, mail_address: str
51
- ) -> Optional[str]:
50
+ ) -> str | None:
52
51
  try:
53
52
  return self.slack.get_user_id_by_name(
54
53
  user_name=user_name, mail_address=mail_address
@@ -5,10 +5,7 @@ from collections.abc import (
5
5
  Callable,
6
6
  Iterable,
7
7
  )
8
- from typing import (
9
- Any,
10
- Optional,
11
- )
8
+ from typing import Any
12
9
 
13
10
  from deepdiff import DeepHash
14
11
  from pydantic import validator
@@ -124,7 +121,7 @@ class OcmLabelsIntegration(QontractReconcileIntegration[OcmLabelsIntegrationPara
124
121
  init_aus_cluster_label_source(query_func),
125
122
  ]
126
123
 
127
- def get_early_exit_desired_state(self) -> Optional[dict[str, Any]]:
124
+ def get_early_exit_desired_state(self) -> dict[str, Any] | None:
128
125
  gqlapi = gql.get_api()
129
126
  desired = {
130
127
  "org_labels": self.fetch_desired_state(
@@ -3,12 +3,8 @@ from abc import (
3
3
  ABC,
4
4
  abstractmethod,
5
5
  )
6
- from collections.abc import Mapping
6
+ from collections.abc import Iterable, Mapping
7
7
  from enum import Enum
8
- from typing import (
9
- Iterable,
10
- Optional,
11
- )
12
8
 
13
9
  from pydantic import (
14
10
  BaseModel,
@@ -100,12 +96,12 @@ class AbstractPool(ABC, BaseModel):
100
96
  # Abstract class for machine pools, to be implemented by OSD/HyperShift classes
101
97
 
102
98
  id: str
103
- replicas: Optional[int]
104
- taints: Optional[list[Mapping[str, str]]]
105
- labels: Optional[Mapping[str, str]]
99
+ replicas: int | None
100
+ taints: list[Mapping[str, str]] | None
101
+ labels: Mapping[str, str] | None
106
102
  cluster: str
107
103
  cluster_type: ClusterType = Field(..., exclude=True)
108
- autoscaling: Optional[AbstractAutoscaling]
104
+ autoscaling: AbstractAutoscaling | None
109
105
 
110
106
  @root_validator()
111
107
  @classmethod
@@ -131,7 +127,7 @@ class AbstractPool(ABC, BaseModel):
131
127
  pass
132
128
 
133
129
  @abstractmethod
134
- def invalid_diff(self, pool: ClusterMachinePoolV1) -> Optional[str]:
130
+ def invalid_diff(self, pool: ClusterMachinePoolV1) -> str | None:
135
131
  pass
136
132
 
137
133
  @abstractmethod
@@ -184,7 +180,7 @@ class MachinePool(AbstractPool):
184
180
  or self._has_diff_autoscale(pool)
185
181
  )
186
182
 
187
- def invalid_diff(self, pool: ClusterMachinePoolV1) -> Optional[str]:
183
+ def invalid_diff(self, pool: ClusterMachinePoolV1) -> str | None:
188
184
  if self.instance_type != pool.instance_type:
189
185
  return "instance_type"
190
186
  return None
@@ -203,7 +199,7 @@ class MachinePool(AbstractPool):
203
199
  cluster: str,
204
200
  cluster_type: ClusterType,
205
201
  ):
206
- autoscaling: Optional[MachinePoolAutoscaling] = None
202
+ autoscaling: MachinePoolAutoscaling | None = None
207
203
  if pool.autoscale:
208
204
  autoscaling = MachinePoolAutoscaling(
209
205
  min_replicas=pool.autoscale.min_replicas,
@@ -229,7 +225,7 @@ class NodePool(AbstractPool):
229
225
  # Node pool, used for HyperShift clusters
230
226
 
231
227
  aws_node_pool: AWSNodePool
232
- subnet: Optional[str]
228
+ subnet: str | None
233
229
 
234
230
  def delete(self, ocm: OCM) -> None:
235
231
  ocm.delete_node_pool(self.cluster, self.dict(by_alias=True))
@@ -266,7 +262,7 @@ class NodePool(AbstractPool):
266
262
  or self._has_diff_autoscale(pool)
267
263
  )
268
264
 
269
- def invalid_diff(self, pool: ClusterMachinePoolV1) -> Optional[str]:
265
+ def invalid_diff(self, pool: ClusterMachinePoolV1) -> str | None:
270
266
  if self.aws_node_pool.instance_type != pool.instance_type:
271
267
  return "instance_type"
272
268
  if self.subnet != pool.subnet:
@@ -283,7 +279,7 @@ class NodePool(AbstractPool):
283
279
  cluster: str,
284
280
  cluster_type: ClusterType,
285
281
  ):
286
- autoscaling: Optional[NodePoolAutoscaling] = None
282
+ autoscaling: NodePoolAutoscaling | None = None
287
283
  if pool.autoscale:
288
284
  autoscaling = NodePoolAutoscaling(
289
285
  min_replica=pool.autoscale.min_replicas,
@@ -1,9 +1,6 @@
1
1
  import json
2
2
  import logging
3
- from typing import (
4
- Any,
5
- Optional,
6
- )
3
+ from typing import Any
7
4
 
8
5
  import yaml
9
6
 
@@ -25,7 +22,7 @@ def render_policy(
25
22
  template: dict[str, Any],
26
23
  cluster_spec: OCMSpec,
27
24
  labels: dict[str, str],
28
- settings: Optional[dict[str, Any]] = None,
25
+ settings: dict[str, Any] | None = None,
29
26
  ) -> dict[str, Any]:
30
27
  body = template["path"]["content"]
31
28
  type = template.get("type") or "jinja2"