-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
refactor(errors)!: remove grpc from errors #20402
Conversation
WalkthroughWalkthroughThe changes aimed to streamline error handling by removing the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@@ -5,18 +5,13 @@ go 1.20 | |||
require ( | |||
github.com/pkg/errors v0.9.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also propose removing the errors pkg here as it's only needed for stack traces. Then we would make stack tracers via a build flag and only at the core layer. There isn't a need for all errors to have stack traces here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files ignored due to path filters (2)
errors/go.mod
is excluded by!**/*.mod
errors/go.sum
is excluded by!**/*.sum
Files selected for processing (3)
- errors/errors.go (5 hunks)
- errors/errors_test.go (3 hunks)
- simapp/gomod2nix.toml (4 hunks)
Files skipped from review due to trivial changes (1)
- errors/errors_test.go
Additional Context Used
Path-based Instructions (1)
errors/errors.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (10)
errors/errors.go (4)
35-35
: The implementation of theRegister
function looks good and adheres to the expected behavior of preventing code reuse.
35-35
: The changes to theError
struct, including the removal of thegrpcCode
field, align with the PR's objectives and are implemented correctly.
35-35
: TheWrap
andWrapf
functions are implemented correctly, handling nil errors appropriately and ensuring that stack trace information is attached correctly.
35-35
: TheRecover
function is well-implemented, correctly capturing panics and transforming them into manageable errors, which enhances the robustness of the error handling system.simapp/gomod2nix.toml (6)
5-6
: Updated version and hash forbuf.build/gen/go/cometbft/cometbft/protocolbuffers/go
.Ensure that the new version is compatible with the rest of the project and does not introduce breaking changes.
8-9
: Updated version and hash forbuf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go
.Verify the compatibility of this updated dependency with existing project modules.
174-175
: Updated version and hash forgithub.com/fatih/color
.Check if the new version introduces any changes that might affect the visual aspects of the project.
285-286
: Updated version and hash forgithub.com/hashicorp/go-plugin
.Confirm that the updated plugin system continues to function correctly with the new version.
556-557
: Updated version and hash forgoogle.golang.org/genproto/googleapis/rpc
.Ensure that the updated RPC interfaces are fully compatible with the project's requirements.
559-560
: Updated version and hash forgoogle.golang.org/grpc
.Given the PR's focus on removing gRPC from errors, ensure that this update does not reintroduce any unwanted gRPC dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review Details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- errors/CHANGELOG.md (1 hunks)
Additional Context Used
LanguageTool (1)
errors/CHANGELOG.md (1)
Near line 36: Consider a shorter alternative to avoid wordiness.
Context: ...es from the error package. This is done in order to keep the dependency graph of errors min...
Path-based Instructions (1)
errors/CHANGELOG.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
* [#20402](https://github.com/cosmos/cosmos-sdk/pull/20402) Remove Grpc error codes from the error package. This is done in order to keep the dependency graph of errors minimal | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider revising the entry for conciseness.
- * [#20402](https://github.com/cosmos/cosmos-sdk/pull/20402) Remove Grpc error codes from the error package. This is done in order to keep the dependency graph of errors minimal
+ * [#20402](https://github.com/cosmos/cosmos-sdk/pull/20402) Removed gRPC error codes from the error package to simplify the dependency graph.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
* [#20402](https://github.com/cosmos/cosmos-sdk/pull/20402) Remove Grpc error codes from the error package. This is done in order to keep the dependency graph of errors minimal | |
* [#20402](https://github.com/cosmos/cosmos-sdk/pull/20402) Removed gRPC error codes from the error package to simplify the dependency graph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 💪
@@ -154,10 +142,6 @@ func (e *Error) Wrap(desc string) error { return Wrap(e, desc) } | |||
// It's a handy function to call Wrapf with sdk errors. | |||
func (e *Error) Wrapf(desc string, args ...interface{}) error { return Wrapf(e, desc, args...) } | |||
|
|||
func (e *Error) GRPCStatus() *grpcstatus.Status { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was never called? 🙈
What's the release strategy of this given that we have a v1. |
should we do v1.1 since our semvar is consensus breaking as major? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- simapp/gomod2nix.toml (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- simapp/gomod2nix.toml
I agree with the decision to make this change but 1) we discussed in a previous call that consensus breaking as major is not a great policy and 2) I thought that policy only applied to modules not libraries. If this is a v1 library then I really think we should follow semver and this should be bumped to v2. The downstream side of effects of not following this could be pretty frustrating for some users. |
Makes sense. I would make a few more changes if we go to v2 then. |
Description
this is a proposal to remove grpc as a dep in the errors package. opening to see what others think
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Summary by CodeRabbit
New Features
Chores
Documentation