qontract-reconcile 0.10.2.dev243__py3-none-any.whl → 0.10.2.dev245__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.dev243
3
+ Version: 0.10.2.dev245
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
@@ -181,8 +181,6 @@ OpenShift templates can be found [here](/openshift/qontract-reconcile.yaml). In
181
181
  jenkins-job-builder Manage Jenkins jobs configurations using
182
182
  jenkins-jobs.
183
183
  jenkins-job-builds-cleaner Clean up jenkins job history.
184
- jenkins-job-cleaner Delete Jenkins jobs in multiple tenant
185
- instances.
186
184
  jenkins-roles Manage Jenkins roles association via REST
187
185
  API.
188
186
  jenkins-webhooks Manage web hooks to Jenkins jobs.
@@ -8,7 +8,7 @@ reconcile/aws_iam_password_reset.py,sha256=O0JX2N5kNRKs3u2xzu4NNrI6p0ag5JWy3MTsv
8
8
  reconcile/aws_support_cases_sos.py,sha256=PDhilxQ4TBxVnxUPIUdTbKEaNUI0wzPiEsB91oHT2fY,3384
9
9
  reconcile/blackbox_exporter_endpoint_monitoring.py,sha256=O1wFp52EyF538c6txaWBs8eMtUIy19gyHZ6VzJ6QXS8,3512
10
10
  reconcile/checkpoint.py,sha256=gjtS8g6KIyKFYlHMSZjAqDUOlVh83nh4go-9yNrhWZU,5016
11
- reconcile/cli.py,sha256=kp-YLjPfnqwyJdXDfVPE0lmfaRWDO1_ocTlZDCuVUOI,113061
11
+ reconcile/cli.py,sha256=mewdtUiv_j2OYNnjIMsc4BTbgDk6WTIotsyD-E4LwT4,112803
12
12
  reconcile/closedbox_endpoint_monitoring_base.py,sha256=al7m8EgnnYx90rY1REryW3byN_ItfJfAzEeLtjbCfi0,4921
13
13
  reconcile/cluster_deployment_mapper.py,sha256=5gumAaRCcFXsabUJ1dnuUy9WrP_FEEM5JnOnE8ch9sE,2326
14
14
  reconcile/dashdotdb_base.py,sha256=83ZWIf5JJk3P_D69y2TmXRcQr6ELJGlv10OM0h7fJVs,4767
@@ -38,7 +38,6 @@ reconcile/integrations_manager.py,sha256=KKMui_zXHNbMT0o5jnW2JpDzIKuMPqBvamit3I8
38
38
  reconcile/jenkins_base.py,sha256=0Gocu3fU2YTltaxBlbDQOUvP-7CP2OSQV1ZRwtWeVXw,875
39
39
  reconcile/jenkins_job_builder.py,sha256=SAcoJUSs2BgxEzfuRfJ4Poik2OSg_B8LaT5VQISocPs,3474
40
40
  reconcile/jenkins_job_builds_cleaner.py,sha256=l9eLyvdgv1sN2tAlkGx3T8g6Db9kIfWW3LJh5H6dV9A,4080
41
- reconcile/jenkins_job_cleaner.py,sha256=IJs-YqtoPN9BpdimYegfU2ObYr4g6qGvbFoU-gnX05Q,1874
42
41
  reconcile/jenkins_roles.py,sha256=zdGavYJJNmbOdu_pr-NrNPl_Tj3j8oin14qvydKxXZw,4916
43
42
  reconcile/jenkins_webhooks.py,sha256=KANd1ExYw6jp6F-d-QEbX1L1CNbRF270yL2ppDCAjio,2324
44
43
  reconcile/jenkins_webhooks_cleaner.py,sha256=tFbAzsFGvJ6UrHRZFdIuLdqG-Ocd5_OknfsbtN-eyFY,1619
