Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare configuration files #3325

Open
denelon opened this issue Jun 9, 2023 · 3 comments
Open

Compare configuration files #3325

denelon opened this issue Jun 9, 2023 · 3 comments
Labels
Command-Configure Issue related to WinGet Configuration Issue-Feature This is a feature request for the Windows Package Manager client.
Milestone

Comments

@denelon
Copy link
Contributor

denelon commented Jun 9, 2023

Description of the new feature / enhancement

I'd like to be able to compare configuration files to determine if there are any potential conflicts.

Let's say for example I have two dsc configuration files.

They each set a windows setting to a different value.

If I try to apply the configuration that conflicts with an existing deployed DSC, does it stop and show me the conflict, or will it happily change the setting breaking the previous DSC configuration?

By @PilotBob in Discussions How does WinGet configuration deal with state conflicts?

Proposed technical implementation details

No response

@denelon denelon added Issue-Feature This is a feature request for the Windows Package Manager client. Command-Configure Issue related to WinGet Configuration labels Jun 9, 2023
@denelon denelon added this to the v.Next-Client milestone Jun 9, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Jun 9, 2023
@denelon denelon removed the Needs-Triage Issue need to be triaged label Jun 9, 2023
@rlabrecquefsg
Copy link

rlabrecquefsg commented Jul 1, 2023

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.

@denelon
Copy link
Contributor Author

denelon commented Oct 13, 2023

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.

@PilotBob
Copy link

I'm still not sure this meets the requirements of what I was asking about. Seems to be two issues here:

  1. What will the DSC change - fine it can do that.
  2. Will that change conflict with an existing "applied" DSC - seems like there is still no way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Command-Configure Issue related to WinGet Configuration Issue-Feature This is a feature request for the Windows Package Manager client.
Projects
None yet
Development

No branches or pull requests

3 participants