qontract-reconcile 0.10.2.dev22__py3-none-any.whl → 0.10.2.dev24__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.
- {qontract_reconcile-0.10.2.dev22.dist-info → qontract_reconcile-0.10.2.dev24.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.2.dev22.dist-info → qontract_reconcile-0.10.2.dev24.dist-info}/RECORD +13 -12
- reconcile/cli.py +3 -0
- reconcile/endpoints_discovery/integration.py +16 -1
- reconcile/gql_definitions/endpoints_discovery/apps.py +4 -0
- reconcile/gql_definitions/integrations/integrations.py +37 -1
- reconcile/gql_definitions/introspection.json +157 -0
- reconcile/gql_definitions/sharding/jira_boards.py +60 -0
- reconcile/integrations_manager.py +2 -0
- reconcile/jira_permissions_validator.py +19 -6
- reconcile/utils/runtime/sharding.py +64 -0
- {qontract_reconcile-0.10.2.dev22.dist-info → qontract_reconcile-0.10.2.dev24.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.2.dev22.dist-info → qontract_reconcile-0.10.2.dev24.dist-info}/entry_points.txt +0 -0
{qontract_reconcile-0.10.2.dev22.dist-info → qontract_reconcile-0.10.2.dev24.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.2.
|
3
|
+
Version: 0.10.2.dev24
|
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
|
{qontract_reconcile-0.10.2.dev22.dist-info → qontract_reconcile-0.10.2.dev24.dist-info}/RECORD
RENAMED
@@ -10,7 +10,7 @@ reconcile/aws_iam_password_reset.py,sha256=q96mwr2KeEQ5bpNniGlgIMZTxiuLSodcYfX-t
|
|
10
10
|
reconcile/aws_support_cases_sos.py,sha256=hl_9L53yQYRQxKs3IWrd69Cc60XK067g_bJRM9B0udo,2975
|
11
11
|
reconcile/blackbox_exporter_endpoint_monitoring.py,sha256=O1wFp52EyF538c6txaWBs8eMtUIy19gyHZ6VzJ6QXS8,3512
|
12
12
|
reconcile/checkpoint.py,sha256=_JhMxrye5BgkRMxWYuf7Upli6XayPINKSsuo3ynHTRc,5010
|
13
|
-
reconcile/cli.py,sha256=
|
13
|
+
reconcile/cli.py,sha256=jI3MMGWLBXYl-0aYOA4hLEQlBdP9lbb1FyGnqEjt-mM,107621
|
14
14
|
reconcile/closedbox_endpoint_monitoring_base.py,sha256=MvGKBqH9PdHWdMjhLuptze-dk0Tifhp3-0SZdI-7Fmo,4862
|
15
15
|
reconcile/cluster_deployment_mapper.py,sha256=5gumAaRCcFXsabUJ1dnuUy9WrP_FEEM5JnOnE8ch9sE,2326
|
16
16
|
reconcile/dashdotdb_base.py,sha256=83ZWIf5JJk3P_D69y2TmXRcQr6ELJGlv10OM0h7fJVs,4767
|
@@ -37,7 +37,7 @@ reconcile/gitlab_mr_sqs_consumer.py,sha256=O46mdziPgGOndbU-0_UJKJVUaiEoVzJPEgKm4
|
|
37
37
|
reconcile/gitlab_owners.py,sha256=Y3i-WqXhszLGqGmddt-tJ3OM2b_cViqDs1Ru1P1aQEM,13405
|
38
38
|
reconcile/gitlab_permissions.py,sha256=gSGH6gAdJbPy5Z0rQGUqiNQSHty_tXQ_3Y4OQP_8nFs,8067
|
39
39
|
reconcile/gitlab_projects.py,sha256=K3tFf_aD1W4Ijp5q-9Qek3kwFGEWPcZ1kd7tzFJ4GyQ,1781
|
40
|
-
reconcile/integrations_manager.py,sha256=
|
40
|
+
reconcile/integrations_manager.py,sha256=wZ5snv0l2KJ2EF7dAece8cDIvRYyGRXcdDcRfBNNfxQ,9573
|
41
41
|
reconcile/jenkins_base.py,sha256=0Gocu3fU2YTltaxBlbDQOUvP-7CP2OSQV1ZRwtWeVXw,875
|
42
42
|
reconcile/jenkins_job_builder.py,sha256=2aeOSS5pwKJgF4EzoHBWlOYNbzLj3qYzv6u55Qg6MAg,3466
|
43
43
|
reconcile/jenkins_job_builds_cleaner.py,sha256=0iiX0iJiIIter0g9l0l-C6TUvUdVy8O9zFUh7kaYw5w,3865
|
@@ -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=
|
49
|
+
reconcile/jira_permissions_validator.py,sha256=Hp9wkBUXafSIGtXozVhYRiIh3lxXyObCnmB77mGA9ZQ,13419
|
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
|
@@ -191,7 +191,7 @@ reconcile/dynatrace_token_provider/model.py,sha256=gkpqo5rRRueBXnIMjp4EEHqBUBuU6
|
|
191
191
|
reconcile/dynatrace_token_provider/ocm.py,sha256=MwYCZIxW4f-1jzFTxxN__sity6S8O7bbKUdyTFEVO7U,4325
|
192
192
|
reconcile/dynatrace_token_provider/validate.py,sha256=40_9QmHoB3-KBc0k_0D4QO00PpNNPS-gU9Z6cIcWga8,1920
|
193
193
|
reconcile/endpoints_discovery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
194
|
-
reconcile/endpoints_discovery/integration.py,sha256=
|
194
|
+
reconcile/endpoints_discovery/integration.py,sha256=fzy5tv4c_6WoAZGGBNJ276NVNB1OESuSJMhZh4-ZNm8,14711
|
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
|
@@ -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=
|
218
|
+
reconcile/gql_definitions/introspection.json,sha256=_MsmBFKNpf6uIymRHvkzVyz5ICgVD0aAcDi_7czXfxQ,2221786
|
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
|
@@ -293,7 +293,7 @@ reconcile/gql_definitions/dynatrace_token_provider/__init__.py,sha256=47DEQpj8HB
|
|
293
293
|
reconcile/gql_definitions/dynatrace_token_provider/dynatrace_bootstrap_tokens.py,sha256=5gTuAnR2rnx2k6Rn7FMEAzw6GCZ6F5HZbqkmJ9-3NI4,2244
|
294
294
|
reconcile/gql_definitions/dynatrace_token_provider/token_specs.py,sha256=XGsMuB8gowRpqJjkD_KRomx-1OswzyWbF4qjVdhionk,2555
|
295
295
|
reconcile/gql_definitions/endpoints_discovery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
296
|
-
reconcile/gql_definitions/endpoints_discovery/apps.py,sha256=
|
296
|
+
reconcile/gql_definitions/endpoints_discovery/apps.py,sha256=aBWRAwDUJQ32ghJS4cPQcR9SNl20Fcwd3pxHDB3YJQY,3172
|
297
297
|
reconcile/gql_definitions/external_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
298
298
|
reconcile/gql_definitions/external_resources/aws_accounts.py,sha256=XR69j9dpTQ0gv8y-AZN7AJ0dPvO-wbHscyCDgrax6Bk,2046
|
299
299
|
reconcile/gql_definitions/external_resources/external_resources_modules.py,sha256=cbbvGq1Te9DP8XiFg3bp4Y0q6LxpGYov8ugcROPyPLI,2647
|
@@ -335,7 +335,7 @@ reconcile/gql_definitions/glitchtip/glitchtip_project.py,sha256=AojrkCDGbVjY0TOk
|
|
335
335
|
reconcile/gql_definitions/glitchtip_project_alerts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
336
336
|
reconcile/gql_definitions/glitchtip_project_alerts/glitchtip_project.py,sha256=Pv6RcuIzpNmGc43eEq64nnKG0Dr7H0wjy5Xg1_oRltM,5197
|
337
337
|
reconcile/gql_definitions/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
338
|
-
reconcile/gql_definitions/integrations/integrations.py,sha256=
|
338
|
+
reconcile/gql_definitions/integrations/integrations.py,sha256=yPpLVR_tML0QvjvLzGT7_D3SkpA6MaZqn0-45pukWgc,12821
|
339
339
|
reconcile/gql_definitions/jenkins_configs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
340
340
|
reconcile/gql_definitions/jenkins_configs/jenkins_configs.py,sha256=kr1RwKcSpmpBkotl8rR0cOZ02Co5FAbE1he80CCFbTc,2961
|
341
341
|
reconcile/gql_definitions/jenkins_configs/jenkins_instances.py,sha256=b3gYVzQavxeLe4jSM5ZxrO77Vvs7kOljVOXEkTO943U,2165
|
@@ -373,6 +373,7 @@ reconcile/gql_definitions/service_dependencies/jenkins_instance_fragment.py,sha2
|
|
373
373
|
reconcile/gql_definitions/service_dependencies/service_dependencies.py,sha256=CpMq9KjhFA61yniLo_11ypVInoeMBXbNmcY7_VAep-0,4700
|
374
374
|
reconcile/gql_definitions/sharding/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
375
375
|
reconcile/gql_definitions/sharding/aws_accounts.py,sha256=CtvVUKlS6PfsbInXuhlNwoV4Zmo4uiOc0mwubED8JwQ,1968
|
376
|
+
reconcile/gql_definitions/sharding/jira_boards.py,sha256=yZGLQEQef919UPpy7PWlfusegYv91pByH5jsumXsYuc,1685
|
376
377
|
reconcile/gql_definitions/sharding/ocm_organization.py,sha256=duBIg3531yJ7fWniuHOG6mASgIiKfFIg6mef_lDzwnE,1871
|
377
378
|
reconcile/gql_definitions/skupper_network/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
378
379
|
reconcile/gql_definitions/skupper_network/site_controller_template.py,sha256=MFJTZAO0wRFlRBU4qfXUeQmCKIP4zkmnnCnrvX67FNY,756
|
@@ -718,7 +719,7 @@ reconcile/utils/runtime/environment.py,sha256=h-CFKLK1qRl_gfOVIUwjqVNOmukIPzUG7A
|
|
718
719
|
reconcile/utils/runtime/integration.py,sha256=H3kDfbc4IKrhubSDCWHs0W9oxM7FoCiPaxqA73c9aEs,11101
|
719
720
|
reconcile/utils/runtime/meta.py,sha256=dWdKS9eHVuowFkTK4lgXJ723vS1y9giOMzePUKnHnDI,214
|
720
721
|
reconcile/utils/runtime/runner.py,sha256=I30KRrX1UQbHc_Ir1cIZX3OfNSdoHKdnDSPAEB69Ilk,7944
|
721
|
-
reconcile/utils/runtime/sharding.py,sha256=
|
722
|
+
reconcile/utils/runtime/sharding.py,sha256=y7UZrikyCe-0LmQOCL32fvjqX4NrdZ5rUH9lpvKH5Ks,18517
|
722
723
|
reconcile/utils/saasherder/__init__.py,sha256=3U8plqMAPRE1kjwZ5YnIsYsggTf4_gS7flRUEuXVBAs,343
|
723
724
|
reconcile/utils/saasherder/interfaces.py,sha256=C2wrw34OXypshVocAsPrVZsSHptgw4g9u7Haa2wulZQ,9087
|
724
725
|
reconcile/utils/saasherder/models.py,sha256=z8ln03zi2a8cu716NcNUDHp8Dv1VcVbhqdWVxCl7x9A,10148
|
@@ -766,7 +767,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
766
767
|
tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
|
767
768
|
tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
|
768
769
|
tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
|
769
|
-
qontract_reconcile-0.10.2.
|
770
|
-
qontract_reconcile-0.10.2.
|
771
|
-
qontract_reconcile-0.10.2.
|
772
|
-
qontract_reconcile-0.10.2.
|
770
|
+
qontract_reconcile-0.10.2.dev24.dist-info/METADATA,sha256=3PESZ9C6DwAy3yl39ijxJD9JP3-4K2PC0C-yPyZ0MaI,24665
|
771
|
+
qontract_reconcile-0.10.2.dev24.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
772
|
+
qontract_reconcile-0.10.2.dev24.dist-info/entry_points.txt,sha256=JniHZPadNOILPyfSl0LF2YSp3Db7K2_W2CN7i9f3Gos,540
|
773
|
+
qontract_reconcile-0.10.2.dev24.dist-info/RECORD,,
|
reconcile/cli.py
CHANGED
@@ -1158,12 +1158,14 @@ def jenkins_webhooks_cleaner(ctx):
|
|
1158
1158
|
|
1159
1159
|
|
1160
1160
|
@integration.command(short_help="Validate permissions in Jira.")
|
1161
|
+
@click.option("--jira-board-name", help="The Jira board to act on.", default=None)
|
1161
1162
|
@enable_extended_early_exit
|
1162
1163
|
@extended_early_exit_cache_ttl_seconds
|
1163
1164
|
@log_cached_log_output
|
1164
1165
|
@click.pass_context
|
1165
1166
|
def jira_permissions_validator(
|
1166
1167
|
ctx,
|
1168
|
+
jira_board_name,
|
1167
1169
|
enable_extended_early_exit,
|
1168
1170
|
extended_early_exit_cache_ttl_seconds,
|
1169
1171
|
log_cached_log_output,
|
@@ -1173,6 +1175,7 @@ def jira_permissions_validator(
|
|
1173
1175
|
run_integration(
|
1174
1176
|
reconcile.jira_permissions_validator,
|
1175
1177
|
ctx.obj,
|
1178
|
+
jira_board_name=jira_board_name,
|
1176
1179
|
enable_extended_early_exit=enable_extended_early_exit,
|
1177
1180
|
extended_early_exit_cache_ttl_seconds=extended_early_exit_cache_ttl_seconds,
|
1178
1181
|
log_cached_log_output=log_cached_log_output,
|
@@ -220,6 +220,16 @@ class EndpointsDiscoveryIntegration(
|
|
220
220
|
]
|
221
221
|
return endpoints_to_add, endpoints_to_change, endpoints_to_delete
|
222
222
|
|
223
|
+
def filter_ignored_routes(
|
224
|
+
self, routes: list[Route], labels: dict[str, str]
|
225
|
+
) -> list[Route]:
|
226
|
+
"""Filter out the ignored routes."""
|
227
|
+
return [
|
228
|
+
route
|
229
|
+
for route in routes
|
230
|
+
if f"{QONTRACT_INTEGRATION}-{route.name}" not in labels
|
231
|
+
]
|
232
|
+
|
223
233
|
def process(
|
224
234
|
self,
|
225
235
|
oc_map: OCMap,
|
@@ -231,6 +241,7 @@ class EndpointsDiscoveryIntegration(
|
|
231
241
|
apps_with_changes: list[App] = []
|
232
242
|
for app in apps:
|
233
243
|
app_endpoints = App(name=app.name, path=app.path)
|
244
|
+
|
234
245
|
for namespace in app.namespaces or []:
|
235
246
|
if not self.is_enabled(namespace, cluster_names=cluster_names):
|
236
247
|
continue
|
@@ -238,7 +249,11 @@ class EndpointsDiscoveryIntegration(
|
|
238
249
|
logging.debug(
|
239
250
|
f"Processing namespace {namespace.cluster.name}/{namespace.name}"
|
240
251
|
)
|
241
|
-
|
252
|
+
|
253
|
+
routes = self.filter_ignored_routes(
|
254
|
+
self.get_routes(oc_map, namespace),
|
255
|
+
(app.labels or {}) | (namespace.labels or {}),
|
256
|
+
)
|
242
257
|
endpoints_to_add, endpoints_to_change, endpoints_to_delete = (
|
243
258
|
self.get_namespace_endpoint_changes(
|
244
259
|
endpoint_prefix=endpoint_prefix(namespace),
|
@@ -62,12 +62,14 @@ query EndPointsDiscoveryApps {
|
|
62
62
|
apps: apps_v1 {
|
63
63
|
path
|
64
64
|
name
|
65
|
+
labels
|
65
66
|
endPoints {
|
66
67
|
name
|
67
68
|
url
|
68
69
|
}
|
69
70
|
namespaces {
|
70
71
|
name
|
72
|
+
labels
|
71
73
|
delete
|
72
74
|
clusterAdmin
|
73
75
|
cluster {
|
@@ -92,6 +94,7 @@ class AppEndPointsV1(ConfiguredBaseModel):
|
|
92
94
|
|
93
95
|
class NamespaceV1(ConfiguredBaseModel):
|
94
96
|
name: str = Field(..., alias="name")
|
97
|
+
labels: Optional[Json] = Field(..., alias="labels")
|
95
98
|
delete: Optional[bool] = Field(..., alias="delete")
|
96
99
|
cluster_admin: Optional[bool] = Field(..., alias="clusterAdmin")
|
97
100
|
cluster: OcConnectionCluster = Field(..., alias="cluster")
|
@@ -100,6 +103,7 @@ class NamespaceV1(ConfiguredBaseModel):
|
|
100
103
|
class AppV1(ConfiguredBaseModel):
|
101
104
|
path: str = Field(..., alias="path")
|
102
105
|
name: str = Field(..., alias="name")
|
106
|
+
labels: Optional[Json] = Field(..., alias="labels")
|
103
107
|
end_points: Optional[list[AppEndPointsV1]] = Field(..., alias="endPoints")
|
104
108
|
namespaces: Optional[list[NamespaceV1]] = Field(..., alias="namespaces")
|
105
109
|
|
@@ -191,6 +191,22 @@ query Integrations {
|
|
191
191
|
}
|
192
192
|
}
|
193
193
|
}
|
194
|
+
|
195
|
+
... on JiraBoardSharding_v1 {
|
196
|
+
shardSpecOverrides {
|
197
|
+
shard {
|
198
|
+
name
|
199
|
+
disable {
|
200
|
+
integrations
|
201
|
+
}
|
202
|
+
}
|
203
|
+
imageRef
|
204
|
+
disabled
|
205
|
+
resources {
|
206
|
+
... DeployResourcesFields
|
207
|
+
}
|
208
|
+
}
|
209
|
+
}
|
194
210
|
}
|
195
211
|
}
|
196
212
|
}
|
@@ -342,10 +358,30 @@ class CloudflareDNSZoneShardingV1(IntegrationShardingV1):
|
|
342
358
|
shard_spec_overrides: Optional[list[CloudflareDNSZoneShardSpecOverrideV1]] = Field(..., alias="shardSpecOverrides")
|
343
359
|
|
344
360
|
|
361
|
+
class DisableJiraBoardAutomationsV1(ConfiguredBaseModel):
|
362
|
+
integrations: Optional[list[str]] = Field(..., alias="integrations")
|
363
|
+
|
364
|
+
|
365
|
+
class JiraBoardV1(ConfiguredBaseModel):
|
366
|
+
name: str = Field(..., alias="name")
|
367
|
+
disable: Optional[DisableJiraBoardAutomationsV1] = Field(..., alias="disable")
|
368
|
+
|
369
|
+
|
370
|
+
class JiraBoardShardSpecOverrideV1(ConfiguredBaseModel):
|
371
|
+
shard: JiraBoardV1 = Field(..., alias="shard")
|
372
|
+
image_ref: Optional[str] = Field(..., alias="imageRef")
|
373
|
+
disabled: Optional[bool] = Field(..., alias="disabled")
|
374
|
+
resources: Optional[DeployResourcesFields] = Field(..., alias="resources")
|
375
|
+
|
376
|
+
|
377
|
+
class JiraBoardShardingV1(IntegrationShardingV1):
|
378
|
+
shard_spec_overrides: Optional[list[JiraBoardShardSpecOverrideV1]] = Field(..., alias="shardSpecOverrides")
|
379
|
+
|
380
|
+
|
345
381
|
class IntegrationManagedV1(ConfiguredBaseModel):
|
346
382
|
namespace: NamespaceV1 = Field(..., alias="namespace")
|
347
383
|
spec: IntegrationSpecV1 = Field(..., alias="spec")
|
348
|
-
sharding: Optional[Union[StaticShardingV1, OpenshiftClusterShardingV1, OCMOrganizationShardingV1, AWSAccountShardingV1, CloudflareDNSZoneShardingV1, IntegrationShardingV1]] = Field(..., alias="sharding")
|
384
|
+
sharding: Optional[Union[StaticShardingV1, OpenshiftClusterShardingV1, OCMOrganizationShardingV1, AWSAccountShardingV1, CloudflareDNSZoneShardingV1, JiraBoardShardingV1, IntegrationShardingV1]] = Field(..., alias="sharding")
|
349
385
|
|
350
386
|
|
351
387
|
class IntegrationV1(ConfiguredBaseModel):
|
@@ -29766,6 +29766,11 @@
|
|
29766
29766
|
"kind": "OBJECT",
|
29767
29767
|
"name": "AWSAccountSharding_v1",
|
29768
29768
|
"ofType": null
|
29769
|
+
},
|
29770
|
+
{
|
29771
|
+
"kind": "OBJECT",
|
29772
|
+
"name": "JiraBoardSharding_v1",
|
29773
|
+
"ofType": null
|
29769
29774
|
}
|
29770
29775
|
]
|
29771
29776
|
},
|
@@ -45344,6 +45349,42 @@
|
|
45344
45349
|
},
|
45345
45350
|
"isDeprecated": false,
|
45346
45351
|
"deprecationReason": null
|
45352
|
+
},
|
45353
|
+
{
|
45354
|
+
"name": "managed_by_erv2",
|
45355
|
+
"description": null,
|
45356
|
+
"args": [],
|
45357
|
+
"type": {
|
45358
|
+
"kind": "SCALAR",
|
45359
|
+
"name": "Boolean",
|
45360
|
+
"ofType": null
|
45361
|
+
},
|
45362
|
+
"isDeprecated": false,
|
45363
|
+
"deprecationReason": null
|
45364
|
+
},
|
45365
|
+
{
|
45366
|
+
"name": "delete",
|
45367
|
+
"description": null,
|
45368
|
+
"args": [],
|
45369
|
+
"type": {
|
45370
|
+
"kind": "SCALAR",
|
45371
|
+
"name": "Boolean",
|
45372
|
+
"ofType": null
|
45373
|
+
},
|
45374
|
+
"isDeprecated": false,
|
45375
|
+
"deprecationReason": null
|
45376
|
+
},
|
45377
|
+
{
|
45378
|
+
"name": "module_overrides",
|
45379
|
+
"description": null,
|
45380
|
+
"args": [],
|
45381
|
+
"type": {
|
45382
|
+
"kind": "OBJECT",
|
45383
|
+
"name": "ExternalResourcesModuleOverrides_v1",
|
45384
|
+
"ofType": null
|
45385
|
+
},
|
45386
|
+
"isDeprecated": false,
|
45387
|
+
"deprecationReason": null
|
45347
45388
|
}
|
45348
45389
|
],
|
45349
45390
|
"inputFields": null,
|
@@ -49733,6 +49774,122 @@
|
|
49733
49774
|
"enumValues": null,
|
49734
49775
|
"possibleTypes": null
|
49735
49776
|
},
|
49777
|
+
{
|
49778
|
+
"kind": "OBJECT",
|
49779
|
+
"name": "JiraBoardSharding_v1",
|
49780
|
+
"description": null,
|
49781
|
+
"fields": [
|
49782
|
+
{
|
49783
|
+
"name": "strategy",
|
49784
|
+
"description": null,
|
49785
|
+
"args": [],
|
49786
|
+
"type": {
|
49787
|
+
"kind": "NON_NULL",
|
49788
|
+
"name": null,
|
49789
|
+
"ofType": {
|
49790
|
+
"kind": "SCALAR",
|
49791
|
+
"name": "String",
|
49792
|
+
"ofType": null
|
49793
|
+
}
|
49794
|
+
},
|
49795
|
+
"isDeprecated": false,
|
49796
|
+
"deprecationReason": null
|
49797
|
+
},
|
49798
|
+
{
|
49799
|
+
"name": "shardSpecOverrides",
|
49800
|
+
"description": null,
|
49801
|
+
"args": [],
|
49802
|
+
"type": {
|
49803
|
+
"kind": "LIST",
|
49804
|
+
"name": null,
|
49805
|
+
"ofType": {
|
49806
|
+
"kind": "NON_NULL",
|
49807
|
+
"name": null,
|
49808
|
+
"ofType": {
|
49809
|
+
"kind": "OBJECT",
|
49810
|
+
"name": "JiraBoardShardSpecOverride_v1",
|
49811
|
+
"ofType": null
|
49812
|
+
}
|
49813
|
+
}
|
49814
|
+
},
|
49815
|
+
"isDeprecated": false,
|
49816
|
+
"deprecationReason": null
|
49817
|
+
}
|
49818
|
+
],
|
49819
|
+
"inputFields": null,
|
49820
|
+
"interfaces": [
|
49821
|
+
{
|
49822
|
+
"kind": "INTERFACE",
|
49823
|
+
"name": "IntegrationSharding_v1",
|
49824
|
+
"ofType": null
|
49825
|
+
}
|
49826
|
+
],
|
49827
|
+
"enumValues": null,
|
49828
|
+
"possibleTypes": null
|
49829
|
+
},
|
49830
|
+
{
|
49831
|
+
"kind": "OBJECT",
|
49832
|
+
"name": "JiraBoardShardSpecOverride_v1",
|
49833
|
+
"description": null,
|
49834
|
+
"fields": [
|
49835
|
+
{
|
49836
|
+
"name": "shard",
|
49837
|
+
"description": null,
|
49838
|
+
"args": [],
|
49839
|
+
"type": {
|
49840
|
+
"kind": "NON_NULL",
|
49841
|
+
"name": null,
|
49842
|
+
"ofType": {
|
49843
|
+
"kind": "OBJECT",
|
49844
|
+
"name": "JiraBoard_v1",
|
49845
|
+
"ofType": null
|
49846
|
+
}
|
49847
|
+
},
|
49848
|
+
"isDeprecated": false,
|
49849
|
+
"deprecationReason": null
|
49850
|
+
},
|
49851
|
+
{
|
49852
|
+
"name": "imageRef",
|
49853
|
+
"description": null,
|
49854
|
+
"args": [],
|
49855
|
+
"type": {
|
49856
|
+
"kind": "SCALAR",
|
49857
|
+
"name": "String",
|
49858
|
+
"ofType": null
|
49859
|
+
},
|
49860
|
+
"isDeprecated": false,
|
49861
|
+
"deprecationReason": null
|
49862
|
+
},
|
49863
|
+
{
|
49864
|
+
"name": "resources",
|
49865
|
+
"description": null,
|
49866
|
+
"args": [],
|
49867
|
+
"type": {
|
49868
|
+
"kind": "OBJECT",
|
49869
|
+
"name": "DeployResources_v1",
|
49870
|
+
"ofType": null
|
49871
|
+
},
|
49872
|
+
"isDeprecated": false,
|
49873
|
+
"deprecationReason": null
|
49874
|
+
},
|
49875
|
+
{
|
49876
|
+
"name": "disabled",
|
49877
|
+
"description": null,
|
49878
|
+
"args": [],
|
49879
|
+
"type": {
|
49880
|
+
"kind": "SCALAR",
|
49881
|
+
"name": "Boolean",
|
49882
|
+
"ofType": null
|
49883
|
+
},
|
49884
|
+
"isDeprecated": false,
|
49885
|
+
"deprecationReason": null
|
49886
|
+
}
|
49887
|
+
],
|
49888
|
+
"inputFields": null,
|
49889
|
+
"interfaces": [],
|
49890
|
+
"enumValues": null,
|
49891
|
+
"possibleTypes": null
|
49892
|
+
},
|
49736
49893
|
{
|
49737
49894
|
"kind": "OBJECT",
|
49738
49895
|
"name": "StaticSubSharding_v1",
|
@@ -0,0 +1,60 @@
|
|
1
|
+
"""
|
2
|
+
Generated by qenerate plugin=pydantic_v1. DO NOT MODIFY MANUALLY!
|
3
|
+
"""
|
4
|
+
from collections.abc import Callable # noqa: F401 # pylint: disable=W0611
|
5
|
+
from datetime import datetime # noqa: F401 # pylint: disable=W0611
|
6
|
+
from enum import Enum # noqa: F401 # pylint: disable=W0611
|
7
|
+
from typing import ( # noqa: F401 # pylint: disable=W0611
|
8
|
+
Any,
|
9
|
+
Optional,
|
10
|
+
Union,
|
11
|
+
)
|
12
|
+
|
13
|
+
from pydantic import ( # noqa: F401 # pylint: disable=W0611
|
14
|
+
BaseModel,
|
15
|
+
Extra,
|
16
|
+
Field,
|
17
|
+
Json,
|
18
|
+
)
|
19
|
+
|
20
|
+
|
21
|
+
DEFINITION = """
|
22
|
+
query JiraBoardSharding {
|
23
|
+
jira_boards: jira_boards_v1 {
|
24
|
+
name
|
25
|
+
}
|
26
|
+
}
|
27
|
+
"""
|
28
|
+
|
29
|
+
|
30
|
+
class ConfiguredBaseModel(BaseModel):
|
31
|
+
class Config:
|
32
|
+
smart_union=True
|
33
|
+
extra=Extra.forbid
|
34
|
+
|
35
|
+
|
36
|
+
class JiraBoardV1(ConfiguredBaseModel):
|
37
|
+
name: str = Field(..., alias="name")
|
38
|
+
|
39
|
+
|
40
|
+
class JiraBoardShardingQueryData(ConfiguredBaseModel):
|
41
|
+
jira_boards: Optional[list[JiraBoardV1]] = Field(..., alias="jira_boards")
|
42
|
+
|
43
|
+
|
44
|
+
def query(query_func: Callable, **kwargs: Any) -> JiraBoardShardingQueryData:
|
45
|
+
"""
|
46
|
+
This is a convenience function which queries and parses the data into
|
47
|
+
concrete types. It should be compatible with most GQL clients.
|
48
|
+
You do not have to use it to consume the generated data classes.
|
49
|
+
Alternatively, you can also mime and alternate the behavior
|
50
|
+
of this function in the caller.
|
51
|
+
|
52
|
+
Parameters:
|
53
|
+
query_func (Callable): Function which queries your GQL Server
|
54
|
+
kwargs: optional arguments that will be passed to the query function
|
55
|
+
|
56
|
+
Returns:
|
57
|
+
JiraBoardShardingQueryData: queried data parsed into generated classes
|
58
|
+
"""
|
59
|
+
raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
|
60
|
+
return JiraBoardShardingQueryData(**raw_data)
|
@@ -41,6 +41,7 @@ from reconcile.utils.runtime.sharding import (
|
|
41
41
|
AWSAccountShardingStrategy,
|
42
42
|
CloudflareDnsZoneShardingStrategy,
|
43
43
|
IntegrationShardManager,
|
44
|
+
JiraBoardShardingStrategy,
|
44
45
|
OCMOrganizationShardingStrategy,
|
45
46
|
OpenshiftClusterShardingStrategy,
|
46
47
|
ShardSpec,
|
@@ -257,6 +258,7 @@ def run(
|
|
257
258
|
OpenshiftClusterShardingStrategy.IDENTIFIER: OpenshiftClusterShardingStrategy(),
|
258
259
|
CloudflareDnsZoneShardingStrategy.IDENTIFIER: CloudflareDnsZoneShardingStrategy(),
|
259
260
|
OCMOrganizationShardingStrategy.IDENTIFIER: OCMOrganizationShardingStrategy(),
|
261
|
+
JiraBoardShardingStrategy.IDENTIFIER: JiraBoardShardingStrategy(),
|
260
262
|
},
|
261
263
|
integration_runtime_meta=integration_runtime_meta,
|
262
264
|
)
|
@@ -31,7 +31,7 @@ from reconcile.utils.semver_helper import make_semver
|
|
31
31
|
from reconcile.utils.unleash import get_feature_toggle_state
|
32
32
|
|
33
33
|
QONTRACT_INTEGRATION = "jira-permissions-validator"
|
34
|
-
QONTRACT_INTEGRATION_VERSION = make_semver(1,
|
34
|
+
QONTRACT_INTEGRATION_VERSION = make_semver(1, 1, 0)
|
35
35
|
|
36
36
|
NameToIdMap = dict[str, str]
|
37
37
|
|
@@ -256,11 +256,14 @@ def validate_boards(
|
|
256
256
|
return error
|
257
257
|
|
258
258
|
|
259
|
-
def get_jira_boards(
|
259
|
+
def get_jira_boards(
|
260
|
+
query_func: Callable, jira_board_name: str | None = None
|
261
|
+
) -> list[JiraBoardV1]:
|
260
262
|
return [
|
261
263
|
board
|
262
264
|
for board in query_jira_boards(query_func=query_func).jira_boards or []
|
263
265
|
if integration_is_enabled(QONTRACT_INTEGRATION, board)
|
266
|
+
and (not jira_board_name or board.name.lower() == jira_board_name.lower())
|
264
267
|
]
|
265
268
|
|
266
269
|
|
@@ -270,12 +273,13 @@ def export_boards(boards: list[JiraBoardV1]) -> list[dict]:
|
|
270
273
|
|
271
274
|
def run(
|
272
275
|
dry_run: bool,
|
276
|
+
jira_board_name: str | None = None,
|
273
277
|
enable_extended_early_exit: bool = False,
|
274
278
|
extended_early_exit_cache_ttl_seconds: int = 3600,
|
275
279
|
log_cached_log_output: bool = False,
|
276
280
|
) -> None:
|
277
281
|
gql_api = gql.get_api()
|
278
|
-
boards = get_jira_boards(query_func=gql_api.query)
|
282
|
+
boards = get_jira_boards(query_func=gql_api.query, jira_board_name=jira_board_name)
|
279
283
|
runner_params: RunnerParams = {
|
280
284
|
"boards": boards,
|
281
285
|
"dry_run": dry_run,
|
@@ -296,7 +300,7 @@ def run(
|
|
296
300
|
# don't use `dry_run` in the cache key because this is a read-only integration
|
297
301
|
dry_run=False,
|
298
302
|
cache_source=cache_source,
|
299
|
-
shard="",
|
303
|
+
shard=jira_board_name or "",
|
300
304
|
ttl_seconds=extended_early_exit_cache_ttl_seconds,
|
301
305
|
logger=logging.getLogger(),
|
302
306
|
runner=runner,
|
@@ -332,5 +336,14 @@ def runner(boards: list[JiraBoardV1], dry_run: bool) -> ExtendedEarlyExitRunnerR
|
|
332
336
|
return ExtendedEarlyExitRunnerResult(payload=export_boards(boards), applied_count=0)
|
333
337
|
|
334
338
|
|
335
|
-
def early_exit_desired_state(
|
336
|
-
|
339
|
+
def early_exit_desired_state(
|
340
|
+
*args: Any, jira_board_name: str | None = None, **kwargs: Any
|
341
|
+
) -> dict[str, Any]:
|
342
|
+
return {
|
343
|
+
"boards": export_boards(
|
344
|
+
get_jira_boards(
|
345
|
+
query_func=gql.get_api().query,
|
346
|
+
jira_board_name=jira_board_name,
|
347
|
+
)
|
348
|
+
)
|
349
|
+
}
|
@@ -19,6 +19,8 @@ from reconcile.gql_definitions.integrations.integrations import (
|
|
19
19
|
IntegrationManagedV1,
|
20
20
|
IntegrationShardingV1,
|
21
21
|
IntegrationSpecV1,
|
22
|
+
JiraBoardShardingV1,
|
23
|
+
JiraBoardShardSpecOverrideV1,
|
22
24
|
OCMOrganizationShardingV1,
|
23
25
|
OCMOrganizationShardSpecOverrideV1,
|
24
26
|
OpenshiftClusterShardingV1,
|
@@ -28,6 +30,7 @@ from reconcile.gql_definitions.integrations.integrations import (
|
|
28
30
|
SubShardingV1,
|
29
31
|
)
|
30
32
|
from reconcile.gql_definitions.sharding import aws_accounts as sharding_aws_accounts
|
33
|
+
from reconcile.gql_definitions.sharding import jira_boards as sharding_jira_boards
|
31
34
|
from reconcile.gql_definitions.sharding import (
|
32
35
|
ocm_organization as sharding_ocm_organization,
|
33
36
|
)
|
@@ -434,6 +437,67 @@ class CloudflareDnsZoneShardingStrategy:
|
|
434
437
|
return shards
|
435
438
|
|
436
439
|
|
440
|
+
class JiraBoardShardingStrategy:
|
441
|
+
IDENTIFIER = "per-jira-board"
|
442
|
+
|
443
|
+
def __init__(
|
444
|
+
self,
|
445
|
+
jira_boards: Iterable[sharding_jira_boards.JiraBoardV1] | None = None,
|
446
|
+
):
|
447
|
+
if not jira_boards:
|
448
|
+
self.jira_boards = (
|
449
|
+
sharding_jira_boards.query(query_func=gql.get_api().query).jira_boards
|
450
|
+
or []
|
451
|
+
)
|
452
|
+
else:
|
453
|
+
self.jira_boards = list(jira_boards)
|
454
|
+
|
455
|
+
def get_shard_spec_overrides(
|
456
|
+
self, sharding: IntegrationShardingV1 | None
|
457
|
+
) -> dict[str, JiraBoardShardSpecOverrideV1]:
|
458
|
+
spos: dict[str, JiraBoardShardSpecOverrideV1] = {}
|
459
|
+
|
460
|
+
if isinstance(sharding, JiraBoardShardingV1) and sharding.shard_spec_overrides:
|
461
|
+
for sp in sharding.shard_spec_overrides or []:
|
462
|
+
spos[sp.shard.name] = sp
|
463
|
+
return spos
|
464
|
+
|
465
|
+
def check_integration_sharding_params(self, meta: IntegrationMeta) -> None:
|
466
|
+
if "--jira-board-name" not in meta.args:
|
467
|
+
raise ValueError(
|
468
|
+
f"the integration {meta.name} does not support the required argument "
|
469
|
+
" --jira-board-name for the 'per-jira-board' sharding strategy."
|
470
|
+
)
|
471
|
+
|
472
|
+
def build_shard_spec(
|
473
|
+
self,
|
474
|
+
jira_board: sharding_jira_boards.JiraBoardV1,
|
475
|
+
integration_spec: IntegrationSpecV1,
|
476
|
+
spo: JiraBoardShardSpecOverrideV1 | None,
|
477
|
+
) -> ShardSpec:
|
478
|
+
return ShardSpec(
|
479
|
+
shard_key=jira_board.name,
|
480
|
+
shard_name_suffix=f"-{jira_board.name.lower()}",
|
481
|
+
extra_args=(integration_spec.extra_args or "")
|
482
|
+
+ f" --jira-board-name {jira_board.name}",
|
483
|
+
shard_spec_overrides=spo,
|
484
|
+
)
|
485
|
+
|
486
|
+
def build_integration_shards(
|
487
|
+
self,
|
488
|
+
integration_meta: IntegrationMeta,
|
489
|
+
integration_managed: IntegrationManagedV1,
|
490
|
+
) -> list[ShardSpec]:
|
491
|
+
self.check_integration_sharding_params(integration_meta)
|
492
|
+
spos = self.get_shard_spec_overrides(integration_managed.sharding)
|
493
|
+
shards = []
|
494
|
+
for board in self.jira_boards:
|
495
|
+
spo = spos.get(board.name)
|
496
|
+
base_shard = self.build_shard_spec(board, integration_managed.spec, spo)
|
497
|
+
shards.append(base_shard)
|
498
|
+
return shards
|
499
|
+
|
500
|
+
|
437
501
|
@dataclass
|
438
502
|
class IntegrationShardManager:
|
439
503
|
strategies: dict[str, ShardingStrategy]
|
{qontract_reconcile-0.10.2.dev22.dist-info → qontract_reconcile-0.10.2.dev24.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|