@@ -138,7 +137,7 @@ reconcile/aus/version_gates/ocp_gate_handler.py,sha256=RW1ppDaCZXVegV9AzzqYXxDUu
138
137
  reconcile/aus/version_gates/sts_version_gate_handler.py,sha256=swwwz0YyvrEBf_InqrRRBCt2QzHYNvvq8jz9aYwElh4,3663
139
138
  reconcile/automated_actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
140
139
  reconcile/automated_actions/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
141
- reconcile/automated_actions/config/integration.py,sha256=sHraZXmSg5diPr2T80qhqmm5flA-Wnz_dk15ZAK3dh0,12908
140
+ reconcile/automated_actions/config/integration.py,sha256=EbVJGyEAFf91dHiIlnwbetbqZ3Y7HJOez2Fnexzd550,13853
142
141
  reconcile/aws_account_manager/README.md,sha256=_XFM3GZNHUzv--e_navqJuaUWpjC6QrHfulreHynFf0,262
143
142
  reconcile/aws_account_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
144
143
  reconcile/aws_account_manager/integration.py,sha256=XTamC824imAezzVoQhhwdMOawNcPCOghR_y7i_8bpJI,15343
@@ -216,7 +215,7 @@ reconcile/glitchtip_project_alerts/integration.py,sha256=d3PMy-mQSbSZdIGAVaZCA2U
216
215
  reconcile/glitchtip_project_dsn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
217
216
  reconcile/glitchtip_project_dsn/integration.py,sha256=2iugub-kHYkHNK33n0v9_TeWonuxCPah_VkoTPvaajE,8077
218
217
  reconcile/gql_definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
219
- reconcile/gql_definitions/introspection.json,sha256=7uISKAEWpJ2RvF2BvOeIDXvKEL46DaKjG1lHMFft2V8,2338518
218
+ reconcile/gql_definitions/introspection.json,sha256=_PKgzpmgWQJ8HF4irKjyxjOTXdw4YRgytoZQWJfigao,2346322
220
219
  reconcile/gql_definitions/acs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
221
220
  reconcile/gql_definitions/acs/acs_instances.py,sha256=L91WW9LbhJbBSrECqShQpFtjoBOsmNIYLRpMbx1io5o,2181
222
221
  reconcile/gql_definitions/acs/acs_policies.py,sha256=Ygpfl2-VkYLSlJvHgp_dJBfb66K_Rwfdfpsa18w1v1s,4338
@@ -230,7 +229,7 @@ reconcile/gql_definitions/app_sre_tekton_access_revalidation/__init__.py,sha256=
230
229
  reconcile/gql_definitions/app_sre_tekton_access_revalidation/roles.py,sha256=8Y4NsS5T7tumDWxY5MuoV50MK2i-DsLYSpCRjb7KaLE,2353
231
230
  reconcile/gql_definitions/app_sre_tekton_access_revalidation/users.py,sha256=XdVxBxiyTR6Cy939EHNw__0k7iWrZWlhrgS5DakST0I,2504
232
231
  reconcile/gql_definitions/automated_actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
233
- reconcile/gql_definitions/automated_actions/instance.py,sha256=s7u8DczbfpVVzzDO5sOHYNWdWoPXJmkP2gGF6MpwUbA,9946
232
+ reconcile/gql_definitions/automated_actions/instance.py,sha256=6UPBKXPSjBsTXGdRQMK1ZXuns5pMPgYBscO3LxU3Gow,12406
234
233
  reconcile/gql_definitions/aws_account_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
235
234
  reconcile/gql_definitions/aws_account_manager/aws_accounts.py,sha256=vF51KrY2gwX0J9vESiaRMPQqdAMEtz9f_tBq52bInp0,5148
236
235
  reconcile/gql_definitions/aws_ami_cleanup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -617,7 +616,7 @@ reconcile/utils/helm.py,sha256=wC1h0GylhDFeZ6hZEtYy2giAGIIQroaQhkAtURoSlI8,3893
617
616
  reconcile/utils/helpers.py,sha256=koyAtYnxsUVx-HIn6GpedcUE-ekz_VtoYDkiZ0iv8ik,1795
