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

repository: optimize error handing if root.json fails to load #1303

Merged
merged 3 commits into from
Apr 20, 2021

Conversation

AstroProfundis
Copy link
Contributor

What problem does this PR solve?

This implements the code part of #1300, document updates may still be needed.

What is changed and how it works?

Keep the original error from std libraries, and display an extra warning message if the error is failed loading root.json manifest, and provide an instruction for workaround (tiup mirror set).

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Related changes

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

Release notes:

optimize error messages when `root.json` manifest file fails to load.

@AstroProfundis AstroProfundis added this to the v1.4.2 milestone Apr 13, 2021
@AstroProfundis AstroProfundis requested a review from lucklove April 13, 2021 08:57
@AstroProfundis AstroProfundis self-assigned this Apr 13, 2021
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 13, 2021
@codecov-io
Copy link

Codecov Report

Merging #1303 (63d1ee6) into master (3a1296b) will increase coverage by 25.06%.
The diff coverage is 40.00%.

❗ Current head 63d1ee6 differs from pull request most recent head d899163. Consider uploading reports for the commit d899163 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1303       +/-   ##
===========================================
+ Coverage   26.25%   51.32%   +25.06%     
===========================================
  Files         263      289       +26     
  Lines       18947    20828     +1881     
===========================================
+ Hits         4975    10690     +5715     
+ Misses      13201     8426     -4775     
- Partials      771     1712      +941     
Flag Coverage Δ
cluster 34.83% <0.00%> (?)
dm 26.58% <0.00%> (?)
integrate 45.51% <0.00%> (+29.01%) ⬆️
playground 24.13% <0.00%> (?)
tiup 16.50% <0.00%> (+<0.01%) ⬆️
unittest 22.77% <40.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
cmd/root.go 75.75% <0.00%> (-1.57%) ⬇️
pkg/repository/v1manifest/local_manifests.go 38.09% <0.00%> (-0.46%) ⬇️
pkg/repository/v1manifest/types.go 77.55% <60.00%> (-4.51%) ⬇️
components/playground/instance/instance.go 45.45% <0.00%> (ø)
pkg/cluster/operation/scale_in.go 50.99% <0.00%> (ø)
components/playground/instance/tidb.go 81.25% <0.00%> (ø)
pkg/cluster/operation/action.go 62.02% <0.00%> (ø)
components/playground/instance/ticdc.go 0.00% <0.00%> (ø)
pkg/cluster/operation/operation.go 69.56% <0.00%> (ø)
components/playground/instance/tiflash.go 59.09% <0.00%> (ø)
... and 189 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 3a1296b...d899163. Read the comment docs.

@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 Apr 19, 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: d899163

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

codecov-commenter commented Apr 19, 2021

Codecov Report

Merging #1303 (bff1887) into master (150c90b) will increase coverage by 27.40%.
The diff coverage is 40.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1303       +/-   ##
===========================================
+ Coverage   26.26%   53.66%   +27.40%     
===========================================
  Files         263      289       +26     
  Lines       18960    20841     +1881     
===========================================
+ Hits         4980    11185     +6205     
+ Misses      13207     7854     -5353     
- Partials      773     1802     +1029     
Flag Coverage Δ
cluster 38.34% <0.00%> (?)
dm 26.58% <0.00%> (?)
integrate 47.55% <0.00%> (+31.03%) ⬆️
playground 24.12% <0.00%> (?)
tiup 16.50% <0.00%> (-0.03%) ⬇️
unittest 22.78% <40.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
cmd/root.go 75.75% <0.00%> (-1.57%) ⬇️
pkg/repository/v1manifest/local_manifests.go 38.09% <0.00%> (-0.46%) ⬇️
pkg/repository/v1manifest/types.go 77.55% <60.00%> (-4.51%) ⬇️
pkg/cluster/operation/download.go 36.84% <0.00%> (ø)
...onents/playground/instance/tiflash_proxy_config.go 81.81% <0.00%> (ø)
components/playground/instance/tiflash.go 59.09% <0.00%> (ø)
pkg/logger/debug.go 16.66% <0.00%> (ø)
pkg/cluster/operation/scale_in.go 0.00% <0.00%> (ø)
pkg/logger/logger.go 100.00% <0.00%> (ø)
pkg/cluster/flags/debug.go 100.00% <0.00%> (ø)
... and 203 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 150c90b...bff1887. Read the comment docs.

@ti-chi-bot ti-chi-bot merged commit 8c5e7d2 into pingcap:master Apr 20, 2021
@AstroProfundis AstroProfundis deleted the fix-root-err branch April 21, 2021 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants