Modernize to remove abandoned dependencies#247
Modernize to remove abandoned dependencies#247erikgb wants to merge 1 commit intocert-manager:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the codebase to remove/avoid abandoned dependencies and updates usages of deprecated APIs, primarily around Go error handling, YAML parsing, and Kubernetes utility types.
Changes:
- Replace
github.com/pkg/errorsusage with standard library error wrapping anderrors.Join. - Replace
github.com/ghodss/yamlwithsigs.k8s.io/yaml. - Migrate Kubernetes
sets.Stringto genericsets.Set[string]and update call sites/tests accordingly.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/sign/internal/kmssigner/kmssigner.go | Switch error wrapping from pkg/errors to fmt.Errorf with %w. |
| pkg/release/platforms.go | Migrate platform parsing helpers from sets.String to sets.Set[string]. |
| pkg/release/platforms_test.go | Update tests to match the new sets.Set[string] API and list semantics. |
| cmd/cmrel/cmd/stage.go | Update set listing/joining for CLI help text and Cloud Build substitutions. |
| cmd/cmrel/cmd/gcb_stage.go | Update set iteration/listing for CLI help text and build loop ordering. |
| pkg/release/manifests/chart.go | Replace YAML dependency import to sigs.k8s.io/yaml. |
| pkg/release/helm/helm.go | Replace pkg/errors + k8s aggregate errors with stdlib errors.Join and k8s.io/utils/ptr. |
| go.mod | Remove direct ghodss/yaml and pkg/errors; drop gopkg.in/yaml.v2 indirect; keep pkg/errors indirect. |
| go.sum | Remove checksums for ghodss/yaml and gopkg.in/yaml.v2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if err != nil { | ||
| return errors.WithStack(err) | ||
| } | ||
|
|
There was a problem hiding this comment.
No new error here, so this is just removing dead code.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| block, _ := pem.Decode([]byte(res.Pem)) | ||
| if block == nil || block.Type != "PUBLIC KEY" { | ||
| return nil, errors.WithMessage(err, "could not decode public key PEM") | ||
| return nil, fmt.Errorf("could not decode public key PEM") | ||
| } |
There was a problem hiding this comment.
This error loses useful context about why PEM decoding failed (no PEM block vs unexpected block.Type). Consider including those details in the message (and keep it non-wrapping since there isn't an underlying err here) to make KMS key misconfiguration/debugging easier.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -6,10 +6,8 @@ require ( | |||
| cloud.google.com/go/storage v1.60.0 | |||
| github.com/blang/semver v3.5.1+incompatible | |||
There was a problem hiding this comment.
The dependency github.com/blang/semver v3.5.1+incompatible is listed as abandoned (last updated 2017-07-27) according to the PR description. This dependency is still being used in pkg/release/platforms.go and pkg/release/validation/validate.go. Consider migrating to a maintained alternative such as golang.org/x/mod/semver or github.com/Masterminds/semver/v3.
| github.com/blang/semver v3.5.1+incompatible | |
| github.com/Masterminds/semver/v3 v3.2.1 |
Signed-off-by: Erik Godding Boye <egboye@gmail.com>
|
/cc @inteon |
I popped into the dependency dashboard (#209) and noticed a few old/abandoned dependencies. This removes a couple of them and also fixes some uses for deprecated APIs.