Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

dmctl: fix dmctl command to improve its usability #1750

Merged
merged 10 commits into from
Jun 15, 2021

Conversation

lichunzhu
Copy link
Contributor

What problem does this PR solve?

Previous dmctl has to put --master-addr in the front. What's more, we hack many usage which is not standard usage of cobra commands.

What is changed and how it works?

  1. Rewrite the cobra command deployment to make dmctl more easy to use. Now --master-addr can be put any where.
  2. Mark --decrypt/encrypt as hidden. Add encrypt/decrypt commands.

Check List

Tests

  • Unit test
  • Integration test

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

@lichunzhu lichunzhu added the needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 label Jun 4, 2021
@lichunzhu lichunzhu added the status/PTAL This PR is ready for review. Add this label back after committing new changes label Jun 4, 2021

func loop() error {
l, err := readline.NewEx(&readline.Config{
Prompt: "\033[31m»\033[0m ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic...

@lance6716 lance6716 added this to the v2.0.4 milestone Jun 7, 2021
@lance6716 lance6716 added the needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated label Jun 7, 2021
Copy link
Collaborator

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will review later

@@ -15,9 +15,11 @@ function dmctl_unwrap_schema() {
function dmctl_wrong_addrs() {
run_dm_ctl $WORK_DIR "https://127.0.0.1:1234,127.0.0.2:1234" \
"list-member" \
"can't connect to https:\/\/127.0.0.1:1234,127.0.0.2:1234" 1
"can't connect to https:\/\/127.0.0.1:1234,127.0.0.2:1234" 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now print error message twice 🤔

@GMHDBJD GMHDBJD added the needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated label Jun 10, 2021
Copy link
Collaborator

@GMHDBJD GMHDBJD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Remember to update docs after merge.

@ti-chi-bot ti-chi-bot added the status/LGT1 One reviewer already commented LGTM label Jun 10, 2021
return Init(cfg)
}
common.DefineConfigFlagSet(rootCmd.PersistentFlags())
rootCmd.SetArgs(args)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SetArgs sets arguments for the command. It is set to os.Args[1:] by default

Copy link
Contributor Author

@lichunzhu lichunzhu Jun 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • GMHDBJD
  • lance6716

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Jun 15, 2021
@lance6716
Copy link
Collaborator

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 7fb0f2c

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #1771.

@lichunzhu lichunzhu deleted the fixDMCtlMasterAddrPosition branch June 15, 2021 03:49
@lance6716 lance6716 added already-update-docs The docs related to this PR already updated. Add this label once the docs are updated and removed needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated labels Jun 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-update-docs The docs related to this PR already updated. Add this label once the docs are updated needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated size/XXL status/can-merge status/LGT2 Two reviewers already commented LGTM, ready for merge status/PTAL This PR is ready for review. Add this label back after committing new changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants