cli / cli/cli

`Extension` methods should not swallow errors

Open
#10,230 2 comments 0 reactions 0 assignees View on GitHub
discuss tech-debt
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

## Description

The `Extension` struct methods are very liberal about swallowing errors e.g. https://github.com/cli/cli/blob/41e99b9eabe47bc8262d5ebfc65626fb29a7ed87/pkg/cmd/extension/extension.go#L161-L171

I don't really think this is advisable. It makes it hard to reason about the state of the system. Is an error to read the manifest really equivalent to an extension being unpinned? No! It's an error. I don't want my pinned extension to suddenly be upgraded. In practice this probably wouldn't happen because a failure to load the extension manifest probably has the system in some other broken state.

### Expected Outcome

Errors are correctly bubbled out of these methods, or in places where errors should be swallowed for fallback, a comment exists explaining why.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.