You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/11/08 17:40:31 UTC
[GitHub] [ozone] navinko opened a new pull request, #3943: HDDS-6736. Provided consistent CLI options
navinko opened a new pull request, #3943:
URL: https://github.com/apache/ozone/pull/3943
## What changes were proposed in this pull request?
Provided consistent CLI options by adding new command line option such that all non consistent options will be deprecated eventually .
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-6736
Please replace this section with the link to the Apache JIRA)
## How was this patch tested?
Modified the existing tests cases for command line options.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] navinko commented on a diff in pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by "navinko (via GitHub)" <gi...@apache.org>.
navinko commented on code in PR #3943:
URL: https://github.com/apache/ozone/pull/3943#discussion_r1093572561
##########
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/ListInfoSubcommand.java:
##########
@@ -46,8 +46,9 @@ public class ListInfoSubcommand extends ScmSubcommand {
defaultValue = "")
private String ipaddress;
- @CommandLine.Option(names = {"--id"},
- description = "Show info by datanode UUID.",
+ @CommandLine.Option(names = {"--id", "--uuid"},
+ description = "Show info by datanode UUID. Command line option --id " +
+ "will be removed in later versions.",
Review Comment:
Hi @adoroszlai Thank you for reviewing the changes. Will drop the comments from the PR changeset. But it seems we have some existing Command options where such comments do exist . Do i need to remove the comment from everywhere in ozone?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] adoroszlai commented on pull request #3943: HDDS-7944. Add dash-separated-options where missing
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #3943:
URL: https://github.com/apache/ozone/pull/3943#issuecomment-1425763224
Thanks @navinko for the patch, @errose28 for reviewing it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] navinko commented on a diff in pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by "navinko (via GitHub)" <gi...@apache.org>.
navinko commented on code in PR #3943:
URL: https://github.com/apache/ozone/pull/3943#discussion_r1100503784
##########
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/ListInfoSubcommand.java:
##########
@@ -46,8 +46,9 @@ public class ListInfoSubcommand extends ScmSubcommand {
defaultValue = "")
private String ipaddress;
- @CommandLine.Option(names = {"--id"},
- description = "Show info by datanode UUID.",
+ @CommandLine.Option(names = {"--id", "--uuid"},
+ description = "Show info by datanode UUID. Command line option --id " +
+ "will be removed in later versions.",
Review Comment:
sure thing . I have created https://issues.apache.org/jira/browse/HDDS-7932 for cleanup
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] adoroszlai commented on pull request #3943: HDDS-7944. Add dash-separated-options where missing
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #3943:
URL: https://github.com/apache/ozone/pull/3943#issuecomment-1424617102
Since this PR only covers a small part of the original task I have created a subtask and updated the title.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] navinko commented on pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by GitBox <gi...@apache.org>.
navinko commented on PR #3943:
URL: https://github.com/apache/ozone/pull/3943#issuecomment-1384452890
Hi @errose28 @ChenSammi I am apologize for getting delayed.
The test case failure is fixed now and the issue was the command options should supposed to be unique one. While reusing the options --id in Scmoption calss and ListInfoSubcommand class it was resulting into DuplicateOptionAnnotationsException in test cases.
picocli.CommandLine$DuplicateOptionAnnotationsException: Option name '--id' is used by both field String org.apache.hadoop.hdds.scm.cli.datanode.ListInfoSubcommand.uuid and field String org.apache.hadoop.hdds.scm.cli.ScmOption.scmServiceId
To fix the issue for now i did not change the --id to --uuid in ListInfoSubcommand class since this might be breaking change for existing commands , instead added --uuid option in ListInfoSubcommand for eventually addition and --id removal
@CommandLine.Option(names = {"--id", "--uuid"}
and under Scmoption class left it as it is for now @CommandLine.Option(names = {"--service-id", "-id"} and later will be added --id
Let me know if there is any concern.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] adoroszlai commented on a diff in pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #3943:
URL: https://github.com/apache/ozone/pull/3943#discussion_r1090335398
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/CancelPrepareSubCommand.java:
##########
@@ -36,10 +36,10 @@ public class CancelPrepareSubCommand implements Callable<Void> {
private OMAdmin parent;
@CommandLine.Option(
- names = {"-id", "--service-id"},
- description = "Ozone Manager Service ID",
- required = true
- )
+ names = {"-id", "--id", "--service-id"},
+ description = "Ozone Manager Service ID." + "Command line option " +
+ "-id will be removed in later versions.",
+ required = true)
Review Comment:
Please don't add `--id`, as we already have `--service-id`. (Applies to all commands with the `--service-id` option.)
##########
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/ListInfoSubcommand.java:
##########
@@ -46,8 +46,9 @@ public class ListInfoSubcommand extends ScmSubcommand {
defaultValue = "")
private String ipaddress;
- @CommandLine.Option(names = {"--id"},
- description = "Show info by datanode UUID.",
+ @CommandLine.Option(names = {"--id", "--uuid"},
+ description = "Show info by datanode UUID. Command line option --id " +
+ "will be removed in later versions.",
Review Comment:
`--id` is OK, we don't need to remove it.
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/PrepareSubCommand.java:
##########
@@ -55,42 +55,47 @@ public class PrepareSubCommand implements Callable<Void> {
private OMAdmin parent;
@CommandLine.Option(
- names = {"-id", "--service-id"},
- description = "Ozone Manager Service ID",
+ names = {"-id", "--id", "--service-id"},
+ description = "Ozone Manager Service ID." + "Command line option " +
+ "-id will be removed in later versions.",
required = true
)
private String omServiceId;
@CommandLine.Option(
- names = {"-tawt", "--transaction-apply-wait-timeout"},
+ names = {"-tawt", "--tawt", "--transaction-apply-wait-timeout"},
Review Comment:
Please don't add `--tawt` or other similar abbreviated long options. Options should be short or long, but not a mix. How are users supposed to remember `tawt` and other acronyms?
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/s3/SetS3SecretHandler.java:
##########
@@ -39,8 +39,9 @@ public class SetS3SecretHandler extends S3Handler {
+ "(Admins only)'")
private String username;
- @CommandLine.Option(names = {"-s", "--secret", "--secretKey"},
- description = "Secret key", required = true)
+ @CommandLine.Option(names = {"-s", "--secret", "--secretKey", "--secret-key"},
Review Comment:
`--secret` is enough, no need for `--secret-key`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] ChenSammi commented on pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by GitBox <gi...@apache.org>.
ChenSammi commented on PR #3943:
URL: https://github.com/apache/ozone/pull/3943#issuecomment-1334723515
@navinko , could you check the failed tests if related?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] adoroszlai commented on a diff in pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #3943:
URL: https://github.com/apache/ozone/pull/3943#discussion_r1101847156
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/conf/StorageContainerManagersCommandHandler.java:
##########
@@ -29,7 +29,7 @@
* Handler for ozone getconf storagecontainermanagers.
*/
@Command(name = "storagecontainermanagers",
- aliases = {"-storagecontainermanagers"},
+ aliases = {"-storagecontainermanagers", "--storage-container-managers"},
Review Comment:
Same here.
```suggestion
aliases = {"-storagecontainermanagers"},
```
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/conf/OzoneManagersCommandHandler.java:
##########
@@ -28,7 +28,7 @@
* Handler for ozone getconf ozonemanagers.
*/
@Command(name = "ozonemanagers",
- aliases = {"-ozonemanagers"},
+ aliases = {"-ozonemanagers", "--ozone-managers"},
Review Comment:
`-ozonemanagers` here is not an option, rather an alias for the command name (`ozonemanagers`). I think we should omit the new alias.
```suggestion
aliases = {"-ozonemanagers"},
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] DaveTeng0 commented on pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by "DaveTeng0 (via GitHub)" <gi...@apache.org>.
DaveTeng0 commented on PR #3943:
URL: https://github.com/apache/ozone/pull/3943#issuecomment-1408008898
hey @navinko ~ please help resolve the failed test, tks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] adoroszlai merged pull request #3943: HDDS-7944. Add dash-separated-options where missing
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #3943:
URL: https://github.com/apache/ozone/pull/3943
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] adoroszlai commented on a diff in pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #3943:
URL: https://github.com/apache/ozone/pull/3943#discussion_r1093578410
##########
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/ListInfoSubcommand.java:
##########
@@ -46,8 +46,9 @@ public class ListInfoSubcommand extends ScmSubcommand {
defaultValue = "")
private String ipaddress;
- @CommandLine.Option(names = {"--id"},
- description = "Show info by datanode UUID.",
+ @CommandLine.Option(names = {"--id", "--uuid"},
+ description = "Show info by datanode UUID. Command line option --id " +
+ "will be removed in later versions.",
Review Comment:
> it seems we have some existing Command options where such comments do exist . Do i need to remove the comment from everywhere in ozone?
For this PR I think it's enough to avoid adding new ones. We can file a cleanup task for the existing ones.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] navinko commented on pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by "navinko (via GitHub)" <gi...@apache.org>.
navinko commented on PR #3943:
URL: https://github.com/apache/ozone/pull/3943#issuecomment-1423658649
Hi @adoroszlai updated the PR with changes . Kindly review .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] ChenSammi commented on pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by GitBox <gi...@apache.org>.
ChenSammi commented on PR #3943:
URL: https://github.com/apache/ozone/pull/3943#issuecomment-1334724933
> +1 for this effort to standardize the CLI. I've got a few thoughts on the implementation:
>
> * I don't think modifying the description for all the deprecated flags is very helpful. Ideally we would have some way to hide those option formats from the help output but still have the system accept them. Since picocli's hidden property looks to apply to the whole option, I am not sure if this is possible but it would be nice.
>
> * Are we going to alias and update commands that are non-standard as well? Like `cancelprepare` -> `cancel-prepare` for example?
>
> * Are there ways to enforce the standard going forward?
>
> * We could add a unit test using reflection to check that all option and command annotations do not contain capital letters, one letter options begin with 1 dash, and longer options begin with two dashes. That would help, but still not catch things like --serviceid.
> * Another interesting option is a github action that reminds users/reviewers to make sure commands follow the standard whenever a file with a picocli import is added or modified. Kind of out there but might be useful...
@errose28 , this task aims to fix the CLI options. For command, it's a little bit different. We can do this in another JIRA.
It's a good idea that there will be some tool or unit test which will check the new command before committed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] navinko commented on pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by "navinko (via GitHub)" <gi...@apache.org>.
navinko commented on PR #3943:
URL: https://github.com/apache/ozone/pull/3943#issuecomment-1408135385
> hey @navinko ~ please help resolve the failed test, tks!
Hi @DaveTeng0 This doesn't seems to be related one . I checked in my Feature branch and It looks it's working
<img width="1225" alt="Screenshot 2023-01-30 at 1 10 58 PM" src="https://user-images.githubusercontent.com/8090310/215418253-93e8937b-a630-4f90-9172-c417a49345db.png">
Also TestParentAcl is working in my feature branch
<img width="1738" alt="Screenshot 2023-01-30 at 1 12 44 PM" src="https://user-images.githubusercontent.com/8090310/215418327-3a230898-7723-46ad-a8e5-289eb7b41498.png">
I do not have access to retrigger the failed job on upstream ozone . Can we please retrigger this once and see.?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] DaveTeng0 commented on pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by "DaveTeng0 (via GitHub)" <gi...@apache.org>.
DaveTeng0 commented on PR #3943:
URL: https://github.com/apache/ozone/pull/3943#issuecomment-1409099651
Yes @navinko sure!
@jojochuang could you help me retrigger the CI step 'basic (unit)'? tks~~
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] errose28 commented on pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by GitBox <gi...@apache.org>.
errose28 commented on PR #3943:
URL: https://github.com/apache/ozone/pull/3943#issuecomment-1307946024
+1 for this effort to standardize the CLI. I've got a few thoughts on the implementation:
- I don't think modifying the description for all the deprecated flags is very helpful. Ideally we would have some way to hide those option formats from the help output but still have the system accept them. Since picocli's hidden property looks to apply to the whole option, I am not sure if this is possible but it would be nice.
- Are we going to alias and update commands that are non-standard as well? Like `cancelprepare` -> `cancel-prepare` for example?
- Are there ways to enforce the standard going forward?
- We could add a unit test using reflection to check that all option and command annotations do not contain capital letters, one letter options begin with 1 dash, and longer options begin with two dashes. That would help, but still not catch things like --serviceid.
- Another interesting option is a github action that reminds users/reviewers to make sure commands follow the standard whenever a file with a picocli import is added or modified. Kind of out there but might be useful...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] navinko commented on pull request #3943: HDDS-6736. Provided consistent CLI options
Posted by GitBox <gi...@apache.org>.
navinko commented on PR #3943:
URL: https://github.com/apache/ozone/pull/3943#issuecomment-1336742257
> @navinko , could you check the failed tests if related?
Thanks @ChenSammi for clarifying the scope . I see some test cases failure will update the PR with fix .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org