618
617
  reconcile/utils/imap_client.py,sha256=h8YDiCSCvroErhpH_-KGYI7Y2WU2Q2oSpuxDFbOkSbY,1989
619
618
  reconcile/utils/instrumented_wrappers.py,sha256=VqT4s0Bdicv224-uSeSaugtHXm-xJ3oSeBiqj0QQRiU,1942
620
- reconcile/utils/jenkins_api.py,sha256=RaKuZmO7_lbI-hE6c_Pq2a6CQdmBVj7BcP2jR68cIbI,7081
619
+ reconcile/utils/jenkins_api.py,sha256=3wm29isLhhK0E9MB3v25SciC9OxmOl1Omtv0s3cfspI,6735
621
620
  reconcile/utils/jira_client.py,sha256=jj7E58PGssoCUEhUZpXoVYeyuChjrvjcg1AdNsONXO0,10545
622
621
  reconcile/utils/jjb_client.py,sha256=e5cDeNAeJMGz3sZMJ1KUIMFyLdRet0YnC0Qgj1vTPHc,15239
623
622
  reconcile/utils/jsonpath.py,sha256=wdxOMqR-GMpQf5vRPWRMqAF7bCiXDBkkcFfY2U4j_tk,5536
@@ -799,7 +798,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
799
798
  tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
800
799
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
801
800
  tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
802
- qontract_reconcile-0.10.2.dev243.dist-info/METADATA,sha256=6xA4naj3WZA1ys-EcVERD6rXI3ickOb_Qahp0lakNOI,24167
803
- qontract_reconcile-0.10.2.dev243.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
804
- qontract_reconcile-0.10.2.dev243.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
805
- qontract_reconcile-0.10.2.dev243.dist-info/RECORD,,
801
+ qontract_reconcile-0.10.2.dev245.dist-info/METADATA,sha256=xxZiW8qJRkrhvX6d89G8EIDt9m9ZIQ4xrQEzSTd_LdQ,24049
802
+ qontract_reconcile-0.10.2.dev245.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
803
+ qontract_reconcile-0.10.2.dev245.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
804
+ qontract_reconcile-0.10.2.dev245.dist-info/RECORD,,
@@ -19,6 +19,7 @@ from reconcile.gql_definitions.automated_actions.instance import (
19
19
  AutomatedActionActionListV1,
20
20
  AutomatedActionExternalResourceFlushElastiCacheV1,
21
21
  AutomatedActionExternalResourceRdsRebootV1,
22
+ AutomatedActionExternalResourceRdsSnapshotV1,
22
23
  AutomatedActionOpenshiftWorkloadRestartArgumentV1,
23
24
  AutomatedActionOpenshiftWorkloadRestartV1,
24
25
  AutomatedActionsInstanceV1,
@@ -178,13 +179,30 @@ class AutomatedActionsConfigIntegration(
178
179
  "identifier": ec_arg.identifier,
179
180
  })
180
181
  case AutomatedActionExternalResourceRdsRebootV1():
181
- for rds_arg in action.external_resource_rds_reboot_arguments:
182
- for rds_er in rds_arg.namespace.external_resources or []:
183
- if not isinstance(rds_er.provisioner, AWSAccountV1):
182
+ for rds_reboot_arg in action.external_resource_rds_reboot_arguments:
183
+ for rds_reboot_er in (
184
+ rds_reboot_arg.namespace.external_resources or []
185
+ ):
186
+ if not isinstance(rds_reboot_er.provisioner, AWSAccountV1):
184
187
  continue
185
188
  parameters.append({
186
- "account": f"^{rds_er.provisioner.name}$",
187
- "identifier": rds_arg.identifier,
189
+ "account": f"^{rds_reboot_er.provisioner.name}$",
190
+ "identifier": rds_reboot_arg.identifier,
191
+ })
192
+ case AutomatedActionExternalResourceRdsSnapshotV1():
193
+ for (
194
+ rds_snapshot_arg
195
+ ) in action.external_resource_rds_snapshot_arguments:
196
+ for rds_snapshot_er in (
197
+ rds_snapshot_arg.namespace.external_resources or []
198
+ ):
199
+ if not isinstance(
200
+ rds_snapshot_er.provisioner, AWSAccountV1
201
+ ):
202
+ continue
203
+ parameters.append({
204
+ "account": f"^{rds_snapshot_er.provisioner.name}$",
205
+ "identifier": rds_snapshot_arg.identifier,
188
206
  })
