etcd icon indicating copy to clipboard operation
etcd copied to clipboard

Remaining errors.Is for error equality checks

Open redwrasse opened this issue 1 year ago • 8 comments

This PR follows up on https://github.com/etcd-io/etcd/pull/18510 to replace the rest of error equality/inequality checks with errors.Is, which is robust to error wrapping (https://pkg.go.dev/errors#pkg-overview).

@ivanvc

redwrasse avatar Sep 06 '24 02:09 redwrasse

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: redwrasse Once this PR has been reviewed and has the lgtm label, please assign wenjiaswe for approval. For more information see the Kubernetes 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:

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

k8s-ci-robot avatar Sep 06 '24 02:09 k8s-ci-robot

Hi @redwrasse. Thanks for your PR.

I'm waiting for a etcd-io 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-sigs/prow repository.

k8s-ci-robot avatar Sep 06 '24 02:09 k8s-ci-robot

@ivanvc let me know if you see any missing cases. this PR also builds on top of https://github.com/etcd-io/etcd/pull/18510, so we could also close that one and just work on this PR.

redwrasse avatar Sep 06 '24 02:09 redwrasse

Seeing some package name conflicts, let me fix

redwrasse avatar Sep 06 '24 03:09 redwrasse

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 61.70213% with 18 lines in your changes missing coverage. Please review.

Project coverage is 68.80%. Comparing base (4a11ca6) to head (799b315). Report is 2 commits behind head on main.

:exclamation: Current head 799b315 differs from pull request most recent head 1775d5e

Please upload reports for the commit 1775d5e to get more accurate results.

Files with missing lines Patch % Lines
server/etcdserver/api/v2discovery/discovery.go 0.00% 1 Missing and 1 partial :warning:
server/etcdserver/api/v3discovery/discovery.go 0.00% 1 Missing and 1 partial :warning:
server/etcdserver/api/v3rpc/watch.go 50.00% 1 Missing and 1 partial :warning:
server/etcdserver/server.go 66.66% 2 Missing :warning:
client/v3/client.go 66.66% 0 Missing and 1 partial :warning:
client/v3/experimental/recipes/key.go 50.00% 1 Missing :warning:
etcdctl/ctlv3/command/auth_command.go 0.00% 1 Missing :warning:
pkg/proxy/server.go 50.00% 1 Missing :warning:
server/etcdserver/api/rafthttp/snapshot_sender.go 0.00% 0 Missing and 1 partial :warning:
server/etcdserver/api/v3rpc/lease.go 83.33% 0 Missing and 1 partial :warning:
... and 4 more

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
Files with missing lines Coverage Δ
client/v3/watch.go 93.24% <100.00%> (-1.00%) :arrow_down:
server/etcdserver/api/rafthttp/pipeline.go 97.40% <100.00%> (ø)
server/etcdserver/api/rafthttp/stream.go 81.58% <100.00%> (-0.24%) :arrow_down:
server/etcdserver/api/v3compactor/periodic.go 90.24% <100.00%> (ø)
server/etcdserver/api/v3rpc/util.go 51.61% <100.00%> (ø)
server/lease/leasehttp/http.go 64.18% <100.00%> (+2.02%) :arrow_up:
client/v3/client.go 84.89% <66.66%> (ø)
client/v3/experimental/recipes/key.go 75.34% <50.00%> (ø)
etcdctl/ctlv3/command/auth_command.go 0.00% <0.00%> (ø)
pkg/proxy/server.go 60.95% <50.00%> (+0.67%) :arrow_up:
... and 10 more

... and 19 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #18551      +/-   ##
==========================================
+ Coverage   68.73%   68.80%   +0.07%     
==========================================
  Files         420      420              
  Lines       35470    35470              
==========================================
+ Hits        24381    24406      +25     
+ Misses       9668     9647      -21     
+ Partials     1421     1417       -4     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4a11ca6...1775d5e. Read the comment docs.

codecov-commenter avatar Sep 06 '24 03:09 codecov-commenter

/ok-to-test

henrybear327 avatar Sep 06 '24 06:09 henrybear327

goimports error, i'll fix it

redwrasse avatar Sep 06 '24 17:09 redwrasse

@redwrasse: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-etcd-unit-test-386 1775d5e0bbb49d970b983c6c9690165be54cdb9e link true /test pull-etcd-unit-test-386
pull-etcd-integration-1-cpu-amd64 1775d5e0bbb49d970b983c6c9690165be54cdb9e link true /test pull-etcd-integration-1-cpu-amd64

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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-sigs/prow repository. I understand the commands that are listed here.

k8s-ci-robot avatar Sep 06 '24 19:09 k8s-ci-robot

Hi @redwrasse, thanks for the pull request. Due to its size and ease of review, would you be able to help us break it into multiple smaller PRs? I suggest one per module, i.e., client, contrib, etcdctl, etc...

I also suggest waiting for #18510 to be merged so you can continue working on it after we have the maintainers' approval and get it merged into main.

Thanks again, Samir.

ivanvc avatar Sep 12 '24 22:09 ivanvc

Link to https://github.com/etcd-io/etcd/issues/18576

ivanvc avatar Sep 12 '24 22:09 ivanvc

@ivanvc sounds good, I'll hold off for now and if we move forward I can help with a separate PR per-module.

redwrasse avatar Sep 12 '24 23:09 redwrasse

@redwrasse, is it okay to assign you to our new parent issue for this? (https://github.com/etcd-io/etcd/issues/18576) If that's ok, you can comment /assign on that issue, and k8s-bot will assign it to you.

ivanvc avatar Sep 12 '24 23:09 ivanvc

Closing this PR, since as discussed the remaining errors.Is changes PRs should be submitted per-module.

redwrasse avatar Sep 20 '24 21:09 redwrasse