microsoft / microsoft/winget-cli
Portable Install uses `void` return methods frequently
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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