189
207
  case AutomatedActionOpenshiftWorkloadRestartV1():
190
208
  parameters.extend(
reconcile/cli.py CHANGED
@@ -1103,14 +1103,6 @@ def jenkins_job_builds_cleaner(ctx: click.Context) -> None:
1103
1103
  run_integration(reconcile.jenkins_job_builds_cleaner, ctx)
1104
1104
 
1105
1105
 
1106
- @integration.command(short_help="Delete Jenkins jobs in multiple tenant instances.")
1107
- @click.pass_context
1108
- def jenkins_job_cleaner(ctx: click.Context) -> None:
1109
- import reconcile.jenkins_job_cleaner
1110
-
1111
- run_integration(reconcile.jenkins_job_cleaner, ctx)
1112
-
1113
-
1114
1106
  @integration.command(short_help="Manage web hooks to Jenkins jobs.")
1115
1107
  @click.pass_context
1116
1108
  def jenkins_webhooks(ctx: click.Context) -> None:
@@ -118,6 +118,20 @@ query AutomatedActionsInstances {
118
118
  identifier
119
119
  }
120
120
  }
121
+ ... on AutomatedActionExternalResourceRdsSnapshot_v1 {
122
+ external_resource_rds_snapshot_arguments: arguments {
123
+ namespace {
124
+ externalResources {
125
+ provisioner {
126
+ ... on AWSAccount_v1 {
127
+ name
128
+ }
129
+ }
130
+ }
131
+ }
132
+ identifier
133
+ }
134
+ }
121
135
  ... on AutomatedActionOpenshiftWorkloadRestart_v1 {
122
136
  openshift_workload_restart_arguments: arguments {
123
137
  namespace {
@@ -237,6 +251,31 @@ class AutomatedActionExternalResourceRdsRebootV1(AutomatedActionV1):
237
251
  external_resource_rds_reboot_arguments: list[AutomatedActionExternalResourceRdsRebootV1_AutomatedActionExternalResourceArgumentV1] = Field(..., alias="external_resource_rds_reboot_arguments")
238
252
 
239
253
 
254
+ class AutomatedActionExternalResourceRdsSnapshotV1_AutomatedActionExternalResourceArgumentV1_NamespaceV1_NamespaceExternalResourceV1_ExternalResourcesProvisionerV1(ConfiguredBaseModel):
255
+ ...
256
+
257
+
258
+ class AutomatedActionExternalResourceRdsSnapshotV1_AutomatedActionExternalResourceArgumentV1_NamespaceV1_NamespaceExternalResourceV1_ExternalResourcesProvisionerV1_AWSAccountV1(AutomatedActionExternalResourceRdsSnapshotV1_AutomatedActionExternalResourceArgumentV1_NamespaceV1_NamespaceExternalResourceV1_ExternalResourcesProvisionerV1):
259
+ name: str = Field(..., alias="name")
260
+
261
+
262
+ class AutomatedActionExternalResourceRdsSnapshotV1_AutomatedActionExternalResourceArgumentV1_NamespaceV1_NamespaceExternalResourceV1(ConfiguredBaseModel):
263
+ provisioner: Union[AutomatedActionExternalResourceRdsSnapshotV1_AutomatedActionExternalResourceArgumentV1_NamespaceV1_NamespaceExternalResourceV1_ExternalResourcesProvisionerV1_AWSAccountV1, AutomatedActionExternalResourceRdsSnapshotV1_AutomatedActionExternalResourceArgumentV1_NamespaceV1_NamespaceExternalResourceV1_ExternalResourcesProvisionerV1] = Field(..., alias="provisioner")
264
+
265
+
266
+ class AutomatedActionExternalResourceRdsSnapshotV1_AutomatedActionExternalResourceArgumentV1_NamespaceV1(ConfiguredBaseModel):
267
+ external_resources: Optional[list[AutomatedActionExternalResourceRdsSnapshotV1_AutomatedActionExternalResourceArgumentV1_NamespaceV1_NamespaceExternalResourceV1]] = Field(..., alias="externalResources")
268
+
269
+
270
+ class AutomatedActionExternalResourceRdsSnapshotV1_AutomatedActionExternalResourceArgumentV1(ConfiguredBaseModel):
271
+ namespace: AutomatedActionExternalResourceRdsSnapshotV1_AutomatedActionExternalResourceArgumentV1_NamespaceV1 = Field(..., alias="namespace")
272
+ identifier: str = Field(..., alias="identifier")
273
+
274
+
275
+ class AutomatedActionExternalResourceRdsSnapshotV1(AutomatedActionV1):
276
+ external_resource_rds_snapshot_arguments: list[AutomatedActionExternalResourceRdsSnapshotV1_AutomatedActionExternalResourceArgumentV1] = Field(..., alias="external_resource_rds_snapshot_arguments")
277
+
278
+
240
279
  class DisableClusterAutomationsV1(ConfiguredBaseModel):
241
280
  integrations: Optional[list[str]] = Field(..., alias="integrations")
242
281
 
@@ -265,7 +304,7 @@ class AutomatedActionOpenshiftWorkloadRestartV1(AutomatedActionV1):
265
304
  class AutomatedActionsInstanceV1(ConfiguredBaseModel):
266
305
  name: str = Field(..., alias="name")
267
306
  deployment: NamespaceV1 = Field(..., alias="deployment")
268
- actions: Optional[list[Union[AutomatedActionActionListV1, AutomatedActionExternalResourceFlushElastiCacheV1, AutomatedActionExternalResourceRdsRebootV1, AutomatedActionOpenshiftWorkloadRestartV1, AutomatedActionV1]]] = Field(..., alias="actions")
307
+ actions: Optional[list[Union[AutomatedActionActionListV1, AutomatedActionExternalResourceFlushElastiCacheV1, AutomatedActionExternalResourceRdsRebootV1, AutomatedActionExternalResourceRdsSnapshotV1, AutomatedActionOpenshiftWorkloadRestartV1, AutomatedActionV1]]] = Field(..., alias="actions")
269
308
 
270
309
 
271
310
  class AutomatedActionsInstancesQueryData(ConfiguredBaseModel):
@@ -5696,6 +5696,11 @@
5696
5696
  "name": "AutomatedActionExternalResourceRdsReboot_v1",
5697
5697
  "ofType": null
5698
5698
  },
5699
+ {
5700
+ "kind": "OBJECT",
5701
+ "name": "AutomatedActionExternalResourceRdsSnapshot_v1",
5702
+ "ofType": null
5703
+ },
5699
5704
  {
5700
5705
  "kind": "OBJECT",
5701
5706
  "name": "AutomatedActionNoOp_v1",
@@ -27286,6 +27291,11 @@
27286
27291
  "name": "AutomatedActionExternalResourceRdsReboot_v1",
27287
27292
  "ofType": null
27288
27293
  },
27294
+ {
27295
+ "kind": "OBJECT",
27296
+ "name": "AutomatedActionExternalResourceRdsSnapshot_v1",
27297
+ "ofType": null
27298
+ },
27289
27299
  {
27290
27300
  "kind": "OBJECT",
27291
27301
  "name": "AutomatedActionNoOp_v1",
@@ -53550,6 +53560,172 @@
53550
53560
  "enumValues": null,
53551
53561
  "possibleTypes": null
53552
53562
  },
53563
+ {
53564
+ "kind": "OBJECT",
53565
+ "name": "AutomatedActionExternalResourceRdsSnapshot_v1",
53566
+ "description": null,
53567
+ "fields": [
53568
+ {
53569
+ "name": "schema",
53570
+ "description": null,
53571
+ "args": [],
53572
+ "type": {
53573
+ "kind": "NON_NULL",
53574
+ "name": null,
53575
+ "ofType": {
53576
+ "kind": "SCALAR",
53577
+ "name": "String",
53578
+ "ofType": null
53579
+ }
53580
+ },
53581
+ "isDeprecated": false,
53582
+ "deprecationReason": null
53583
+ },
53584
+ {
53585
+ "name": "path",
53586
+ "description": null,
53587
+ "args": [],
53588
+ "type": {
53589
+ "kind": "NON_NULL",
53590
+ "name": null,
53591
+ "ofType": {
53592
+ "kind": "SCALAR",
53593
+ "name": "String",
53594
+ "ofType": null
53595
+ }
53596
+ },
53597
+ "isDeprecated": false,
53598
+ "deprecationReason": null
53599
+ },
53600
+ {
53601
+ "name": "type",
53602
+ "description": null,
53603
+ "args": [],
53604
+ "type": {
53605
+ "kind": "NON_NULL",
53606
+ "name": null,
53607
+ "ofType": {
53608
+ "kind": "SCALAR",
53609
+ "name": "String",
53610
+ "ofType": null
53611
+ }
53612
+ },
53613
+ "isDeprecated": false,
53614
+ "deprecationReason": null
53615
+ },
53616
+ {
53617
+ "name": "description",
53618
+ "description": null,
53619
+ "args": [],
53620
+ "type": {
53621
+ "kind": "SCALAR",
53622
+ "name": "String",
53623
+ "ofType": null
53624
+ },
53625
+ "isDeprecated": false,
53626
+ "deprecationReason": null
53627
+ },
53628
+ {
53629
+ "name": "maxOps",
53630
+ "description": null,
53631
+ "args": [],
53632
+ "type": {
53633
+ "kind": "NON_NULL",
53634
+ "name": null,
53635
+ "ofType": {
53636
+ "kind": "SCALAR",
53637
+ "name": "Int",
53638
+ "ofType": null
53639
+ }
53640
+ },
53641
+ "isDeprecated": false,
53642
+ "deprecationReason": null
53643
+ },
53644
+ {
53645
+ "name": "instances",
53646
+ "description": null,
53647
+ "args": [],
53648
+ "type": {
53649
+ "kind": "NON_NULL",
53650
+ "name": null,
53651
+ "ofType": {
53652
+ "kind": "LIST",
53653
+ "name": null,
53654
+ "ofType": {
53655
+ "kind": "NON_NULL",
53656
+ "name": null,
53657
+ "ofType": {
53658
+ "kind": "OBJECT",
53659
+ "name": "AutomatedActionsInstance_v1",
53660
+ "ofType": null
53661
+ }
53662
+ }
53663
+ }
53664
+ },
53665
+ "isDeprecated": false,
53666
+ "deprecationReason": null
53667
+ },
53668
+ {
53669
+ "name": "permissions",
53670
+ "description": null,
53671
+ "args": [],
53672
+ "type": {
53673
+ "kind": "LIST",
53674
+ "name": null,
53675
+ "ofType": {
53676
+ "kind": "NON_NULL",
53677
+ "name": null,
53678
+ "ofType": {
53679
+ "kind": "OBJECT",
53680
+ "name": "PermissionAutomatedActions_v1",
53681
+ "ofType": null
53682
+ }
53683
+ }
53684
+ },
53685
+ "isDeprecated": false,
53686
+ "deprecationReason": null
53687
+ },
53688
+ {
53689
+ "name": "arguments",
53690
+ "description": null,
53691
+ "args": [],
53692
+ "type": {
53693
+ "kind": "NON_NULL",
53694
+ "name": null,
53695
+ "ofType": {
53696
+ "kind": "LIST",
53697
+ "name": null,
53698
+ "ofType": {
53699
+ "kind": "NON_NULL",
53700
+ "name": null,
53701
+ "ofType": {
53702
+ "kind": "OBJECT",
53703
+ "name": "AutomatedActionExternalResourceArgument_v1",
53704
+ "ofType": null
53705
+ }
53706
+ }
53707
+ }
53708
+ },
53709
+ "isDeprecated": false,
53710
+ "deprecationReason": null
53711
+ }
53712
+ ],
53713
+ "inputFields": null,
53714
+ "interfaces": [
53715
+ {
53716
+ "kind": "INTERFACE",
53717
+ "name": "AutomatedAction_v1",
53718
+ "ofType": null
53719
+ },
53720
+ {
53721
+ "kind": "INTERFACE",
53722
+ "name": "DatafileObject_v1",
53723
+ "ofType": null
53724
+ }
53725
+ ],
53726
+ "enumValues": null,
53727
+ "possibleTypes": null
53728
+ },
53553
53729
  {
53554
53730
  "kind": "OBJECT",
53555
53731
  "name": "AutomatedActionNoOp_v1",
@@ -93,20 +93,6 @@ class JenkinsApi:
93
93
  )
94
94
  res.raise_for_status()
95
95
 
96
- def delete_job(self, job_name):
97
- kwargs = self.get_crumb_kwargs()
98
-
99
- url = f"{self.url}/job/{job_name}/doDelete"
100
- res = requests.post(
101
- url,
102
- verify=self.ssl_verify,
103
- auth=(self.user, self.password),
104
- timeout=60,
105
- **kwargs,
106
- )
107
-
108
- res.raise_for_status()
109
-
110
96
  def get_all_roles(self):
111
97
  url = f"{self.url}/role-strategy/strategy/getAllRoles"
112
98
  res = requests.get(
@@ -1,51 +0,0 @@
1
- import logging
2
- from collections.abc import Iterable
3
-
4
- from reconcile import queries
5
- from reconcile.jenkins_job_builder import init_jjb
6
- from reconcile.utils.jenkins_api import JenkinsApi
7
- from reconcile.utils.secret_reader import SecretReader
8
-
9
- QONTRACT_INTEGRATION = "jenkins-job-cleaner"
10
-
11
-
12
- def get_managed_job_names(
13
- job_names: Iterable[str], managed_projects: Iterable[str]
14
- ) -> list[str]:
15
- managed_jobs = set()
16
- for job_name in job_names:
17
- for managed_project in managed_projects:
18
- if job_name.startswith(managed_project):
19
- managed_jobs.add(job_name)
20
-
21
- return list(managed_jobs)
22
-
23
-
24
- def get_desired_job_names(instance_name: str, secret_reader: SecretReader) -> list[str]:
25
- jjb = init_jjb(secret_reader)
26
- desired_jobs = jjb.get_all_jobs(instance_name=instance_name)[instance_name]
27
- return [j["name"] for j in desired_jobs]
28
-
29
-
30
- def run(dry_run: bool) -> None:
31
- jenkins_instances = queries.get_jenkins_instances()
32
- secret_reader = SecretReader(queries.get_secret_reader_settings())
33
-
34
- for instance in jenkins_instances:
35
- if instance.get("deleteMethod") != "manual":
36
- continue
37
- managed_projects = instance.get("managedProjects")
38
- if not managed_projects:
39
- continue
40
-
41
- instance_name = instance["name"]
42
- jenkins = JenkinsApi.init_jenkins_from_secret(secret_reader, instance["token"])
43
- all_job_names = jenkins.get_job_names()
44
- managed_job_names = get_managed_job_names(all_job_names, managed_projects)
45
- desired_job_names = get_desired_job_names(instance_name, secret_reader)
46
- delete_job_names = [j for j in managed_job_names if j not in desired_job_names]
47
-
48
- for job_name in delete_job_names:
49
- logging.info(["delete_job", instance_name, job_name])
50
- if not dry_run:
51
- jenkins.delete_job(job_name)