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

feat: standalone errors go.mod #10779

Merged
merged 16 commits into from
Dec 17, 2021
Merged

feat: standalone errors go.mod #10779

merged 16 commits into from
Dec 17, 2021

Conversation

aaronc
Copy link
Member

@aaronc aaronc commented Dec 14, 2021

Description

This PR:

  • moves all of the types/errors code to a new errors go module, except:
    • the RootCodespace errors in types/errors stay there
    • ABCI stuff that depends on tendermint stays in `types/errors
  • adds aliases to everything in types/errors referencing errors so this is not a breaking change

This will allow standalone go modules to use the same error types as the SDK. In particular, I want the orm to reference errors and then the SDK will be able to import orm and it can stay standalone. The same could apply to the db module.

After this PR the plan is to:

  • tag github.com/cosmos/cosmos-sdk/errors as v1.0 🎉
  • remove the replace directive for errors in the main SDK go.mod

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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

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...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@aaronc aaronc marked this pull request as ready for review December 14, 2021 20:41
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

utACK, can we add a changelog entry

@aaronc
Copy link
Member Author

aaronc commented Dec 14, 2021

utACK, can we add a changelog entry

added. does it make sense that this goes under Improvements?

also, I added a CHANGELOG for the errors go module. how should we handle that release? do I include it as Unreleased or put v1.0 now and tag later? do we need a separate release branch?

errors/CHANGELOG.md Outdated Show resolved Hide resolved
errors/CHANGELOG.md Show resolved Hide resolved
@@ -0,0 +1,11 @@
module errors
Copy link
Contributor

Choose a reason for hiding this comment

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

What happened to the core/base idea discussed in #9011?

in my mind errors has too small scope to warrant its own module. Same applies to math or codec. I personally prefer to have one core module to regroup these small building blocks, instead of having to maintain 10+ small go modules.

Copy link
Contributor

Choose a reason for hiding this comment

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

I tend to sort of agree here. What are your thoughts @aaronc?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to write up my thoughts in a discussion thread and link back here

Copy link
Member Author

Choose a reason for hiding this comment

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

Posted my thoughts here: #10582 (comment). Would be great to hear your comments on this

@blushi blushi self-assigned this Dec 16, 2021
@tac0turtle
Copy link
Member

@AmauryM @alexanderbez @robert-zaremba what are your thoughts on allowing this to be merged for now but continuing the discussion in the new year.

@amaury1093
Copy link
Contributor

SGTM 👍. If we tag, maybe we can tag v1.0.0-alpha1? This way it can unblock work on the orm, while still giving us flexibility to change our minds if needed.

Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

lgtm, pending tests

@aaronc
Copy link
Member Author

aaronc commented Dec 17, 2021

SGTM 👍. If we tag, maybe we can tag v1.0.0-alpha1? This way it can unblock work on the orm, while still giving us flexibility to change our minds if needed.

How about beta because the SDK will depend on it?

@amaury1093
Copy link
Contributor

beta is fine too

@aaronc aaronc added the A:automerge Automatically merge PR once all prerequisites pass. label Dec 17, 2021
@codecov
Copy link

codecov bot commented Dec 17, 2021

Codecov Report

Merging #10779 (f5f24a6) into master (59ae402) will decrease coverage by 1.42%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10779      +/-   ##
==========================================
- Coverage   66.00%   64.58%   -1.43%     
==========================================
  Files         632      611      -21     
  Lines       63334    58741    -4593     
==========================================
- Hits        41805    37936    -3869     
+ Misses      19199    18673     -526     
+ Partials     2330     2132     -198     
Impacted Files Coverage Δ
errors/errors.go 100.00% <100.00%> (ø)
errors/handle.go
errors/stacktrace.go
types/errors/abci.go
x/group/internal/orm/iterator.go
x/group/client/testutil/query.go
x/group/keeper/invariants.go
x/group/keeper/keeper.go
x/group/keeper/msg_server.go
x/group/client/testutil/tx.go
... and 13 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants