microsoft / microsoft/winget-cli

Portable Install uses `void` return methods frequently

Open
#5,215 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Feature
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

The flow for installing portable packages uses void returns for functions such as ApplyDesiredState, InstallFile, RemoveFile, RegisterARPEntry, CreateTargetInstallDirectory, RemoveInstallDirectory, RemoveFromPathVariable, AddToPathVariable.

While the current implementation works, having these methods return void is not robust against errors and provides no means for the calling workflows to know if the result of a function was a success or not. To have better logging and error handling, I believe many of these methods should be updated to return bool so that the consumers of the functions can properly handle failures

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the portable-package installation workflows and the listed methods: ApplyDesiredState, InstallFile, RemoveFile, RegisterARPEntry, CreateTargetInstallDirectory, RemoveInstallDirectory, RemoveFromPathVariable, and AddToPathVariable. Trace their callers to determine which methods should report success and how consumers can handle failures; done means the selected methods and their consumers support error-aware logging and handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.