New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
point users to init project command if they forget a supported argument in any command (DAT-8641) #2356
Conversation
liquibase-core/src/main/java/liquibase/command/CommandArgumentDefinition.java
Outdated
Show resolved
Hide resolved
liquibase-core/src/main/java/liquibase/command/CommandArgumentNames.java
Outdated
Show resolved
Hide resolved
liquibase-core/src/main/java/liquibase/exception/CommandValidationException.java
Outdated
Show resolved
Hide resolved
.description("The root changelog file").build(); | ||
URL_ARG = builder.argument("url", String.class).required() | ||
URL_ARG = builder.argument(CommonArgumentNames.URL, String.class).required() | ||
.description("The JDBC database connection URL").build(); | ||
DEFAULT_SCHEMA_NAME_ARG = builder.argument("defaultSchemaName", String.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While they aren't as commonly used, defaultSchemaName and driverPropertiesFile are part of the set of common arguments across commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was contemplating changing around the other arguments as well. I'll do that in another PR to keep things nice and separate.
This is a bit of a heavy-handed approach to this, and it does not have to be.
There are two commits:
First, the actual change. This is to adjust the message thrown by the exception during the validation stage of each argument.
Second, refactoring all existing commands which use any of the supported arguments to all use common code for the initialization of the argument. I did this primarily because I was concerned that the equality check would fail if one developer instantiated a command argument in a slightly different way (
changelogfile
vschangelogFile
, for example)