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

Refine cluster list and display commands #1139

Merged
merged 5 commits into from
Feb 19, 2021
Merged

Refine cluster list and display commands #1139

merged 5 commits into from
Feb 19, 2021

Conversation

baurine
Copy link
Contributor

@baurine baurine commented Feb 18, 2021

What problem does this PR solve?

In related PR #706 (tiup cluster UI), I need interfaces to get the cluster list and instances of a cluster.

I have implemented it in #706 , but I often need to handle conflicts when the master changes the related code, so I decide to cherry-pick this part of the code to the master.

What is changed and how it works?

  • Extract GetClusterList() method from ListCluster() method
  • Extract GetClusterTopology() method from Display() method

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has exported function/method change
  • Has exported variable/fields change

Release notes:

NONE

@ti-chi-bot ti-chi-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 18, 2021
@baurine baurine marked this pull request as draft February 18, 2021 14:48
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 18, 2021
@codecov-io
Copy link

codecov-io commented Feb 18, 2021

Codecov Report

Merging #1139 (5084f9e) into master (b769ff8) will decrease coverage by 5.73%.
The diff coverage is 81.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1139      +/-   ##
==========================================
- Coverage   53.93%   48.20%   -5.74%     
==========================================
  Files         273      285      +12     
  Lines       19854    20317     +463     
==========================================
- Hits        10709     9793     -916     
- Misses       7499     8999    +1500     
+ Partials     1646     1525     -121     
Flag Coverage Δ
cluster 35.86% <80.43%> (-9.08%) ⬇️
dm 25.66% <68.47%> (+0.15%) ⬆️
integrate 42.34% <81.52%> (-8.50%) ⬇️
playground 2.93% <ø> (?)
tiup 16.36% <ø> (-0.03%) ⬇️
unittest 22.90% <0.00%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
pkg/cluster/manager/display.go 82.02% <80.55%> (-1.32%) ⬇️
pkg/cluster/manager/list.go 78.57% <85.00%> (+2.10%) ⬆️
pkg/queue/any_queue.go 0.00% <0.00%> (-83.34%) ⬇️
pkg/cluster/task/limits.go 0.00% <0.00%> (-68.75%) ⬇️
pkg/cluster/task/sysctl.go 0.00% <0.00%> (-66.67%) ⬇️
components/cluster/command/check.go 5.97% <0.00%> (-63.86%) ⬇️
pkg/cluster/task/copy_file.go 0.00% <0.00%> (-54.55%) ⬇️
components/cluster/command/audit.go 27.27% <0.00%> (-54.55%) ⬇️
pkg/cluster/task/rmdir.go 0.00% <0.00%> (-50.00%) ⬇️
pkg/cluster/manager/patch.go 0.00% <0.00%> (-49.46%) ⬇️
... and 66 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 b769ff8...5084f9e. Read the comment docs.

@baurine baurine marked this pull request as ready for review February 18, 2021 15:04
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 18, 2021
@baurine
Copy link
Contributor Author

baurine commented Feb 19, 2021

@lucklove please help take a look, thanks!

@AstroProfundis
Copy link
Contributor

Could you post a screenshot of what the output of display command is like now? I believe it didn't change the console output?

Also, did you tested with dm component? The manager part is shared by dm and cluster AFAIK.

@baurine
Copy link
Contributor Author

baurine commented Feb 19, 2021

Could you post a screenshot of what the output of display command is like now? I believe it didn't change the console output?

Also, did you tested with dm component? The manager part is shared by dm and cluster AFAIK.

Sure, I did the test manually, and the outputs are exactly the same.

image

image

@baurine
Copy link
Contributor Author

baurine commented Feb 19, 2021

How do I test with dm component? I never used dm before.

@AstroProfundis
Copy link
Contributor

dm should work much like cluster, only that it deploys a DM cluster.

@baurine
Copy link
Contributor Author

baurine commented Feb 19, 2021

Manaully test result for tiup dm:

WeCom20210219-163906@2x

WeCom20210219-164004@2x

WeCom20210219-164140@2x

WeCom20210219-164208@2x

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AstroProfundis

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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 19, 2021
@AstroProfundis
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 19b7b85

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 19, 2021
@ti-chi-bot
Copy link
Member

@baurine: Your PR has out-of-dated, I have automatically updated it for you.

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 ti-chi-bot merged commit 30b7746 into pingcap:master Feb 19, 2021
@baurine baurine deleted the refine-list-display-commands branch February 19, 2021 09:45
This was referenced Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants