This is an automated email from the ASF dual-hosted git repository. jkevan pushed a commit to branch migrationTests in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/migrationTests by this push: new d89838269 UNOMI-633: rename 'silent' into 'skipConfirmation' sounds more clear d89838269 is described below commit d898382699da0116d7ef7bfe4640d80c68761150 Author: Kevan <ke...@jahia.com> AuthorDate: Thu Jul 28 15:09:06 2022 +0200 UNOMI-633: rename 'silent' into 'skipConfirmation' sounds more clear --- itests/README.md | 2 +- manual/src/main/asciidoc/shell-commands.adoc | 7 +++---- .../java/org/apache/unomi/shell/migration/actions/Migrate.java | 7 +++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/itests/README.md b/itests/README.md index ae2eee662..7be12dcd0 100644 --- a/itests/README.md +++ b/itests/README.md @@ -113,7 +113,7 @@ Also the ElasticSearch maven plugin is configured to allow this snapshot reposit <path.repo>${project.build.directory}/snapshots_repository</path.repo> -Now that migration accept configuration file we can provide it, this allows to benefit from silent migration (in BaseIT configuration): +Now that migration accept configuration file we can provide it, this allows to avoid the migration process to prompt questions (in BaseIT configuration): replaceConfigurationFile("etc/org.apache.unomi.migration.cfg", new File("src/test/resources/migration/org.apache.unomi.migration.cfg")), diff --git a/manual/src/main/asciidoc/shell-commands.adoc b/manual/src/main/asciidoc/shell-commands.adoc index a4ffb4836..2de339d38 100644 --- a/manual/src/main/asciidoc/shell-commands.adoc +++ b/manual/src/main/asciidoc/shell-commands.adoc @@ -46,15 +46,14 @@ DESCRIPTION if no configuration is provided then questions will be prompted during the migration process. SYNTAX - unomi:migrate [fromVersionWithoutSuffix] [silent] + unomi:migrate [fromVersionWithoutSuffix] [skipConfirmation] ARGUMENTS fromVersionWithoutSuffix Origin version without suffix/qualifier (e.g: 1.2.0) (defaults to 1.2.0) - silent - Should the migration process be silent ?. (No questions will be prompted in the console) - The configuration org.apache.unomi.migration.cfg is required for this option to work properly + skipConfirmation + Should the confirmation before starting the migration process be skipped ? (defaults to false) ``` diff --git a/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/actions/Migrate.java b/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/actions/Migrate.java index af57a6ae4..dd4946d5c 100644 --- a/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/actions/Migrate.java +++ b/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/actions/Migrate.java @@ -62,9 +62,8 @@ public class Migrate implements Action { @Argument(name = "originVersion", description = "Origin version without suffix/qualifier (e.g: 1.2.0)", valueToShowInHelp = "1.2.0") private String originVersion; - @Argument(index = 1, name = "silent", description = "Should the migration process be silent ?. " + - "The configuration org.apache.unomi.migration.cfg is required for this option to work properly", valueToShowInHelp = "false") - private boolean silent = false; + @Argument(index = 1, name = "skipConfirmation", description = "Should the confirmation before starting the migration process be skipped ?", valueToShowInHelp = "false") + private boolean skipConfirmation = false; public Object execute() throws Exception { // Load migration scrips @@ -89,7 +88,7 @@ public class Migrate implements Action { } // Check for user approval before migrate - if (!silent && ConsoleUtils.askUserWithAuthorizedAnswer(session, + if (!skipConfirmation && ConsoleUtils.askUserWithAuthorizedAnswer(session, "[WARNING] You are about to execute a migration, this a very sensitive operation, are you sure? (yes/no): ", Arrays.asList("yes", "no")).equalsIgnoreCase("no")) { ConsoleUtils.printMessage(session, "Migration process aborted");