From 1565f8bfb2c65629442251c9c9f0593c71f65fe6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:04:11 +0200 Subject: [PATCH 01/13] Bump pl.allegro.tech.build.axion-release from 1.18.4 to 1.18.5 (#141) Bumps [pl.allegro.tech.build.axion-release](https://github.com/allegro/axion-release-plugin) from 1.18.4 to 1.18.5. - [Release notes](https://github.com/allegro/axion-release-plugin/releases) - [Commits](https://github.com/allegro/axion-release-plugin/compare/v1.18.4...v1.18.5) --- updated-dependencies: - dependency-name: pl.allegro.tech.build.axion-release dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 02b82f3..baa1b39 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id("io.micronaut.application") version "4.4.2" id("jacoco") id("org.sonarqube") version "5.1.0.4882" - id("pl.allegro.tech.build.axion-release") version "1.18.4" + id("pl.allegro.tech.build.axion-release") version "1.18.5" id("checkstyle") } From f58ad57a5e44134ffaf7d3be2b8307813fe7b557 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:08:18 +0200 Subject: [PATCH 02/13] Bump org.junit.jupiter:junit-jupiter-params from 5.10.3 to 5.11.0 (#142) Bumps [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5) from 5.10.3 to 5.11.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.3...r5.11.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-params dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index baa1b39..67ed382 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ dependencies { testImplementation("io.micronaut:micronaut-http-client") testImplementation("org.mockito:mockito-junit-jupiter:5.12.0") - testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.3") + testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.0") testImplementation("org.mockito:mockito-core") testAnnotationProcessor("org.projectlombok:lombok") From d9204e61cf9badbff6054b7099b4cfd9e4567101 Mon Sep 17 00:00:00 2001 From: Thomas CAI <92149044+ThomasCAI-mlv@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:24:23 +0200 Subject: [PATCH 03/13] Delete a specific version of a schema (#143) --- README.md | 193 ++++++------------ .../client/NamespacedResourceClient.java | 5 +- .../kafkactl/command/ApiResources.java | 5 +- .../com/michelin/kafkactl/command/Apply.java | 7 +- .../michelin/kafkactl/command/Connector.java | 5 +- .../com/michelin/kafkactl/command/Delete.java | 53 +++-- .../kafkactl/command/DeleteRecords.java | 5 +- .../com/michelin/kafkactl/command/Diff.java | 7 +- .../com/michelin/kafkactl/command/Get.java | 5 +- .../com/michelin/kafkactl/command/Import.java | 5 +- .../kafkactl/command/ResetOffsets.java | 5 +- .../kafkactl/command/ResetPassword.java | 5 +- .../com/michelin/kafkactl/command/Schema.java | 5 +- .../michelin/kafkactl/command/auth/Auth.java | 8 +- .../kafkactl/command/auth/AuthInfo.java | 8 +- .../kafkactl/command/auth/AuthRenew.java | 8 +- .../kafkactl/command/config/Config.java | 8 +- .../command/config/ConfigCurrentContext.java | 5 +- .../command/config/ConfigGetContexts.java | 8 +- .../command/config/ConfigUseContext.java | 8 +- .../connectcluster/ConnectCluster.java | 8 +- .../connectcluster/ConnectClusterVault.java | 5 +- .../kafkactl/hook/AuthenticatedHook.java | 4 +- .../com/michelin/kafkactl/hook/HelpHook.java | 13 ++ .../hook/ValidCurrentContextHook.java | 2 +- .../kafkactl/mixin/UnmaskTokenMixin.java | 4 +- .../kafkactl/service/ResourceService.java | 12 +- .../michelin/kafkactl/command/DeleteTest.java | 86 +++++++- .../kafkactl/service/ResourceServiceTest.java | 43 +++- 29 files changed, 276 insertions(+), 259 deletions(-) create mode 100644 src/main/java/com/michelin/kafkactl/hook/HelpHook.java diff --git a/README.md b/README.md index eeee824..a82d338 100644 --- a/README.md +++ b/README.md @@ -139,17 +139,12 @@ After a successful authentication, a JWT token signed by Ns4Kafka is written to ## Usage ```console -Usage: kafkactl [-hvV] [-n=] [COMMAND] +Usage: kafkactl [-hV] [COMMAND] -Description: - -These are common Kafkactl commands. +Description: These are common Kafkactl commands. Options: -h, --help Show this help message and exit. - -n, --namespace= - Override namespace defined in config or YAML resources. - -v, --verbose Enable the verbose mode. -V, --version Print version information and exit. Commands: @@ -174,18 +169,15 @@ Commands: The `api-resources` command allows you to check which resources can be accessed through the API. ```console -Usage: kafkactl api-resources [-hvV] [-n=] +Usage: kafkactl api-resources [-hv] [-n=] -Description: - -Print the supported API resources on the server. +Description: Print the supported API resources on the server. Options: -h, --help Show this help message and exit. -n, --namespace= Override namespace defined in config or YAML resources. -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` Example(s): @@ -199,18 +191,12 @@ kafkactl api-resources The `auth` command allows you to interact with authentication. ```console -Usage: kafkactl auth [-hvV] [-n=] [COMMAND] +Usage: kafkactl auth [-h] COMMAND -Description: - -Interact with authentication. +Description: Interact with authentication. Options: - -h, --help Show this help message and exit. - -n, --namespace= - Override namespace defined in config or YAML resources. - -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. + -h, --help Show this help message and exit. Commands: info Get the JWT token information. @@ -222,19 +208,14 @@ Commands: The `info` command allows you to get the JWT token information. ```console -Usage: kafkactl auth info [-hvV] [-n=] [-o=] - -Description: +Usage: kafkactl auth info [-h] [-o=] -Get the JWT token information. +Description: Get the JWT token information. Options: -h, --help Show this help message and exit. - -n, --namespace= - Override namespace defined in config or YAML resources. -o, --output= Output format. One of: yaml|table - -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. + ``` Example(s): @@ -248,18 +229,13 @@ kafkactl auth info The `renew` command allows you to renew the JWT token. ```console -Usage: kafkactl auth renew [-hvV] [-n=] +Usage: kafkactl auth renew [-hv] -Description: - -Renew the JWT token. +Description: Renew the JWT token. Options: -h, --help Show this help message and exit. - -n, --namespace= - Override namespace defined in config or YAML resources. -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` Example(s): @@ -273,11 +249,9 @@ kafkactl auth renew The `apply` command allows you to deploy a resource. ```console -Usage: kafkactl apply [-hRvV] [--dry-run] [-f=] [-n=] - -Description: +Usage: kafkactl apply [-hRv] [--dry-run] [-f=] [-n=] -Create or update a resource. +Description: Create or update a resource. Options: --dry-run Does not persist resources. Validate only. @@ -287,7 +261,6 @@ Options: Override namespace defined in config or YAML resources. -R, --recursive Search file recursively. -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` Example(s): @@ -304,18 +277,12 @@ The resources have to be described in YAML manifests. The `config` command allows you to manage your Kafka contexts. ```console -Usage: kafkactl config [-hvV] [-n=] [COMMAND] +Usage: kafkactl config [-h] COMMAND -Description: - -Manage configuration. +Description: Manage configuration. Options: - -h, --help Show this help message and exit. - -n, --namespace= - Override namespace defined in config or YAML resources. - -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. + -h, --help Show this help message and exit. Commands: get-contexts Get all contexts. @@ -328,18 +295,13 @@ Commands: The `current-context` command allows you to check the current context. ```console -Usage: kafkactl config current-context [-hvV] [-n=] +Usage: kafkactl config current-context [-hu] -Description: - -Get the current context. +Description: Get the current context. Options: - -h, --help Show this help message and exit. - -n, --namespace= - Override namespace defined in config or YAML resources. - -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. + -h, --help Show this help message and exit. + -u, --unmask-tokens Unmask tokens. ``` Example(s): @@ -353,18 +315,13 @@ kafkactl config current-context The `get-contexts` command allows you to list all the contexts defined in your configuration file. ```console -Usage: kafkactl config get-contexts [-hvV] [-n=] +Usage: kafkactl config get-contexts [-hu] -Description: - -Get all contexts. +Description: Get all contexts. Options: - -h, --help Show this help message and exit. - -n, --namespace= - Override namespace defined in config or YAML resources. - -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. + -h, --help Show this help message and exit. + -u, --unmask-tokens Unmask tokens. ``` Example(s): @@ -378,21 +335,15 @@ kafkactl config get-contexts The `use-context` command allows you to switch to a different context. ```console -Usage: kafkactl config use-context [-hvV] [-n=] +Usage: kafkactl config use-context [-h] -Description: - -Use a context. +Description: Use a context. Parameters: Context to use. Options: -h, --help Show this help message and exit. - -n, --namespace= - Override namespace defined in config or YAML resources. - -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` Example(s): @@ -406,18 +357,12 @@ kafkactl config use-context local The `connect-cluster` command allows you to interact with Kafka Connect clusters. ```console -Usage: kafkactl connect-cluster [-hvV] [-n=] [COMMAND] +Usage: kafkactl connect-cluster [-h] [COMMAND] -Description: - -Interact with connect clusters. +Description: Interact with connect clusters. Options: - -h, --help Show this help message and exit. - -n, --namespace= - Override namespace defined in config or YAML resources. - -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. + -h, --help Show this help message and exit. Commands: vault Vault secrets for a connect cluster. @@ -428,11 +373,9 @@ Commands: The `vault` command allows you to vault sensitive connector configuration. ```console -Usage: kafkactl connect-cluster vault [-hvV] [-n=] [...] +Usage: kafkactl connect-cluster vault [-hv] [-n=] [...] -Description: - -Vault secrets for a connect cluster. +Description: Vault secrets for a connect cluster. Parameters: Connect cluster name that will vault the secrets. @@ -443,7 +386,6 @@ Options: -n, --namespace= Override namespace defined in config or YAML resources. -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` - `connectClusterName`: If defined, this option specifies the name of a Connect cluster to use to vault sensitive @@ -462,11 +404,9 @@ kafkactl connect-cluster vault myConnectCluster someClearText The `connector` command allows you to interact with Kafka Connect connectors. ```console -Usage: kafkactl connector [-hvV] [-n=] ... - -Description: +Usage: kafkactl connector [-hv] [-n=] ... -Interact with connectors. +Description: Interact with connectors. Parameters: Action to perform (pause, resume, restart). @@ -477,7 +417,6 @@ Options: -n, --namespace= Override namespace defined in config or YAML resources. -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` - `action`: This option specifies the action to execute, which can be `pause`, `resume`, `restart` @@ -496,11 +435,9 @@ kafkactl connector restart myConnector The `delete-records` command allows you to delete all records within "delete" typed topics. ```console -Usage: kafkactl delete-records [-hvV] [--dry-run] [-n=] +Usage: kafkactl delete-records [-hv] [--dry-run] [-n=] -Description: - -Delete all records within a topic. +Description: Delete all records within a topic. Parameters: Name of the topic. @@ -511,7 +448,6 @@ Options: -n, --namespace= Override namespace defined in config or YAML resources. -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` Example(s): @@ -528,8 +464,7 @@ Please note that the resources are deleted instantly and cannot be recovered onc with the resource is permanently lost. ```console -Usage: kafkactl delete [-hvV] [--dry-run] [-n=] ([ ] | [[-f=] [-R]]) - +Usage: kafkactl delete [-hv] [--dry-run] [-n=] ([ [-V[=]]] | [[-f=] [-R]]) Description: Delete a resource. @@ -539,14 +474,15 @@ Parameters: Resource name. Options: - --dry-run Does not persist operation. Validate only. - -f, --file= YAML file or directory containing resources. + --dry-run Does not persist resources. Validate only. + -f, --file= YAML file or directory containing resources to delete. -h, --help Show this help message and exit. -n, --namespace= Override namespace defined in config or YAML resources. -R, --recursive Search file recursively. -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. + -V, --version= + Version to delete. Only with schema resource and name parameter. ``` Example(s): @@ -554,6 +490,8 @@ Example(s): ```console kafkactl delete -f directoryOfResources kafkactl delete -f resource.yml +kafkactl delete myResource +kafkactl delete mySchema -V latest ``` ### Diff @@ -562,20 +500,17 @@ The `diff` command allows you to compare a new YAML descriptor with the current to easily identify any differences. ```console -Usage: kafkactl diff [-hRvV] [-f=] [-n=] +Usage: kafkactl diff [-hRv] [-f=] [-n=] -Description: - -Get differences between a new resource and a old resource. +Description: Get differences between a new resource and a old resource. Options: - -f, --file= YAML file or directory containing resources. + -f, --file= YAML file or directory containing resources to compare. -h, --help Show this help message and exit. -n, --namespace= Override namespace defined in config or YAML resources. -R, --recursive Search file recursively. -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` Example(s): @@ -589,11 +524,9 @@ kafkactl diff -f resource.yml The `get` command allows you to retrieve information about one or multiple resources. ```console -Usage: kafkactl get [-hvV] [-n=] [-o=] [] +Usage: kafkactl get [-hv] [-n=] [-o=] [] -Description: - -Get resources by resource type for the current namespace. +Description: Get resources by resource type for the current namespace. Parameters: Resource type or 'all' to display resources of all types. @@ -605,7 +538,6 @@ Options: Override namespace defined in config or YAML resources. -o, --output= Output format. One of: yaml|table -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` - `resourceType`: This option specifies one of the managed resources: `topic`, `connector`, `acl`, `schema`, `stream` @@ -626,11 +558,9 @@ The `import` command allows you to import unsynchronized resources between Ns4Ka cluster. ```console -Usage: kafkactl import [-hvV] [--dry-run] [-n=] +Usage: kafkactl import [-hv] [--dry-run] [-n=] -Description: - -Import non-synchronized resources. +Description: Import non-synchronized resources. Parameters: Resource type. @@ -641,7 +571,6 @@ Options: -n, --namespace= Override namespace defined in config or YAML resources. -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` - `resourceType`: This option specifies the type of resource that you want to import, which can be either `topics` @@ -659,12 +588,10 @@ kafkactl import connects The `reset-offsets` command allows you to reset the offsets of consumer groups and topics. ```console -Usage: kafkactl reset-offsets [-hvV] [--dry-run] --group= [-n=] (--topic= | --all-topics) (--to-earliest | --to-latest | +Usage: kafkactl reset-offsets [-hv] [--dry-run] --group=[-n=] (--topic= | --all-topics) (--to-earliest | --to-latest | --to-datetime= | --shift-by= | --by-duration= | --to-offset=) -Description: - -Reset consumer group offsets. +Description: Reset consumer group offsets. Options: --all-topics All topics. @@ -683,7 +610,6 @@ Options: --to-offset= Set offset to a specific index. --topic= Topic name or topic:partition. -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` - `--group`: This option specifies one of your consumer group to reset. @@ -702,11 +628,9 @@ kafkactl reset-offsets --group myConsumerGroup --topic myTopic --to-earliest The `reset-password` command allows you to reset the password of a user. ```console -Usage: kafkactl reset-password [-hvV] [--execute] [-n=] [-o=] - -Description: +Usage: kafkactl reset-password [-hv] [--execute] [-n=] [-o=] -Reset a Kafka password. +Description: Reset a Kafka password. Parameters: The user to reset password. @@ -718,7 +642,6 @@ Options: Override namespace defined in config or YAML resources. -o, --output= Output format. One of: yaml|table -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` Example(s): @@ -732,11 +655,9 @@ kafkactl reset-password myUser The `schema` command allows you to modify the schema compatibility. ```console -Usage: kafkactl schema [-hvV] [-n=] ... - -Description: +Usage: kafkactl schema [-hv] [-n=] ... -Interact with schemas. +Description: Interact with schemas. Parameters: Compatibility to set (global, backward, backward-transitive, forward, forward-transitive, full, full-transitive, none). @@ -747,7 +668,6 @@ Options: -n, --namespace= Override namespace defined in config or YAML resources. -v, --verbose Enable the verbose mode. - -V, --version Print version information and exit. ``` - `compatibility`: This option specifies the compatibility mode to apply. @@ -784,6 +704,7 @@ spec: - tag1 - tag2 - tag3 + description: "myDescription" ``` - The `metadata.name` field must be part of your allowed ACLs. Visit your namespace's ACLs to understand which topics diff --git a/src/main/java/com/michelin/kafkactl/client/NamespacedResourceClient.java b/src/main/java/com/michelin/kafkactl/client/NamespacedResourceClient.java index f39810a..2c17004 100644 --- a/src/main/java/com/michelin/kafkactl/client/NamespacedResourceClient.java +++ b/src/main/java/com/michelin/kafkactl/client/NamespacedResourceClient.java @@ -2,6 +2,7 @@ import com.michelin.kafkactl.client.predicates.RetryTimeoutPredicate; import com.michelin.kafkactl.model.Resource; +import io.micronaut.core.annotation.Nullable; import io.micronaut.http.HttpResponse; import io.micronaut.http.annotation.Body; import io.micronaut.http.annotation.Delete; @@ -26,10 +27,11 @@ public interface NamespacedResourceClient { * @param kind The kind of resource * @param resourceName The name of the resource * @param token The auth token + * @param version The version of the resource, for schemas only. * @param dryrun is dry-run mode or not ? * @return The delete response */ - @Delete("{namespace}/{kind}/{resourceName}{?dryrun}") + @Delete("{namespace}/{kind}/{resourceName}{?version}{?dryrun}") @Retryable(delay = "${kafkactl.retry.delete.delay}", attempts = "${kafkactl.retry.delete.attempt}", multiplier = "${kafkactl.retry.delete.multiplier}", @@ -39,6 +41,7 @@ HttpResponse delete( String kind, String resourceName, @Header("Authorization") String token, + @Nullable @QueryValue String version, @QueryValue boolean dryrun); /** diff --git a/src/main/java/com/michelin/kafkactl/command/ApiResources.java b/src/main/java/com/michelin/kafkactl/command/ApiResources.java index 4deeb8a..0e8bdd5 100644 --- a/src/main/java/com/michelin/kafkactl/command/ApiResources.java +++ b/src/main/java/com/michelin/kafkactl/command/ApiResources.java @@ -7,7 +7,6 @@ import com.michelin.kafkactl.model.Metadata; import com.michelin.kafkactl.model.Resource; import com.michelin.kafkactl.service.FormatService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import io.micronaut.http.client.exceptions.HttpClientResponseException; import jakarta.inject.Inject; @@ -26,9 +25,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class ApiResources extends AuthenticatedHook { @Inject @ReflectiveAccess diff --git a/src/main/java/com/michelin/kafkactl/command/Apply.java b/src/main/java/com/michelin/kafkactl/command/Apply.java index fe7c3bf..042c083 100644 --- a/src/main/java/com/michelin/kafkactl/command/Apply.java +++ b/src/main/java/com/michelin/kafkactl/command/Apply.java @@ -5,7 +5,6 @@ import com.michelin.kafkactl.model.Resource; import com.michelin.kafkactl.service.FormatService; import com.michelin.kafkactl.service.ResourceService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import io.micronaut.http.client.exceptions.HttpClientResponseException; import jakarta.inject.Inject; @@ -28,9 +27,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class Apply extends DryRunHook { @Inject @ReflectiveAccess @@ -40,7 +37,7 @@ public class Apply extends DryRunHook { @ReflectiveAccess private ResourceService resourceService; - @Option(names = {"-f", "--file"}, description = "YAML file or directory containing resources.") + @Option(names = {"-f", "--file"}, description = "YAML file or directory containing resources to apply.") public Optional file; @Option(names = {"-R", "--recursive"}, description = "Search file recursively.") diff --git a/src/main/java/com/michelin/kafkactl/command/Connector.java b/src/main/java/com/michelin/kafkactl/command/Connector.java index 0b9522c..59ede56 100644 --- a/src/main/java/com/michelin/kafkactl/command/Connector.java +++ b/src/main/java/com/michelin/kafkactl/command/Connector.java @@ -10,7 +10,6 @@ import com.michelin.kafkactl.model.Resource; import com.michelin.kafkactl.service.FormatService; import com.michelin.kafkactl.service.ResourceService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import io.micronaut.http.client.exceptions.HttpClientResponseException; import jakarta.inject.Inject; @@ -34,9 +33,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class Connector extends AuthenticatedHook { @Inject @ReflectiveAccess diff --git a/src/main/java/com/michelin/kafkactl/command/Delete.java b/src/main/java/com/michelin/kafkactl/command/Delete.java index 9beeea3..a4ccc22 100644 --- a/src/main/java/com/michelin/kafkactl/command/Delete.java +++ b/src/main/java/com/michelin/kafkactl/command/Delete.java @@ -7,12 +7,12 @@ import com.michelin.kafkactl.service.FileService; import com.michelin.kafkactl.service.FormatService; import com.michelin.kafkactl.service.ResourceService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import io.micronaut.http.client.exceptions.HttpClientResponseException; import jakarta.inject.Inject; import java.io.File; import java.util.List; +import java.util.Map; import java.util.Optional; import picocli.CommandLine.ArgGroup; import picocli.CommandLine.Command; @@ -31,10 +31,10 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class Delete extends DryRunHook { + public static final String VERSION = "version"; + @Inject @ReflectiveAccess private ResourceService resourceService; @@ -69,8 +69,10 @@ public Integer onAuthSuccess() { .map(resource -> { ApiResource apiResource = apiResourcesService.getResourceDefinitionByKind(resource.getKind()).orElseThrow(); - return resourceService.delete(apiResource, namespace, resource.getMetadata().getName(), dryRun, - commandSpec); + Map spec = resource.getSpec(); + return resourceService.delete(apiResource, namespace, resource.getMetadata().getName(), + (spec != null && spec.containsKey(VERSION) ? spec.get(VERSION).toString() : null), + dryRun, commandSpec); }) .mapToInt(value -> Boolean.TRUE.equals(value) ? 0 : 1) .sum(); @@ -83,7 +85,7 @@ public Integer onAuthSuccess() { } /** - * Parse given resources. + * Parse input resources (given by file or by name) to build the list of resources to delete. * * @param namespace The namespace * @return A list of resources @@ -109,33 +111,56 @@ private List parseResources(String namespace) { } // Generate a single resource with minimum details from input - return List.of(Resource.builder() + var builder = Resource.builder() .metadata(Metadata.builder() .name(config.nameConfig.name) .namespace(namespace) .build()) - .kind(optionalApiResource.get().getKind()) - .build()); + .kind(optionalApiResource.get().getKind()); + + if (config.nameConfig.version.isPresent()) { + builder = builder.spec(Map.of(VERSION, config.nameConfig.version.get())); + } + return List.of(builder.build()); } - static class EitherOf { + /** + * By-name of by-file deletion config. + */ + public static class EitherOf { + /** + * Configuration for deletion by name. + */ @ArgGroup(exclusive = false) public ByName nameConfig; + /** + * Configuration for deletion by file. + */ @ArgGroup(exclusive = false) public ByFile fileConfig; } - static class ByName { + /** + * By-name deletion config. + */ + public static class ByName { @Parameters(index = "0", description = "Resource type.", arity = "1") public String resourceType; @Parameters(index = "1", description = "Resource name.", arity = "1") public String name; + + @Option(names = {"-V", "--version"}, + description = "Version to delete. Only with schema resource and name parameter.", arity = "0..1") + public Optional version; } - static class ByFile { - @Option(names = {"-f", "--file"}, description = "YAML file or directory containing resources.") + /** + * By-file deletion config. + */ + public static class ByFile { + @Option(names = {"-f", "--file"}, description = "YAML file or directory containing resources to delete.") public Optional file; @Option(names = {"-R", "--recursive"}, description = "Search file recursively.") diff --git a/src/main/java/com/michelin/kafkactl/command/DeleteRecords.java b/src/main/java/com/michelin/kafkactl/command/DeleteRecords.java index 2ced530..ebec373 100644 --- a/src/main/java/com/michelin/kafkactl/command/DeleteRecords.java +++ b/src/main/java/com/michelin/kafkactl/command/DeleteRecords.java @@ -2,7 +2,6 @@ import com.michelin.kafkactl.hook.DryRunHook; import com.michelin.kafkactl.service.ResourceService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import jakarta.inject.Inject; import picocli.CommandLine.Command; @@ -19,9 +18,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class DeleteRecords extends DryRunHook { @Inject @ReflectiveAccess diff --git a/src/main/java/com/michelin/kafkactl/command/Diff.java b/src/main/java/com/michelin/kafkactl/command/Diff.java index 0d81747..54aba40 100644 --- a/src/main/java/com/michelin/kafkactl/command/Diff.java +++ b/src/main/java/com/michelin/kafkactl/command/Diff.java @@ -8,7 +8,6 @@ import com.michelin.kafkactl.model.Resource; import com.michelin.kafkactl.service.FormatService; import com.michelin.kafkactl.service.ResourceService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import io.micronaut.http.HttpResponse; import io.micronaut.http.client.exceptions.HttpClientResponseException; @@ -36,9 +35,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class Diff extends AuthenticatedHook { @Inject @ReflectiveAccess @@ -48,7 +45,7 @@ public class Diff extends AuthenticatedHook { @ReflectiveAccess private FormatService formatService; - @Option(names = {"-f", "--file"}, description = "YAML file or directory containing resources.") + @Option(names = {"-f", "--file"}, description = "YAML file or directory containing resources to compare.") public Optional file; @Option(names = {"-R", "--recursive"}, description = "Search file recursively.") diff --git a/src/main/java/com/michelin/kafkactl/command/Get.java b/src/main/java/com/michelin/kafkactl/command/Get.java index a8fe127..a77613a 100644 --- a/src/main/java/com/michelin/kafkactl/command/Get.java +++ b/src/main/java/com/michelin/kafkactl/command/Get.java @@ -8,7 +8,6 @@ import com.michelin.kafkactl.model.Resource; import com.michelin.kafkactl.service.FormatService; import com.michelin.kafkactl.service.ResourceService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import io.micronaut.http.client.exceptions.HttpClientResponseException; import jakarta.inject.Inject; @@ -31,9 +30,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class Get extends AuthenticatedHook { @Inject @ReflectiveAccess diff --git a/src/main/java/com/michelin/kafkactl/command/Import.java b/src/main/java/com/michelin/kafkactl/command/Import.java index bae393a..778db3e 100644 --- a/src/main/java/com/michelin/kafkactl/command/Import.java +++ b/src/main/java/com/michelin/kafkactl/command/Import.java @@ -3,7 +3,6 @@ import com.michelin.kafkactl.hook.DryRunHook; import com.michelin.kafkactl.model.ApiResource; import com.michelin.kafkactl.service.ResourceService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import jakarta.inject.Inject; import java.util.List; @@ -23,9 +22,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class Import extends DryRunHook { @Inject @ReflectiveAccess diff --git a/src/main/java/com/michelin/kafkactl/command/ResetOffsets.java b/src/main/java/com/michelin/kafkactl/command/ResetOffsets.java index 4fb4bf4..0f29fdf 100644 --- a/src/main/java/com/michelin/kafkactl/command/ResetOffsets.java +++ b/src/main/java/com/michelin/kafkactl/command/ResetOffsets.java @@ -4,7 +4,6 @@ import com.michelin.kafkactl.model.Metadata; import com.michelin.kafkactl.model.Resource; import com.michelin.kafkactl.service.ResourceService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import jakarta.inject.Inject; import java.io.IOException; @@ -28,9 +27,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class ResetOffsets extends DryRunHook { public static final String RESET_METHOD = "method"; public static final String OPTIONS = "options"; diff --git a/src/main/java/com/michelin/kafkactl/command/ResetPassword.java b/src/main/java/com/michelin/kafkactl/command/ResetPassword.java index 1cc3fbb..12cc64b 100644 --- a/src/main/java/com/michelin/kafkactl/command/ResetPassword.java +++ b/src/main/java/com/michelin/kafkactl/command/ResetPassword.java @@ -5,7 +5,6 @@ import com.michelin.kafkactl.hook.AuthenticatedHook; import com.michelin.kafkactl.service.ResourceService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import jakarta.inject.Inject; import java.io.IOException; @@ -26,9 +25,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class ResetPassword extends AuthenticatedHook { @Inject @ReflectiveAccess diff --git a/src/main/java/com/michelin/kafkactl/command/Schema.java b/src/main/java/com/michelin/kafkactl/command/Schema.java index 6457b35..678b4e1 100644 --- a/src/main/java/com/michelin/kafkactl/command/Schema.java +++ b/src/main/java/com/michelin/kafkactl/command/Schema.java @@ -8,7 +8,6 @@ import com.michelin.kafkactl.model.SchemaCompatibility; import com.michelin.kafkactl.service.FormatService; import com.michelin.kafkactl.service.ResourceService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import jakarta.inject.Inject; import java.io.IOException; @@ -28,9 +27,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class Schema extends AuthenticatedHook { @Inject @ReflectiveAccess diff --git a/src/main/java/com/michelin/kafkactl/command/auth/Auth.java b/src/main/java/com/michelin/kafkactl/command/auth/Auth.java index 664bfaf..1d1ffec 100644 --- a/src/main/java/com/michelin/kafkactl/command/auth/Auth.java +++ b/src/main/java/com/michelin/kafkactl/command/auth/Auth.java @@ -1,6 +1,6 @@ package com.michelin.kafkactl.command.auth; -import com.michelin.kafkactl.util.VersionProvider; +import com.michelin.kafkactl.hook.HelpHook; import picocli.CommandLine.Command; import picocli.CommandLine.Model.CommandSpec; import picocli.CommandLine.Spec; @@ -21,10 +21,8 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) -public class Auth { + usageHelpAutoWidth = true) +public class Auth extends HelpHook { @Spec public CommandSpec commandSpec; } diff --git a/src/main/java/com/michelin/kafkactl/command/auth/AuthInfo.java b/src/main/java/com/michelin/kafkactl/command/auth/AuthInfo.java index 03999d0..a90d72c 100644 --- a/src/main/java/com/michelin/kafkactl/command/auth/AuthInfo.java +++ b/src/main/java/com/michelin/kafkactl/command/auth/AuthInfo.java @@ -2,11 +2,11 @@ import static com.michelin.kafkactl.util.constant.ResourceKind.AUTH_INFO; +import com.michelin.kafkactl.hook.HelpHook; import com.michelin.kafkactl.model.JwtContent; import com.michelin.kafkactl.model.Resource; import com.michelin.kafkactl.service.FormatService; import com.michelin.kafkactl.service.LoginService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import jakarta.inject.Inject; import java.io.IOException; @@ -30,10 +30,8 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) -public class AuthInfo implements Callable { + usageHelpAutoWidth = true) +public class AuthInfo extends HelpHook implements Callable { @Inject @ReflectiveAccess private LoginService loginService; diff --git a/src/main/java/com/michelin/kafkactl/command/auth/AuthRenew.java b/src/main/java/com/michelin/kafkactl/command/auth/AuthRenew.java index ab8830f..aed4eef 100644 --- a/src/main/java/com/michelin/kafkactl/command/auth/AuthRenew.java +++ b/src/main/java/com/michelin/kafkactl/command/auth/AuthRenew.java @@ -1,8 +1,8 @@ package com.michelin.kafkactl.command.auth; +import com.michelin.kafkactl.hook.HelpHook; import com.michelin.kafkactl.mixin.VerboseMixin; import com.michelin.kafkactl.service.LoginService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import jakarta.inject.Inject; import java.io.IOException; @@ -23,10 +23,8 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) -public class AuthRenew implements Callable { + usageHelpAutoWidth = true) +public class AuthRenew extends HelpHook implements Callable { @Inject @ReflectiveAccess private LoginService loginService; diff --git a/src/main/java/com/michelin/kafkactl/command/config/Config.java b/src/main/java/com/michelin/kafkactl/command/config/Config.java index 9d01501..346cd1d 100644 --- a/src/main/java/com/michelin/kafkactl/command/config/Config.java +++ b/src/main/java/com/michelin/kafkactl/command/config/Config.java @@ -1,6 +1,6 @@ package com.michelin.kafkactl.command.config; -import com.michelin.kafkactl.util.VersionProvider; +import com.michelin.kafkactl.hook.HelpHook; import picocli.CommandLine.Command; import picocli.CommandLine.Model.CommandSpec; import picocli.CommandLine.Spec; @@ -23,10 +23,8 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) -public class Config { + usageHelpAutoWidth = true) +public class Config extends HelpHook { @Spec public CommandSpec commandSpec; } diff --git a/src/main/java/com/michelin/kafkactl/command/config/ConfigCurrentContext.java b/src/main/java/com/michelin/kafkactl/command/config/ConfigCurrentContext.java index a8a7454..e186b4c 100644 --- a/src/main/java/com/michelin/kafkactl/command/config/ConfigCurrentContext.java +++ b/src/main/java/com/michelin/kafkactl/command/config/ConfigCurrentContext.java @@ -10,7 +10,6 @@ import com.michelin.kafkactl.model.Metadata; import com.michelin.kafkactl.model.Resource; import com.michelin.kafkactl.service.FormatService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import io.micronaut.core.util.StringUtils; import jakarta.inject.Inject; @@ -31,9 +30,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class ConfigCurrentContext extends ValidCurrentContextHook { @Inject @ReflectiveAccess diff --git a/src/main/java/com/michelin/kafkactl/command/config/ConfigGetContexts.java b/src/main/java/com/michelin/kafkactl/command/config/ConfigGetContexts.java index e30b55f..05d9354 100644 --- a/src/main/java/com/michelin/kafkactl/command/config/ConfigGetContexts.java +++ b/src/main/java/com/michelin/kafkactl/command/config/ConfigGetContexts.java @@ -5,11 +5,11 @@ import static com.michelin.kafkactl.util.constant.ResourceKind.CONTEXT; import com.michelin.kafkactl.config.KafkactlConfig; +import com.michelin.kafkactl.hook.HelpHook; import com.michelin.kafkactl.mixin.UnmaskTokenMixin; import com.michelin.kafkactl.model.Metadata; import com.michelin.kafkactl.model.Resource; import com.michelin.kafkactl.service.FormatService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import jakarta.inject.Inject; import java.util.HashMap; @@ -32,10 +32,8 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) -public class ConfigGetContexts implements Callable { + usageHelpAutoWidth = true) +public class ConfigGetContexts extends HelpHook implements Callable { @Inject @ReflectiveAccess private KafkactlConfig kafkactlConfig; diff --git a/src/main/java/com/michelin/kafkactl/command/config/ConfigUseContext.java b/src/main/java/com/michelin/kafkactl/command/config/ConfigUseContext.java index f3ac6d8..6c1adba 100644 --- a/src/main/java/com/michelin/kafkactl/command/config/ConfigUseContext.java +++ b/src/main/java/com/michelin/kafkactl/command/config/ConfigUseContext.java @@ -1,8 +1,8 @@ package com.michelin.kafkactl.command.config; import com.michelin.kafkactl.config.KafkactlConfig; +import com.michelin.kafkactl.hook.HelpHook; import com.michelin.kafkactl.service.ConfigService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import jakarta.inject.Inject; import java.io.IOException; @@ -24,10 +24,8 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) -public class ConfigUseContext implements Callable { + usageHelpAutoWidth = true) +public class ConfigUseContext extends HelpHook implements Callable { @Inject @ReflectiveAccess private KafkactlConfig kafkactlConfig; diff --git a/src/main/java/com/michelin/kafkactl/command/connectcluster/ConnectCluster.java b/src/main/java/com/michelin/kafkactl/command/connectcluster/ConnectCluster.java index d3c3ddb..eebe235 100644 --- a/src/main/java/com/michelin/kafkactl/command/connectcluster/ConnectCluster.java +++ b/src/main/java/com/michelin/kafkactl/command/connectcluster/ConnectCluster.java @@ -1,6 +1,6 @@ package com.michelin.kafkactl.command.connectcluster; -import com.michelin.kafkactl.util.VersionProvider; +import com.michelin.kafkactl.hook.HelpHook; import picocli.CommandLine.Command; import picocli.CommandLine.Model.CommandSpec; import picocli.CommandLine.Spec; @@ -20,10 +20,8 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) -public class ConnectCluster { + usageHelpAutoWidth = true) +public class ConnectCluster extends HelpHook { @Spec public CommandSpec commandSpec; } diff --git a/src/main/java/com/michelin/kafkactl/command/connectcluster/ConnectClusterVault.java b/src/main/java/com/michelin/kafkactl/command/connectcluster/ConnectClusterVault.java index f1909fa..caf3569 100644 --- a/src/main/java/com/michelin/kafkactl/command/connectcluster/ConnectClusterVault.java +++ b/src/main/java/com/michelin/kafkactl/command/connectcluster/ConnectClusterVault.java @@ -2,7 +2,6 @@ import com.michelin.kafkactl.hook.AuthenticatedHook; import com.michelin.kafkactl.service.ResourceService; -import com.michelin.kafkactl.util.VersionProvider; import io.micronaut.core.annotation.ReflectiveAccess; import jakarta.inject.Inject; import java.util.List; @@ -21,9 +20,7 @@ parameterListHeading = "%n@|bold Parameters|@:%n", optionListHeading = "%n@|bold Options|@:%n", commandListHeading = "%n@|bold Commands|@:%n", - usageHelpAutoWidth = true, - versionProvider = VersionProvider.class, - mixinStandardHelpOptions = true) + usageHelpAutoWidth = true) public class ConnectClusterVault extends AuthenticatedHook { @Inject @ReflectiveAccess diff --git a/src/main/java/com/michelin/kafkactl/hook/AuthenticatedHook.java b/src/main/java/com/michelin/kafkactl/hook/AuthenticatedHook.java index 616bd41..4aab218 100644 --- a/src/main/java/com/michelin/kafkactl/hook/AuthenticatedHook.java +++ b/src/main/java/com/michelin/kafkactl/hook/AuthenticatedHook.java @@ -33,7 +33,7 @@ public abstract class AuthenticatedHook extends ValidCurrentContextHook { protected KafkactlConfig kafkactlConfig; @Mixin - public NamespaceMixin namespaceMixinMixin; + public NamespaceMixin namespaceMixin; @Mixin public VerboseMixin verboseMixin; @@ -53,7 +53,7 @@ public Integer onContextValid() throws IOException { * @return The current namespace */ protected String getNamespace() { - return namespaceMixinMixin.optionalNamespace.orElse(kafkactlConfig.getCurrentNamespace()); + return namespaceMixin.optionalNamespace.orElse(kafkactlConfig.getCurrentNamespace()); } /** diff --git a/src/main/java/com/michelin/kafkactl/hook/HelpHook.java b/src/main/java/com/michelin/kafkactl/hook/HelpHook.java new file mode 100644 index 0000000..09f74d5 --- /dev/null +++ b/src/main/java/com/michelin/kafkactl/hook/HelpHook.java @@ -0,0 +1,13 @@ +package com.michelin.kafkactl.hook; + +import picocli.CommandLine.Command; +import picocli.CommandLine.Option; + +/** + * Help abstract command. + */ +@Command +public abstract class HelpHook { + @Option(names = {"-h", "--help"}, usageHelp = true, description = "Show this help message and exit.") + public boolean help; +} diff --git a/src/main/java/com/michelin/kafkactl/hook/ValidCurrentContextHook.java b/src/main/java/com/michelin/kafkactl/hook/ValidCurrentContextHook.java index c45a1ba..d45a3ab 100644 --- a/src/main/java/com/michelin/kafkactl/hook/ValidCurrentContextHook.java +++ b/src/main/java/com/michelin/kafkactl/hook/ValidCurrentContextHook.java @@ -16,7 +16,7 @@ * Command hook to check if the current context is valid. */ @Command -public abstract class ValidCurrentContextHook implements Callable { +public abstract class ValidCurrentContextHook extends HelpHook implements Callable { @Inject @ReflectiveAccess protected ConfigService configService; diff --git a/src/main/java/com/michelin/kafkactl/mixin/UnmaskTokenMixin.java b/src/main/java/com/michelin/kafkactl/mixin/UnmaskTokenMixin.java index e7dc7fb..5d50a7c 100644 --- a/src/main/java/com/michelin/kafkactl/mixin/UnmaskTokenMixin.java +++ b/src/main/java/com/michelin/kafkactl/mixin/UnmaskTokenMixin.java @@ -1,6 +1,6 @@ package com.michelin.kafkactl.mixin; -import picocli.CommandLine; +import picocli.CommandLine.Option; /** * Unmask token mixin. @@ -8,6 +8,6 @@ public class UnmaskTokenMixin { public static final String MASKED = "[MASKED]"; - @CommandLine.Option(names = {"-u", "--unmask-tokens"}, description = "Unmask tokens.") + @Option(names = {"-u", "--unmask-tokens"}, description = "Unmask tokens.") public boolean unmaskTokens; } diff --git a/src/main/java/com/michelin/kafkactl/service/ResourceService.java b/src/main/java/com/michelin/kafkactl/service/ResourceService.java index bb50e5f..cc87305 100644 --- a/src/main/java/com/michelin/kafkactl/service/ResourceService.java +++ b/src/main/java/com/michelin/kafkactl/service/ResourceService.java @@ -13,6 +13,7 @@ import com.michelin.kafkactl.model.ApiResource; import com.michelin.kafkactl.model.Resource; import com.michelin.kafkactl.model.SchemaCompatibility; +import io.micronaut.core.annotation.Nullable; import io.micronaut.core.annotation.ReflectiveAccess; import io.micronaut.core.util.StringUtils; import io.micronaut.http.HttpResponse; @@ -180,16 +181,17 @@ public HttpResponse apply(ApiResource apiResource, String namespace, R * @param apiResource The resource type * @param namespace The namespace * @param resource The resource - * @param dryRun Is dry run mode ? + * @param version The version of the resource, for schemas only. + * @param dryRun Is dry run mode? * @param commandSpec The command that triggered the action * @return true if deletion succeeded, false otherwise */ - public boolean delete(ApiResource apiResource, String namespace, String resource, boolean dryRun, - CommandSpec commandSpec) { + public boolean delete(ApiResource apiResource, String namespace, String resource, @Nullable String version, + boolean dryRun, CommandSpec commandSpec) { try { HttpResponse response = apiResource.isNamespaced() ? namespacedClient.delete(namespace, apiResource.getPath(), resource, loginService.getAuthorization(), - dryRun) + version, dryRun) : nonNamespacedClient.delete(loginService.getAuthorization(), apiResource.getPath(), resource, dryRun); // Micronaut does not throw exception on 404, so produce a 404 manually @@ -198,7 +200,7 @@ public boolean delete(ApiResource apiResource, String namespace, String resource } commandSpec.commandLine().getOut().println(formatService.prettifyKind(apiResource.getKind()) - + " \"" + resource + "\" deleted."); + + " \"" + resource + "\"" + (version != null ? " version " + version : "") + " deleted."); return true; } catch (HttpClientResponseException exception) { diff --git a/src/test/java/com/michelin/kafkactl/command/DeleteTest.java b/src/test/java/com/michelin/kafkactl/command/DeleteTest.java index 9180ca3..d8b4e00 100644 --- a/src/test/java/com/michelin/kafkactl/command/DeleteTest.java +++ b/src/test/java/com/michelin/kafkactl/command/DeleteTest.java @@ -26,6 +26,7 @@ import java.io.StringWriter; import java.util.Collections; import java.util.List; +import java.util.Map; import java.util.Optional; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -195,7 +196,7 @@ void shouldNotDeleteByFileWhenNamespaceMismatch() { } @Test - void shouldDeleteByFileSuccess() { + void shouldDeleteAllVersionsByFileSuccess() { when(configService.isCurrentContextValid()) .thenReturn(true); when(loginService.doAuthenticate(any(), anyBoolean())) @@ -226,7 +227,7 @@ void shouldDeleteByFileSuccess() { when(apiResourcesService.getResourceDefinitionByKind(any())) .thenReturn(Optional.of(apiResource)); - when(resourceService.delete(any(), any(), any(), anyBoolean(), any())) + when(resourceService.delete(any(), any(), any(), any(), anyBoolean(), any())) .thenReturn(true); CommandLine cmd = new CommandLine(delete); @@ -238,7 +239,50 @@ void shouldDeleteByFileSuccess() { } @Test - void shouldDeleteByNameSuccess() { + void shouldDeleteOneVersionByFileSuccess() { + when(configService.isCurrentContextValid()) + .thenReturn(true); + when(loginService.doAuthenticate(any(), anyBoolean())) + .thenReturn(true); + when(fileService.computeYamlFileList(any(), anyBoolean())) + .thenReturn(Collections.singletonList(new File("path"))); + + Resource resource = Resource.builder() + .kind("Topic") + .apiVersion("v1") + .metadata(Metadata.builder() + .name("prefix.topic") + .namespace("namespace") + .build()) + .spec(Map.of("version", "1")) + .build(); + + when(fileService.parseResourceListFromFiles(any())) + .thenReturn(Collections.singletonList(resource)); + + ApiResource apiResource = ApiResource.builder() + .kind("Topic") + .path("topics") + .names(List.of("topics", "topic", "to")) + .namespaced(true) + .synchronizable(true) + .build(); + + when(apiResourcesService.getResourceDefinitionByKind(any())) + .thenReturn(Optional.of(apiResource)); + when(resourceService.delete(any(), any(), any(), any(), anyBoolean(), any())) + .thenReturn(true); + + CommandLine cmd = new CommandLine(delete); + StringWriter sw = new StringWriter(); + cmd.setOut(new PrintWriter(sw)); + + int code = cmd.execute("-f", "topic", "-n", "namespace"); + assertEquals(0, code); + } + + @Test + void shouldDeleteAllVersionsByNameSuccess() { when(configService.isCurrentContextValid()) .thenReturn(true); when(loginService.doAuthenticate(any(), anyBoolean())) @@ -256,7 +300,7 @@ void shouldDeleteByNameSuccess() { .thenReturn(Optional.of(apiResource)); when(apiResourcesService.getResourceDefinitionByKind(any())) .thenReturn(Optional.of(apiResource)); - when(resourceService.delete(any(), any(), any(), anyBoolean(), any())) + when(resourceService.delete(any(), any(), any(), any(), anyBoolean(), any())) .thenReturn(true); CommandLine cmd = new CommandLine(delete); @@ -267,6 +311,36 @@ void shouldDeleteByNameSuccess() { assertEquals(0, code); } + @Test + void shouldDeleteOneVersionByNameSuccess() { + when(configService.isCurrentContextValid()) + .thenReturn(true); + when(loginService.doAuthenticate(any(), anyBoolean())) + .thenReturn(true); + + ApiResource apiResource = ApiResource.builder() + .kind("Topic") + .path("topics") + .names(List.of("topics", "topic", "to")) + .namespaced(true) + .synchronizable(true) + .build(); + + when(apiResourcesService.getResourceDefinitionByName(any())) + .thenReturn(Optional.of(apiResource)); + when(apiResourcesService.getResourceDefinitionByKind(any())) + .thenReturn(Optional.of(apiResource)); + when(resourceService.delete(any(), any(), any(), any(), anyBoolean(), any())) + .thenReturn(true); + + CommandLine cmd = new CommandLine(delete); + StringWriter sw = new StringWriter(); + cmd.setOut(new PrintWriter(sw)); + + int code = cmd.execute("topic", "prefix.topic", "-n", "namespace", "-V", "latest"); + assertEquals(0, code); + } + @Test void shouldDeleteByFileDryRunSuccess() { when(configService.isCurrentContextValid()) @@ -298,7 +372,7 @@ void shouldDeleteByFileDryRunSuccess() { when(apiResourcesService.getResourceDefinitionByKind(any())) .thenReturn(Optional.of(apiResource)); - when(resourceService.delete(any(), any(), any(), anyBoolean(), any())) + when(resourceService.delete(any(), any(), any(), any(), anyBoolean(), any())) .thenReturn(true); CommandLine cmd = new CommandLine(delete); @@ -342,7 +416,7 @@ void shouldDeleteByFileFail() { when(apiResourcesService.getResourceDefinitionByKind(any())) .thenReturn(Optional.of(apiResource)); - when(resourceService.delete(any(), any(), any(), anyBoolean(), any())) + when(resourceService.delete(any(), any(), any(), any(), anyBoolean(), any())) .thenReturn(false); CommandLine cmd = new CommandLine(delete); diff --git a/src/test/java/com/michelin/kafkactl/service/ResourceServiceTest.java b/src/test/java/com/michelin/kafkactl/service/ResourceServiceTest.java index e141fcd..1389ec3 100644 --- a/src/test/java/com/michelin/kafkactl/service/ResourceServiceTest.java +++ b/src/test/java/com/michelin/kafkactl/service/ResourceServiceTest.java @@ -590,7 +590,7 @@ void shouldDeleteNamespacedResource() { cmd.setOut(new PrintWriter(sw)); doCallRealMethod().when(formatService).prettifyKind(any()); - when(namespacedClient.delete(any(), any(), any(), any(), anyBoolean())) + when(namespacedClient.delete(any(), any(), any(), any(), any(), anyBoolean())) .thenReturn(HttpResponse .ok() .header("X-Ns4kafka-Result", "created")); @@ -603,12 +603,39 @@ void shouldDeleteNamespacedResource() { .synchronizable(true) .build(); - boolean actual = resourceService.delete(apiResource, "namespace", "name", false, cmd.getCommandSpec()); + boolean actual = resourceService.delete(apiResource, "namespace", "name", null, false, cmd.getCommandSpec()); assertTrue(actual); assertTrue(sw.toString().contains("Topic \"name\" deleted.")); } + @Test + void shouldDeleteNamespacedResourceWithVersion() { + CommandLine cmd = new CommandLine(new Kafkactl()); + StringWriter sw = new StringWriter(); + cmd.setOut(new PrintWriter(sw)); + + doCallRealMethod().when(formatService).prettifyKind(any()); + when(namespacedClient.delete(any(), any(), any(), any(), any(), anyBoolean())) + .thenReturn(HttpResponse + .ok() + .header("X-Ns4kafka-Result", "created")); + + ApiResource apiResource = ApiResource.builder() + .kind("Topic") + .path("topics") + .names(List.of("topics", "topic", "to")) + .namespaced(true) + .synchronizable(true) + .build(); + + boolean actual = resourceService.delete(apiResource, "namespace", "name", + "latest", false, cmd.getCommandSpec()); + + assertTrue(actual); + assertTrue(sw.toString().contains("Topic \"name\" version latest deleted.")); + } + @Test void shouldDeleteNonNamespacedResource() { CommandLine cmd = new CommandLine(new Kafkactl()); @@ -629,7 +656,7 @@ void shouldDeleteNonNamespacedResource() { .synchronizable(true) .build(); - boolean actual = resourceService.delete(apiResource, "namespace", "name", false, cmd.getCommandSpec()); + boolean actual = resourceService.delete(apiResource, "namespace", "name", null, false, cmd.getCommandSpec()); assertTrue(actual); assertTrue(sw.toString().contains("Topic \"name\" deleted.")); @@ -648,10 +675,11 @@ void shouldDeleteNamespacedResourceAndHandleHttpResponseException() { CommandLine cmd = new CommandLine(new Kafkactl()); HttpClientResponseException exception = new HttpClientResponseException("error", HttpResponse.serverError()); - when(namespacedClient.delete(any(), any(), any(), any(), anyBoolean())) + when(namespacedClient.delete(any(), any(), any(), any(), any(), anyBoolean())) .thenThrow(exception); - boolean actual = resourceService.delete(apiResource, "namespace", "prefix.topic", false, cmd.getCommandSpec()); + boolean actual = resourceService.delete(apiResource, "namespace", "prefix.topic", null, + false, cmd.getCommandSpec()); assertFalse(actual); verify(formatService).displayError(exception, "Topic", "prefix.topic", cmd.getCommandSpec()); @@ -669,10 +697,11 @@ void shouldThrowExceptionWhenDeleteNotFoundResource() { CommandLine cmd = new CommandLine(new Kafkactl()); - when(namespacedClient.delete(any(), any(), any(), any(), anyBoolean())) + when(namespacedClient.delete(any(), any(), any(), any(), any(), anyBoolean())) .thenReturn(HttpResponse.notFound()); - boolean actual = resourceService.delete(apiResource, "namespace", "prefix.topic", false, cmd.getCommandSpec()); + boolean actual = resourceService.delete(apiResource, "namespace", "prefix.topic", null, + false, cmd.getCommandSpec()); assertFalse(actual); verify(formatService).displayError(argThat(exception -> exception.getStatus().equals(HttpStatus.NOT_FOUND) From bef6205fa087f677507d0680e2033da773e7e5ad Mon Sep 17 00:00:00 2001 From: Thomas CAI <92149044+ThomasCAI-mlv@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:57:36 +0200 Subject: [PATCH 04/13] Update delete schema examples (#144) * Update README.md * Update README.md --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a82d338..9540e3b 100644 --- a/README.md +++ b/README.md @@ -465,9 +465,7 @@ with the resource is permanently lost. ```console Usage: kafkactl delete [-hv] [--dry-run] [-n=] ([ [-V[=]]] | [[-f=] [-R]]) -Description: - -Delete a resource. +Description: Delete a resource. Parameters: Resource type. @@ -490,8 +488,8 @@ Example(s): ```console kafkactl delete -f directoryOfResources kafkactl delete -f resource.yml -kafkactl delete myResource -kafkactl delete mySchema -V latest +kafkactl delete topic myTopic +kafkactl delete schema mySchema -V latest ``` ### Diff From 2dda75db33d6f5501aab5d9c85a362dfe10279d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 13:12:48 +0200 Subject: [PATCH 05/13] Bump org.mockito:mockito-junit-jupiter from 5.12.0 to 5.13.0 (#145) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 67ed382..8973783 100644 --- a/build.gradle +++ b/build.gradle @@ -37,7 +37,7 @@ dependencies { runtimeOnly("ch.qos.logback:logback-classic") testImplementation("io.micronaut:micronaut-http-client") - testImplementation("org.mockito:mockito-junit-jupiter:5.12.0") + testImplementation("org.mockito:mockito-junit-jupiter:5.13.0") testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.0") testImplementation("org.mockito:mockito-core") From 397114093706d92d7e8e9880a62d83e021c0b76d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 13:12:59 +0200 Subject: [PATCH 06/13] Bump pl.allegro.tech.build.axion-release from 1.18.5 to 1.18.7 (#146) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8973783..00dc1d7 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id("io.micronaut.application") version "4.4.2" id("jacoco") id("org.sonarqube") version "5.1.0.4882" - id("pl.allegro.tech.build.axion-release") version "1.18.5" + id("pl.allegro.tech.build.axion-release") version "1.18.7" id("checkstyle") } From abb275bfecada3470d9f6dbb916e24352ab9e114 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:43:22 +0200 Subject: [PATCH 07/13] Bump pl.allegro.tech.build.axion-release from 1.18.7 to 1.18.8 (#147) Bumps [pl.allegro.tech.build.axion-release](https://github.com/allegro/axion-release-plugin) from 1.18.7 to 1.18.8. - [Release notes](https://github.com/allegro/axion-release-plugin/releases) - [Commits](https://github.com/allegro/axion-release-plugin/compare/v1.18.7...v1.18.8) --- updated-dependencies: - dependency-name: pl.allegro.tech.build.axion-release dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 00dc1d7..f57be4c 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id("io.micronaut.application") version "4.4.2" id("jacoco") id("org.sonarqube") version "5.1.0.4882" - id("pl.allegro.tech.build.axion-release") version "1.18.7" + id("pl.allegro.tech.build.axion-release") version "1.18.8" id("checkstyle") } From c12952b283a769d0b8d2466ce52de865375d9a50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:36:25 +0200 Subject: [PATCH 08/13] Bump pl.allegro.tech.build.axion-release from 1.18.8 to 1.18.9 (#148) Bumps [pl.allegro.tech.build.axion-release](https://github.com/allegro/axion-release-plugin) from 1.18.8 to 1.18.9. - [Release notes](https://github.com/allegro/axion-release-plugin/releases) - [Commits](https://github.com/allegro/axion-release-plugin/compare/v1.18.8...v1.18.9) --- updated-dependencies: - dependency-name: pl.allegro.tech.build.axion-release dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f57be4c..1690810 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id("io.micronaut.application") version "4.4.2" id("jacoco") id("org.sonarqube") version "5.1.0.4882" - id("pl.allegro.tech.build.axion-release") version "1.18.8" + id("pl.allegro.tech.build.axion-release") version "1.18.9" id("checkstyle") } From c6d3b03ecb74f5b1e9928b953ac4416d7edbabd6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:09:12 +0200 Subject: [PATCH 09/13] Bump org.junit.jupiter:junit-jupiter-params from 5.11.0 to 5.11.1 (#149) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 1690810..b6ded59 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ dependencies { testImplementation("io.micronaut:micronaut-http-client") testImplementation("org.mockito:mockito-junit-jupiter:5.13.0") - testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.0") + testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.1") testImplementation("org.mockito:mockito-core") testAnnotationProcessor("org.projectlombok:lombok") From 3a08c5501308ebc6589feb08a3c8a59f7af2a4e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:17:28 +0200 Subject: [PATCH 10/13] Bump org.mockito:mockito-junit-jupiter from 5.13.0 to 5.14.1 (#151) Bumps [org.mockito:mockito-junit-jupiter](https://github.com/mockito/mockito) from 5.13.0 to 5.14.1. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.13.0...v5.14.1) --- updated-dependencies: - dependency-name: org.mockito:mockito-junit-jupiter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b6ded59..2a9dfc4 100644 --- a/build.gradle +++ b/build.gradle @@ -37,7 +37,7 @@ dependencies { runtimeOnly("ch.qos.logback:logback-classic") testImplementation("io.micronaut:micronaut-http-client") - testImplementation("org.mockito:mockito-junit-jupiter:5.13.0") + testImplementation("org.mockito:mockito-junit-jupiter:5.14.1") testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.1") testImplementation("org.mockito:mockito-core") From 85d2863d00fa8408557f1ea5bfeab762a84be509 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:05:26 +0200 Subject: [PATCH 11/13] Bump pl.allegro.tech.build.axion-release from 1.18.9 to 1.18.12 (#152) Bumps [pl.allegro.tech.build.axion-release](https://github.com/allegro/axion-release-plugin) from 1.18.9 to 1.18.12. - [Release notes](https://github.com/allegro/axion-release-plugin/releases) - [Commits](https://github.com/allegro/axion-release-plugin/compare/v1.18.9...v1.18.12) --- updated-dependencies: - dependency-name: pl.allegro.tech.build.axion-release dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2a9dfc4..074a66c 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id("io.micronaut.application") version "4.4.2" id("jacoco") id("org.sonarqube") version "5.1.0.4882" - id("pl.allegro.tech.build.axion-release") version "1.18.9" + id("pl.allegro.tech.build.axion-release") version "1.18.12" id("checkstyle") } From 5b1cdfdd149b8b4a50d2522348cfdcf560b0ec7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:05:34 +0200 Subject: [PATCH 12/13] Bump io.micronaut.application from 4.4.2 to 4.4.3 (#153) Bumps io.micronaut.application from 4.4.2 to 4.4.3. --- updated-dependencies: - dependency-name: io.micronaut.application dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 074a66c..7ff9dce 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id("com.github.johnrengelman.shadow") version "8.1.1" - id("io.micronaut.application") version "4.4.2" + id("io.micronaut.application") version "4.4.3" id("jacoco") id("org.sonarqube") version "5.1.0.4882" id("pl.allegro.tech.build.axion-release") version "1.18.12" From 88dbdddb83f4165a336a645a76fefb2ec179cd9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:05:41 +0200 Subject: [PATCH 13/13] Bump org.junit.jupiter:junit-jupiter-params from 5.11.1 to 5.11.2 (#154) Bumps [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5) from 5.11.1 to 5.11.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.11.1...r5.11.2) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-params dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7ff9dce..4f38f7a 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ dependencies { testImplementation("io.micronaut:micronaut-http-client") testImplementation("org.mockito:mockito-junit-jupiter:5.14.1") - testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.1") + testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.2") testImplementation("org.mockito:mockito-core") testAnnotationProcessor("org.projectlombok:lombok")