pingcap / tiup

A component manager for TiDB
https://tiup.io
Apache License 2.0
409 stars 304 forks source link

Improve handling of mirror renw #2400

Closed dveeden closed 2 months ago

dveeden commented 3 months ago

What problem does this PR solve?

GetComponentManifest() can return a nil manifest if it returns an error. newMirrorRenewCmd() ignores expiration errors when calling GetComponentManifest(). It should make sure that the manifest is not nil when calling RenewManifest().

ref #2398

What is changed and how it works?

Check List

Tests

Release notes:

Bugfix: The `tiup mirror renew` command could segfault on expired manifests.
ti-chi-bot[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign kaaaaaaang for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/pingcap/tiup/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 55.93%. Comparing base (6f01692) to head (d11e769).

:exclamation: Current head d11e769 differs from pull request most recent head 5ab50e4. Consider uploading reports for the commit 5ab50e4 to get more accurate results

Files Patch % Lines
cmd/mirror.go 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2400 +/- ## ========================================== - Coverage 55.95% 55.93% -0.02% ========================================== Files 329 329 Lines 35221 35224 +3 ========================================== - Hits 19706 19702 -4 - Misses 13143 13149 +6 - Partials 2372 2373 +1 ``` | [Flag](https://app.codecov.io/gh/pingcap/tiup/pull/2400/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [tiup](https://app.codecov.io/gh/pingcap/tiup/pull/2400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `33.58% <0.00%> (-0.06%)` | :arrow_down: | | [unittest](https://app.codecov.io/gh/pingcap/tiup/pull/2400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `22.15% <0.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kaaaaaaang commented 2 months ago

/lgtm

ti-chi-bot[bot] commented 2 months ago

[LGTM Timeline notifier]

Timeline: