Disable Source without Removing it
Opened this issue · 2 comments
Relevant area(s)
WinGet CLI
Description of the new feature / enhancement
I don't typically use the msstore source. However, I do occasionally use it. Additionally, I have a private source that I only want to use every once in a while - I don't want to use it all the time, but I do like searching it or using it for infrequent updates.
It would be nice to have the ability to enable and disable sources without having to add / remove them so that I don't have to have all the source details all the time.
This also slightly ties in with GPO where a source may be present but "disabled" by GPO - this would be a logical extension of that, formalized.
Proposed technical implementation details
winget source enable
winget source disable
winget source limit (?)
How do you see this with respect to other features.
For example, we do have the notion of "explicit" targeting for a source.
We're working on the "winget-font" source requiring explicit targeting. We didn't want to drive a bunch of network traffic or storage consumption for folks who aren't using the feature.
I'd think we'd mention something in the output of WinGet Upgrade. That would let users know which sources were disabled. I think if a source is "disabled", we wouldn't update the cache (or should we?).
If I'm running a WinGet configuration, the source would most likely be specified, so in that case with it being explicit, it would make sense to update the cache.
We could add a column for the status in winget source list as well to indicate the status of enabled/disabled (which I think means requires explicit targeting or not).
If a source is Disabled, I would expect the cache not to be updated.
In terms of explicit targeting, maybe the State of the source is not just Enabled / Disabled - it could be an enum of Enabled / Disabled / Explicit, where Enabled is included in results and source updates by default, Disabled is excluded and cannot be used, and Explicit is excluded from results and updates unless --source is used to target that specific source.
I don't think we would want anything in the output of winget upgrade unless it's a large demand. I'd just keep it to winget source list. As a user, I would expect to set up my source configuration once and then only adjust it when necessary.
For configuration, I'd assume it would follow the current patterns. For example - what happens if a source is disabled by GPO but a configuration file specifies a package from that source? It fails, doesn't it? If the state of the source is an Enum, then the guidance would be to have a configuration step that ensures the source is not disabled (set it to explicit or enabled), at which point it would behave just like it would if called from the CLI.