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

tiup: fix -v/--version argument #1243

Merged
merged 2 commits into from
Mar 26, 2021
Merged

Conversation

AstroProfundis
Copy link
Contributor

What problem does this PR solve?

Not able to show components' version as the -v/--version was always been processed by tiup. It was introduced in #1158

What is changed and how it works?

Not using cobra's builtin Version field, but define a custom version argument in tiup.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Release notes:

NONE

@AstroProfundis AstroProfundis added the type/bug-fix Categorizes PR as a bug-fix label Mar 25, 2021
@AstroProfundis AstroProfundis added this to the v1.4.0 milestone Mar 25, 2021
@AstroProfundis AstroProfundis requested a review from lucklove March 25, 2021 03:57
@AstroProfundis AstroProfundis self-assigned this Mar 25, 2021
@ti-chi-bot ti-chi-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 25, 2021
@codecov-io
Copy link

codecov-io commented Mar 25, 2021

Codecov Report

Merging #1243 (4b87152) into master (ede1182) will increase coverage by 15.96%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1243       +/-   ##
===========================================
+ Coverage   26.27%   42.23%   +15.96%     
===========================================
  Files         263      254        -9     
  Lines       18684    17729      -955     
===========================================
+ Hits         4909     7488     +2579     
+ Misses      13022     8943     -4079     
- Partials      753     1298      +545     
Flag Coverage Δ
cluster 38.34% <ø> (?)
dm 25.04% <ø> (?)
integrate 42.23% <ø> (+25.71%) ⬆️
tiup ?
unittest ?

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

Impacted Files Coverage Δ
pkg/cluster/manager/destroy.go 30.98% <ø> (+30.98%) ⬆️
pkg/repository/store/store.go 0.00% <0.00%> (-100.00%) ⬇️
components/dm/ansible/worker.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/repository/utils/hash.go 0.00% <0.00%> (-81.82%) ⬇️
pkg/meta/err.go 0.00% <0.00%> (-81.25%) ⬇️
pkg/telemetry/meta.go 0.00% <0.00%> (-80.00%) ⬇️
pkg/telemetry/scrub.go 6.66% <0.00%> (-80.00%) ⬇️
pkg/repository/store/local.go 0.00% <0.00%> (-76.48%) ⬇️
pkg/cluster/api/error.go 0.00% <0.00%> (-75.00%) ⬇️
pkg/repository/model/publish.go 0.00% <0.00%> (-71.43%) ⬇️
... and 237 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 ede1182...4b87152. Read the comment docs.

@9547
Copy link
Contributor

9547 commented Mar 25, 2021

Another question that's a little bit related, when I'm running tiup dm -v, the output doesn't show dm, does it by design or not:

image

@AstroProfundis
Copy link
Contributor Author

does it by design or not

That's not totally by design, but is the expected behaviour. The field is actually the args[0] of the command, if you invoke the tiup-dm binary directly you'll see the difference.

We have some tricks handling args[0] in cluster to show correctly help messages, but they're generally not essential so it could be ok to just leave them alone.

@lucklove
Copy link
Member

/lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lucklove

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 Mar 26, 2021
@lucklove
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: af91e65

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 26, 2021
@ti-chi-bot ti-chi-bot merged commit 6b3d44f into pingcap:master Mar 26, 2021
@AstroProfundis AstroProfundis deleted the fix-arg-v branch March 26, 2021 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 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. type/bug-fix Categorizes PR as a bug-fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants