Open denelon opened 1 year ago
A lot of declarative systems like Terraform have a two stage "plan" and then "apply" approach which would be nice to see here. Where plan is basically like a dry-run. This is slightly different than just like comparing two configuration files, but more in line with the last sentence from the quote is getting at.
I think the relatively straightforward approach the winget-cli team could take is to change the output of configure to show you what changes specifically will need to be made.
This does get MUCH harder with say the "Install required VS workloads" style command though.
For example:
Configuration:
Assert :: OsVersion [ValidateMinimumOSVersion]
Module: Microsoft.Windows.Developer by Microsoft Corporation [Local]
DSC Resource for Windows
Settings:
MinVersion: 10.0.19041
Apply :: DeveloperMode
Module: Microsoft.Windows.Developer by Microsoft Corporation [Local]
DSC Resource for Windows
Settings:
Ensure: Present
Apply :: Environment
Module: PSDscResources by Microsoft Corporation [Local]
DSC Resource for Windows
Settings:
Name: 'DSC_EXAMPLE'
Ensure: 'Present'
Value: 'Desired State Configuration'
Target: 'Machine'
Changes that will be applied to your system:
Apply :: Environment
Module: PSDscResources by Microsoft Corporation [Local]
DSC Resource for Windows
Settings:
Name: 'DSC_EXAMPLE'
Ensure: 'Present'
Value: 'Desired State Configuration'
Target: 'Machine'
You are responsible for understanding the configuration settings you are choosing to execute. Microsoft is not responsible for the configuration file you have authored or imported. This configuration may change settings in Windows, install software, change software settings (including security settings), and accept user agreements to third-party packages and services on your behalf. By running this configuration file, you acknowledge that you understand and agree to these resources and settings. Any applications installed are licensed to you by their owners. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages or services.
Have you reviewed the configuration and would you like to proceed applying it to the system?
[Y] Yes [N] No: Y
Applying...
Assert :: OsVersion [ValidateMinimumOSVersion]
Configuration successfully applied.
Apply :: DeveloperMode
Configuration successfully applied.
Apply :: Environment
Configuration successfully applied.
I agree. Logically we call "test" before "set", but today you would need to run winget configure test
to see if the machine is in the desired state, and output what isn't.
We also know the Visual Studio DSC resource can't yet detect which extensions are installed. I've already been working with their PM team to look at when this could land. It will probably take a long time as the IDE doesn't have support for this kind of probing today.
I'm still not sure this meets the requirements of what I was asking about. Seems to be two issues here:
Description of the new feature / enhancement
I'd like to be able to compare configuration files to determine if there are any potential conflicts.
By @PilotBob in Discussions How does WinGet configuration deal with state conflicts?
Proposed technical implementation details
No response