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

Remove github.com/pkg/errors dependency #5557

Merged

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Mar 15, 2022

What type of PR is this:

/kind bug

What does this PR do / why we need it:

This PR:

  • replaces the use of errors.Wrap[f] with fmt.Errorf
  • replaces the use of package github.com/pkg/errors with stdlib package errors for calls to errors.New
  • replaces the use of errors.Cause and errors.Unwrap

The goal is to completely remove the dependency on github.com/pkg/errors as this package is deprecated since go.1.13: https://go.dev/blog/go1.13-errors

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Mar 15, 2022
@openshift-ci
Copy link

openshift-ci bot commented Mar 15, 2022

@feloy: The label(s) kind/cleanup cannot be applied, because the repository doesn't have them.

In response to this:

What type of PR is this:

/kind cleanup

What does this PR do / why we need it:

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/test-infra repository.

@feloy feloy requested review from valaparthvi, rm3l and cdrage and removed request for valaparthvi March 15, 2022 17:45
@netlify
Copy link

netlify bot commented Mar 15, 2022

✅ Deploy Preview for odo-docusaurus-preview canceled.

🔨 Explore the source changes: 8b07352

🔍 Inspect the deploy log: https://app.netlify.com/sites/odo-docusaurus-preview/deploys/623832b2fe337f000949b11f

@odo-robot
Copy link

odo-robot bot commented Mar 15, 2022

Unit Tests on commit 19d432e finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Mar 15, 2022

Kubernetes Tests on commit 19d432e finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Mar 15, 2022

OpenShift Tests on commit 19d432e finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Mar 15, 2022

Windows Tests (OCP) on commit 2dbc617 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Mar 15, 2022

Validate Tests on commit 2dbc617 finished successfully.
View logs: TXT HTML

@feloy feloy force-pushed the use-errorf-no-wrapf branch 2 times, most recently from fa17929 to 99e54da Compare March 16, 2022 16:17
@feloy feloy changed the title [WIP] Use errorf instead of wrapf Remove github.com/pkg/errors dependency Mar 16, 2022
@feloy feloy removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Mar 16, 2022
@feloy
Copy link
Contributor Author

feloy commented Mar 16, 2022

/retest

pkg/catalog/catalog.go Show resolved Hide resolved
pkg/component/component.go Show resolved Hide resolved
pkg/odo/util/cmdutils.go Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
@dharmit
Copy link
Member

dharmit commented Mar 17, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Mar 17, 2022
@feloy
Copy link
Contributor Author

feloy commented Mar 17, 2022

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. Required by Prow. label Mar 17, 2022
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Mar 17, 2022
@feloy feloy removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. Required by Prow. label Mar 17, 2022
@rm3l rm3l self-requested a review March 17, 2022 14:26
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Mar 17, 2022
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Mar 21, 2022
@sonarcloud
Copy link

sonarcloud bot commented Mar 21, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

No Coverage information No Coverage information
1.6% 1.6% Duplication

@valaparthvi
Copy link
Member

@feloy Can you take a look at the Sonar Cloud code smells and tell me if you'd want to fix them in this PR or separately? They don't seem completely irrelevant to me.

@feloy
Copy link
Contributor Author

feloy commented Mar 21, 2022

@feloy Can you take a look at the Sonar Cloud code smells and tell me if you'd want to fix them in this PR or separately? They don't seem completely irrelevant to me.

These smells are about defining constants for errors. It is a more global change to do, not only those raised by this PR. I would prefer that it is done globally in a single PR (like I'm replacing all wrap in this PR)

@valaparthvi
Copy link
Member

/approve
/lgtm

Since this is just a rebase.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Mar 21, 2022
@openshift-ci
Copy link

openshift-ci bot commented Mar 21, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: valaparthvi

The full list of commands accepted by this bot can be found here.

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Mar 21, 2022
@openshift-merge-robot openshift-merge-robot merged commit 24fd026 into redhat-developer:main Mar 21, 2022
cdrage pushed a commit to cdrage/odo that referenced this pull request Aug 31, 2022
* Change errors.Wrapf

* Replace errors.Wrap

* Dont use pkg/errors (except error.Cause)

* Fix errors on Windows (do not test system underlying message)

* Replace errors.Cause

* Review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants