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

check: refine CheckClusterVersion #2713

Merged
merged 13 commits into from Sep 23, 2021

Conversation

asddongmen
Copy link
Contributor

What problem does this PR solve?

make func CheckClusterVersion more intuitive to use

What is changed and how it works?

Separate the logic of checking pd version into CheckPDVersion .

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has exported function/method change

Side effects

  • None

Related changes

  • None

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 1, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3AceShowHand
  • overvenus

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 the release-note-none Denotes a PR that doesn't merit a release note. label Sep 1, 2021
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 1, 2021
@asddongmen asddongmen added type/enhancement This is a enhancement PR and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 1, 2021
@asddongmen asddongmen added the status/ptal Could you please take a look? label Sep 1, 2021
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 1, 2021
@asddongmen
Copy link
Contributor Author

asddongmen commented Sep 1, 2021

/run-integration-tests

pkg/cmd/factory/factory_impl.go Outdated Show resolved Hide resolved
pkg/version/check.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 3, 2021
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 3, 2021
Copy link
Member

@hi-rustin hi-rustin left a comment

Choose a reason for hiding this comment

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

reset LGTM.

pkg/cmd/factory/factory_impl.go Outdated Show resolved Hide resolved
pkg/version/check.go Show resolved Hide resolved
pkg/version/check.go Outdated Show resolved Hide resolved
@hi-rustin
Copy link
Member

Also, maybe we need to change the pr title since it will be used as the commit msg, but it looks like we are mostly modifying the version checking of the pd.

@asddongmen asddongmen changed the title check: refine some funcs check: refine CheckClusterVersion Sep 13, 2021
@asddongmen
Copy link
Contributor Author

/run-unit-tests

@asddongmen asddongmen closed this Sep 22, 2021
@asddongmen asddongmen reopened this Sep 22, 2021
// See more: https://github.com/pingcap/pd/blob/v4.0.0-rc.1/server/api/version.go
pdVer := struct {
Version string `json:"version"`
}{}

httpClient, err := httputil.NewClient(credential)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer to name it cli, we know that it's an HTTP client by the right-hand side.

Copy link
Member

Choose a reason for hiding this comment

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

cli is a very confusing acronym (first thought is command line interface), and it is not a recognized acronym for the client, it does not have a consensus acronym. So I prefer to change it to client to reduce confusion.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 22, 2021
Copy link
Member

@overvenus overvenus left a comment

Choose a reason for hiding this comment

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

LGTM

@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 Sep 23, 2021
@overvenus
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 84d713a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 23, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #2713 (84d713a) into master (11e574c) will increase coverage by 3.3258%.
The diff coverage is 55.0187%.

@@               Coverage Diff                @@
##             master      #2713        +/-   ##
================================================
+ Coverage   55.3406%   58.6665%   +3.3258%     
================================================
  Files           164        180        +16     
  Lines         19754      18583      -1171     
================================================
- Hits          10932      10902        -30     
+ Misses         7790       6708      -1082     
+ Partials       1032        973        -59     

@ti-chi-bot ti-chi-bot merged commit f84b9da into pingcap:master Sep 23, 2021
@asddongmen asddongmen deleted the refine_check_cluster_version branch October 8, 2021 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. status/ptal Could you please take a look? type/enhancement This is a enhancement PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants