-
Notifications
You must be signed in to change notification settings - Fork 646
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
Migrate all commands to cobra style commands #472
Comments
Idea seems right to me, however from what I see https://github.com/etcd-io/bbolt/pull/473/files makes a breaking change on command line from I think this is ok for new commands like |
For bbolt golang public API, we will keep them compatible in all 1.x releases. For commands, we have two options,
What edge cases? |
cc @ptabor
Just making a point that before refactoring the codebase we should double check out test coverage for command line surface. |
It's a good suggestion. Currently we have test cases for most of the commands. Only three commands ( |
Just added test cases to cover all the commands which do not have cases before. #474 |
The plan is to migrate all surgery commands to cobra style commands firstly. Please take a look at the first PR #473 Afterwards, we can discuss whether to migrate other old commands. Should we keep it compatible for all old commands? |
Based on my experience in K8s community I think maintaining backward compatibility is very important. My preference would be to do a proper migration similar to what we did for etcdctl. By default keep the old behavior, and allow users to switch to cobra style arguments by passing environment variable. However this will be time consuming I leave it up to you to decide if you can invest the time. |
The plan is to migrate all surgery commands to cobra style commands in 1.4, and migrate all other old commands in 2.0. Does it make sense?
It's a good suggestion in general; but I really don't want to complicate the bbolt CLI, and don't want to spend too much time on it. |
can you link example PR or are there refs? would like to help migrating part of the command @ahrtr |
/cc @jmhbnz |
Hey @charles-chenzz - Please refer to https://github.com/etcd-io/bbolt/pulls?q=is%3Apr+migrate+cobra+style for examples of pull requests migrating commands to cobra style. |
Thanks for the help. As I mentioned in #472 (comment), migrating other commands to cobra style commands is a breaking change, so we decided to do it in 2.0. |
we slowing migrate parts of them from 1.4 - 2.0 or we plan to start the other migrate in one shot in 2.0? I already have a PR wip. If we do in one shot then I need to hold the PR |
Hi @charles-chenzz ,
are you working on all of bbolt commands ?
|
@ahrtr shall i take this on ? |
hi @ishan16696 , I was working on part of it. please feel free to take on. |
@ahrtr i can take this 👍🏽 |
I can do the the info command next when the buckets command above is ok to merge |
Signed-off-by: tommy shem <[email protected]>
@ahrtr hello I thought we are holding this on, due to breaking changes, or ? |
As long as there isn't any behavior change from users' perspective, then it's OK to get it done in 1.4. |
Just confirming that we're not considering a behavior change that Go flags are not POSIX compliant (single dash) and that it's okay to replace them with pflags (double dash/POSIX compliant)? If we're okay with this change, I think we can start splitting the work. I originally migrated |
single dash to double dash should be a breaking change. |
Signed-off-by: tommy shem <[email protected]>
the buckets command has no flags only the path argument |
PS C:\tmp\fork\bbolt1\cmd\bbolt> .\bbolt.exe page -h Additional options include:
Page prints one or more pages in human readable format. the above is the output from the page command . |
+1, we can split the required work here, feel free to assign me on this 👍🏽 |
@Elbehery, I think a good starting point would be checking which commands don't have flags. These would be good candidates to be migrated without breaking changes. |
Signed-off-by: tommy shem <[email protected]>
Signed-off-by: tommy shem <[email protected]>
We have already implemented part of the surgery command as cobra style commands,
bbolt/cmd/bbolt/command_surgery_cobra.go
Line 28 in bd7d6e9
We need to migrate all other commands to cobra style commands,
We can create a separate file for each command, such as
command_page.go
for thebbolt page
command. Please anyone feel free to drop message if you are interested in migrating any command.I will provide an example PR soon.
The text was updated successfully, but these errors were encountered: