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

store_command: propagate the error code to the root command #8798

Merged
merged 5 commits into from
Nov 12, 2024

Conversation

JackL9u
Copy link
Contributor

@JackL9u JackL9u commented Nov 8, 2024

What problem does this PR solve?

propagate the error code to the root command, fixing the bug mention in issue 8762

Issue Number: Ref #8762

What is changed and how does it work?

Check List

Tests

  • Manual test (add detailed scripts or steps below)

The normal case worked.

% ./pd-ctl -u http://127.0.0.1:2379 store delete addr ""
address not found: 
% echo $?                                               
1

The interactive case also works.

% ./pd-ctl -u http://127.0.0.1:2379 -i
» store delete addr ""
address not found: 
»  

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

None.

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Nov 8, 2024
Copy link
Contributor

ti-chi-bot bot commented Nov 8, 2024

Hi @JackL9u. Thanks for your PR.

I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 8, 2024
}
// delete store by its ID
prefix := fmt.Sprintf(storePrefix, id)
_, err := doRequest(cmd, prefix, http.MethodDelete, http.Header{})
if err != nil {
cmd.Printf("Failed to delete store %s: %s\n", args[0], err)
return
return fmt.Errorf("failed to delete store")
Copy link
Member

Choose a reason for hiding this comment

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

It will be better to keep the id and error.

Signed-off-by: Boyang Lyu <[email protected]>
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.

Project coverage is 75.76%. Comparing base (2637331) to head (49b7e7d).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8798      +/-   ##
==========================================
- Coverage   75.80%   75.76%   -0.04%     
==========================================
  Files         461      461              
  Lines       72315    72316       +1     
==========================================
- Hits        54817    54791      -26     
- Misses      14000    14031      +31     
+ Partials     3498     3494       -4     
Flag Coverage Δ
unittests 75.76% <33.33%> (-0.04%) ⬇️

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

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Nov 11, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Nov 12, 2024
Copy link
Contributor

ti-chi-bot bot commented Nov 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nolouch, rleungx

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 12, 2024
Copy link
Contributor

ti-chi-bot bot commented Nov 12, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-11 10:15:56.462973321 +0000 UTC m=+264918.653842310: ☑️ agreed by rleungx.
  • 2024-11-12 03:41:21.17624703 +0000 UTC m=+327643.367116019: ☑️ agreed by nolouch.

@nolouch
Copy link
Contributor

nolouch commented Nov 12, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Nov 12, 2024
@rleungx
Copy link
Member

rleungx commented Nov 12, 2024

/retest

@ti-chi-bot ti-chi-bot bot merged commit bb4c437 into tikv:master Nov 12, 2024
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants