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

refactor(orc8r): replace deprecated errors module #12724

Merged
merged 2 commits into from May 24, 2022

Conversation

wolfseb
Copy link
Contributor

@wolfseb wolfseb commented May 16, 2022

Replace functions from the github.com/pgk/errors package with
fmt.Errorf. Created in pairing with Moritz Huebner.

Signed-off-by: Sebastian Wolf sebastian.wolf@tngtech.com

Summary

This PR implements the proposed solutions of ticket #12632 for the orc8r module.

A few instances of broken rollback error handling next to the changes
in this PR are also fixed.

Test Plan

Perform Unit tests

Additional Information

Worked in pairing with @MoritzThomasHuebner

  • This change is backwards-breaking

@pull-request-size pull-request-size bot added the size/XL Denotes a Pull Request that changes 500-999 lines. label May 16, 2022
@github-actions
Copy link
Contributor

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions github-actions bot added the component: orc8r Orchestrator-related issue label May 16, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 16, 2022

feg-workflow

    2 files  202 suites   38s ⏱️
371 tests 371 ✔️ 0 💤 0
385 runs  385 ✔️ 0 💤 0

Results for commit 2e759c2.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented May 16, 2022

cloud-workflow

    7 files  354 suites   2m 3s ⏱️
942 tests 942 ✔️ 0 💤 0

Results for commit 2e759c2.

♻️ This comment has been updated with latest results.

@pull-request-size pull-request-size bot added size/XXL Denotes a Pull Request that changes 1000+ lines. and removed size/XL Denotes a Pull Request that changes 500-999 lines. labels May 16, 2022
@wolfseb wolfseb force-pushed the errors_to_stdlib_errors_orc8r branch from fac2483 to b374fbe Compare May 16, 2022 07:38
@github-actions
Copy link
Contributor

github-actions bot commented May 16, 2022

agw-workflow

     77 files     122 suites   7m 6s ⏱️
1 159 tests 1 155 ✔️ 4 💤 0
1 160 runs  1 156 ✔️ 4 💤 0

Results for commit 2e759c2.

♻️ This comment has been updated with latest results.

@wolfseb wolfseb force-pushed the errors_to_stdlib_errors_orc8r branch from b374fbe to 9c4f6d7 Compare May 17, 2022 00:53
@github-actions
Copy link
Contributor

github-actions bot commented May 17, 2022

dp-workflow

  2 files    2 suites   3m 44s ⏱️
15 tests 15 ✔️ 0 💤 0

Results for commit 2e759c2.

♻️ This comment has been updated with latest results.

@wolfseb wolfseb force-pushed the errors_to_stdlib_errors_orc8r branch 5 times, most recently from 3364a91 to ca1c648 Compare May 17, 2022 05:46
@wolfseb wolfseb marked this pull request as ready for review May 17, 2022 07:08
@wolfseb wolfseb requested review from a team and uri200 May 17, 2022 07:08
@wolfseb wolfseb force-pushed the errors_to_stdlib_errors_orc8r branch 3 times, most recently from 2c040ba to eebff2b Compare May 17, 2022 09:06
Copy link
Contributor

@alexzurbonsen alexzurbonsen left a comment

Choose a reason for hiding this comment

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

Code changes look good to me.

@@ -15,9 +15,9 @@ package southbound

import (
"context"
"errors"
Copy link
Contributor

Choose a reason for hiding this comment

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

The cases in which std lib "errors" is imported without obvious use in the diff, are due to replacing errors.New from pkg/errors by errors.New from std lib, I assume?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, exactly. In the same file you should find a removal of github.com/pkg/errors

@@ -27,7 +28,7 @@ func MarshalConfigs(configs map[string]proto.Message) (ConfigsByKey, error) {
for k, v := range configs {
anyVal, err := ptypes.MarshalAny(v)
if err != nil {
return nil, errors.WithStack(err)
Copy link
Member

Choose a reason for hiding this comment

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

We have no replacement for errors.WithStack?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, you still get the file name and line but no call stack.

Copy link
Member

@maxhbr maxhbr left a comment

Choose a reason for hiding this comment

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

LGTM

@wolfseb wolfseb force-pushed the errors_to_stdlib_errors_orc8r branch from eebff2b to deafe42 Compare May 24, 2022 02:13
Replace functions from the github.com/pgk/errors package
with `fmt.Errorf` in /magma/orc8r. Created in pairing
with Moritz Huebner.

Signed-off-by: Sebastian Wolf <sebastian.wolf@tngtech.com>
Replace functions from the github.com/pgk/errors package
with `fmt.Errorf` in /magma/lte. Created in pairing
with Moritz Huebner.

Signed-off-by: Sebastian Wolf <sebastian.wolf@tngtech.com>
@wolfseb wolfseb force-pushed the errors_to_stdlib_errors_orc8r branch from deafe42 to 2e759c2 Compare May 24, 2022 02:26
@wolfseb wolfseb added the ready2merge This PR is ready to be merged (is approved and passes all required checks) label May 24, 2022
@sebathomas sebathomas merged commit e3e0eaf into magma:master May 24, 2022
mpfirrmann pushed a commit to mpfirrmann/magma that referenced this pull request May 31, 2022
* refactor(orc8r): replace deprecated errors module

Replace functions from the github.com/pgk/errors package
with `fmt.Errorf` in /magma/orc8r. Created in pairing
with Moritz Huebner.

Signed-off-by: Sebastian Wolf <sebastian.wolf@tngtech.com>

* refactor(orc8r): replace deprecated errors module

Replace functions from the github.com/pgk/errors package
with `fmt.Errorf` in /magma/lte. Created in pairing
with Moritz Huebner.

Signed-off-by: Sebastian Wolf <sebastian.wolf@tngtech.com>
emakeev pushed a commit to emakeev/magma that referenced this pull request Aug 5, 2022
* refactor(orc8r): replace deprecated errors module

Replace functions from the github.com/pgk/errors package
with `fmt.Errorf` in /magma/orc8r. Created in pairing
with Moritz Huebner.

Signed-off-by: Sebastian Wolf <sebastian.wolf@tngtech.com>

* refactor(orc8r): replace deprecated errors module

Replace functions from the github.com/pgk/errors package
with `fmt.Errorf` in /magma/lte. Created in pairing
with Moritz Huebner.

Signed-off-by: Sebastian Wolf <sebastian.wolf@tngtech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: orc8r Orchestrator-related issue ready2merge This PR is ready to be merged (is approved and passes all required checks) size/XXL Denotes a Pull Request that changes 1000+ lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants