Skip to content
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

pd-ctl: try to fix interactive mode (#3782) #3784

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #3782

What problem does this PR solve?

Seems cobra command does not support interactive mode, that is we need to init a new command every new line in the REPL.

What is changed and how it works?

  1. readlineCompleter global variables are removed, it is now inlined and created-as-need.
  2. PersistentFlags from the root command will be inherited in the REPL, pd address for example.
  3. Start a new command every new evaluation round.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
pd-ctl -i -u http://127.0.0.1:34/
store --help
store

Interactive should print normally, and show connection refused on port 34.

Release note

Fix broken interactive pd-ctl mode

Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/cherry-pick-not-approved type/cherry-pick-for-release-5.1 The PR belongs to release-5.1 cherry pick. labels Jun 16, 2021
@codecov
Copy link

codecov bot commented Jun 16, 2021

Codecov Report

Merging #3784 (356559b) into release-5.1 (2258e38) will decrease coverage by 0.18%.
The diff coverage is 0.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-5.1    #3784      +/-   ##
===============================================
- Coverage        75.08%   74.89%   -0.19%     
===============================================
  Files              245      245              
  Lines            24531    24540       +9     
===============================================
- Hits             18418    18380      -38     
- Misses            4493     4526      +33     
- Partials          1620     1634      +14     
Flag Coverage Δ
unittests 74.89% <0.00%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tools/pd-ctl/pdctl/ctl.go 39.63% <0.00%> (-3.50%) ⬇️
server/id/id.go 76.19% <0.00%> (-14.29%) ⬇️
server/region_syncer/server.go 83.33% <0.00%> (-6.07%) ⬇️
server/member/member.go 65.59% <0.00%> (-4.31%) ⬇️
server/statistics/hot_cache_task.go 75.00% <0.00%> (-4.17%) ⬇️
pkg/etcdutil/etcdutil.go 84.70% <0.00%> (-3.53%) ⬇️
client/base_client.go 82.47% <0.00%> (-2.58%) ⬇️
server/schedule/operator/step.go 66.77% <0.00%> (-2.33%) ⬇️
server/server.go 70.56% <0.00%> (-2.28%) ⬇️
server/schedule/checker/rule_checker.go 80.11% <0.00%> (-1.11%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2258e38...356559b. Read the comment docs.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 16, 2021
@zhouqiang-cl zhouqiang-cl added the cherry-pick-approved Cherry pick PR approved by release team. label Jun 16, 2021
@nolouch
Copy link
Contributor

nolouch commented Jun 18, 2021

/merge

@ti-chi-bot
Copy link
Member Author

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member Author

@nolouch: /merge in this pull request requires 2 approval(s).

In response to this:

/merge

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member Author

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lhy1024
  • nolouch

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 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 18, 2021
@nolouch
Copy link
Contributor

nolouch commented Jun 18, 2021

/merge

@ti-chi-bot
Copy link
Member Author

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member Author

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

Commit hash: 356559b

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 18, 2021
@ti-chi-bot ti-chi-bot merged commit 8bc9675 into tikv:release-5.1 Jun 18, 2021
@HunDunDM HunDunDM added this to the v5.1.0 milestone Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. release-note Denotes a PR that will be considered when it comes time to generate release notes. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/cherry-pick-for-release-5.1 The PR belongs to release-5.1 cherry pick.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants