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

[Spec] WinGet configure export and import settings #3694

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RDMacLachlan
Copy link
Member

@RDMacLachlan RDMacLachlan commented Sep 27, 2023


Microsoft Reviewers: Open in CodeFlow

@RDMacLachlan RDMacLachlan requested a review from a team as a code owner September 27, 2023 16:28
@github-actions
Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view or the 📜action log for details.

Unrecognized words (1)

rdmaclachlan

Previously acknowledged words that are now absent attr DMPAs dsc fabricbot remoting Syncy timezone wfopen :arrow_right:
Some files were automatically ignored

These sample patterns would exclude them:

^\Qsrc/AppInstallerCLIE2ETests/TestData/Configuration/Empty.yml\E$

You should consider adding them to:

.github/actions/spelling/excludes.txt

File matching is via Perl regular expressions.

To check these files, more of their words need to be in the dictionary than not. You can use patterns.txt to exclude portions, add items to the dictionary (e.g. by adding them to allow.txt), or fix typos.

To accept ✔️ these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the git@github.com:RDMacLachlan/winget-cli.git repository
on the user/romaclac/Spec/WinGet-export-and-import-settings branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.21/apply.pl' |
perl - 'https://github.com/microsoft/winget-cli/actions/runs/6328774832/attempts/1'
Available 📚 dictionaries could cover words not in the 📘 dictionary

This includes both expected items (556) from .github/actions/spelling/expect.txt and unrecognized words (1)

Dictionary Entries Covers
cspell:cpp/src/cpp.txt 30216 30
cspell:win32/src/win32.txt 53509 25
cspell:python/src/python/python-lib.txt 3873 6
cspell:php/php.txt 2597 5
cspell:python/src/common/extra.txt 741 4
cspell:java/java.txt 7642 4
cspell:python/src/python/python.txt 453 3
cspell:npm/npm.txt 288 2
cspell:golang/go.txt 3412 2
cspell:dotnet/dotnet.txt 2263 2

Consider adding them using (in .github/workflows/spelling3.yml):

      with:
        extra_dictionaries:
          cspell:cpp/src/cpp.txt
          cspell:win32/src/win32.txt
          cspell:python/src/python/python-lib.txt
          cspell:php/php.txt
          cspell:python/src/common/extra.txt
          cspell:java/java.txt
          cspell:python/src/python/python.txt
          cspell:npm/npm.txt
          cspell:golang/go.txt
          cspell:dotnet/dotnet.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''
Warnings (1)

See the 📂 files view or the 📜action log for details.

ℹ️ Warnings Count
ℹ️ binary-file 1

See ℹ️ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.


## Solution Design

The new user experience will expand on the existing WinGet Settings / WinGet Settings Export commands. No changes will be made to the existing user experience.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The winget settings export command already exists, but only prints the admin settings and the path to the user settings file. Based on the description below, would this behavior need to change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach I was thinking about with this was that if the user runs winget settings export then the existing experience would be maintained. If they provide --Path as a parameter, then we would create a file with the settings in it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, makes sense

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather focus on the DSC v3 "export" verb for this scenario. The Microsoft.WinGet.DSC resource already allows setting both user and administrative settings.


## Abstract

The Windows Package Manager client does not have an automatable approach for the application of user settings. Each time I setup a Windows Sandbox, or new Virtual Machine I need to add my unique sources (`winget source add -t "Microsoft.REST" -a "https://winget.com/api" -n "REST"`), then to enable the desired user experiences I must run `winget settings` select a text editor, then either manually type in my configuration settings or copy them from another device.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting statement, since sources aren't part of the winget settings file.

I read this more as "There should be a way for me to export my current winget configuration - including all user settings, sources, pins, etc. . .", is that accurate? In which case, I would imagine the preferred path would be to export as a configuration file that winget can use with winget configure to apply the appropriate settings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scenario that I am looking to resolve is: I can automate the configuration of all Winget configurable settings.

WinGet Source can be Winget source add, after this change, a user could run WinGet Settings import to apply settings. Pinning was not taken into account....

@RDMacLachlan
Copy link
Member Author

Speaking with Demitrius, it appears that the WinGet DSC will solve the issue I was attempting to solve with a new sub-command..

@denelon
Copy link
Contributor

denelon commented Sep 27, 2023

Speaking with Demitrius, it appears that the WinGet DSC will solve the issue I was attempting to solve with a new sub-command..

I've added some comments to

@denelon denelon changed the title User/romaclac/spec/win get export and import settings [Spec] WinGet configure export and import settings Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants