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

[chore] Replaces multierr usage with go native errors package #939

Merged
merged 34 commits into from
Jul 31, 2023

Conversation

dylanlott
Copy link
Contributor

@dylanlott dylanlott commented Jul 26, 2023

Description

The recent upgrade to Go 1.20 enabled the errors package Join function to replace usage of multierr Combine and Append functions. Please note it cannot be removed as a dependency from our go.mod because it is an indirect dependency.

Issue

Follow up changes from review of #861 and merging #910

Type of change

Please mark the relevant option(s):

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Major breaking change
  • Documentation
  • Other

List of changes

  • Replaces multierr.Combine and multierr.Append usage with errors.Join

Testing

  • make develop_test; if any code changes were made
  • make test_e2e on k8s LocalNet; if any code changes were made
  • e2e-devnet-test passes tests on DevNet; if any code was changed
  • Docker Compose LocalNet; if any major functionality was changed or introduced
  • k8s LocalNet; if any infrastructure or configuration changes were made

Required Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added, or updated, godoc format comments on touched members (see: tip.golang.org/doc/comment)
  • I have tested my changes using the available tooling
  • I have updated the corresponding CHANGELOG

If Applicable Checklist

  • I have updated the corresponding README(s); local and/or global
  • I have added tests that prove my fix is effective or that my feature works
  • I have added, or updated, mermaid.js diagrams in the corresponding README(s)
  • I have added, or updated, documentation and mermaid.js diagrams in shared/docs/* if I updated shared/*README(s)

@dylanlott dylanlott added the code health Nice to have code improvement label Jul 26, 2023
@dylanlott dylanlott self-assigned this Jul 26, 2023
@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Jul 26, 2023
@dylanlott dylanlott marked this pull request as draft July 26, 2023 17:42
@dylanlott dylanlott marked this pull request as ready for review July 26, 2023 17:45
@dylanlott dylanlott requested review from Olshansk and h5law July 26, 2023 21:00
@Olshansk Olshansk added the do not merge Prevent merging even with sufficient approvals label Jul 26, 2023
@@ -197,6 +196,7 @@ require (
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/dig v1.15.0 // indirect
go.uber.org/fx v1.18.2 // indirect
go.uber.org/multierr v1.9.0 // indirect
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove this dependency altogether? (go.sum) should be updated too

Copy link
Contributor

Choose a reason for hiding this comment

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

I assume another import from uber uses the multierr as a dep so we cannot get rid of it altogether until they update

Copy link
Member

Choose a reason for hiding this comment

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

@dylanlott Can you verify?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's being imported by some other dependency of ours, but there are no more usages of multierr in our specific code that I could find.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we remove this dependency altogether? (go.sum) should be updated too

I actually don't think go.sum needs to change, the dependency was only made indirect, and the version stayed the same, so I suspect the dependency graph stayed the same 🤔

shared/node.go Outdated Show resolved Hide resolved
shared/node.go Outdated Show resolved Hide resolved
Copy link
Contributor

@h5law h5law left a comment

Choose a reason for hiding this comment

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

LGTM, left a couple comments on lines we can remove but changes are simple enough to :shipit:

@dylanlott dylanlott force-pushed the persistence/savepoints-initial branch from 9a3c346 to 29ad7df Compare July 27, 2023 00:20
@dylanlott dylanlott force-pushed the persistence/savepoints-initial branch from 29ad7df to 0f87f0b Compare July 27, 2023 17:24
@dylanlott dylanlott requested a review from Olshansk July 27, 2023 18:48
Base automatically changed from persistence/savepoints-initial to main July 31, 2023 16:04
@reviewpad reviewpad bot added large Pull request is large small Pull request is small and removed small Pull request is small large Pull request is large labels Jul 31, 2023
@dylanlott dylanlott removed the do not merge Prevent merging even with sufficient approvals label Jul 31, 2023
@dylanlott dylanlott merged commit 4e0b03b into main Jul 31, 2023
9 of 10 checks passed
@dylanlott dylanlott deleted the chore/remove-multierr branch July 31, 2023 18:25
red-0ne pushed a commit that referenced this pull request Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code health Nice to have code improvement small Pull request is small waiting-for-review
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants