Skip to content

Commit

Permalink
This commit moves the winget repair feature from experimental to stab…
Browse files Browse the repository at this point in the history
…le, removing the need for a feature flag.
  • Loading branch information
Madhusudhan-MSFT committed Feb 14, 2024
1 parent daf150e commit 6375dd2
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 28 deletions.
11 changes: 0 additions & 11 deletions doc/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,3 @@ You can enable the feature as shown below.
"configuration03": true
},
```

### repair

This feature enables the repair command to be used for package repair.
You can enable the feature as shown below.

```json
"experimentalFeatures": {
"repair": true
},
```
7 changes: 1 addition & 6 deletions schemas/JSON/settings/settings.schema.0.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,7 @@
"description": "Enable support for configuration",
"type": "boolean",
"default": false
},
"repair": {
"description": "Enable support for repairing a package",
"type": "boolean",
"default": false
},
}
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/AppInstallerCLICore/Commands/RepairCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace AppInstaller::CLI
{
struct RepairCommand final : public Command
{
RepairCommand(std::string_view parent) : Command("repair", {"repair"}, parent, Settings::ExperimentalFeature::Feature::Repair) {}
RepairCommand(std::string_view parent) : Command("repair", {"repair"}, parent) {}

std::vector<Argument> GetArguments() const override;

Expand Down
1 change: 0 additions & 1 deletion src/AppInstallerCLIE2ETests/FeaturesCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public void EnableExperimentalFeatures()
WinGetSettingsHelper.ConfigureFeature("experimentalCmd", true);
WinGetSettingsHelper.ConfigureFeature("directMSI", true);
WinGetSettingsHelper.ConfigureFeature("resume", true);
WinGetSettingsHelper.ConfigureFeature("repair", true);
var result = TestCommon.RunAICLICommand("features", string.Empty);
Assert.True(result.StdOut.Contains("Enabled"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ public static void InitializeAllFeatures(bool status)
ConfigureFeature("windowsFeature", status);
ConfigureFeature("resume", status);
ConfigureFeature("reboot", status);
ConfigureFeature("repair", status);
}

private static JObject GetJsonSettingsObject(string objectName)
Expand Down
4 changes: 0 additions & 4 deletions src/AppInstallerCommonCore/ExperimentalFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ namespace AppInstaller::Settings
return userSettings.Get<Setting::EFResume>();
case ExperimentalFeature::Feature::Configuration03:
return userSettings.Get<Setting::EFConfiguration03>();
case ExperimentalFeature::Feature::Repair:
return userSettings.Get<Setting::EFRepair>();
default:
THROW_HR(E_UNEXPECTED);
}
Expand Down Expand Up @@ -79,8 +77,6 @@ namespace AppInstaller::Settings
return ExperimentalFeature{ "Resume", "resume", "https://aka.ms/winget-settings", Feature::Resume };
case Feature::Configuration03:
return ExperimentalFeature{ "Configuration Schema 0.3", "configuration03", "https://aka.ms/winget-settings", Feature::Configuration03 };
case Feature::Repair:
return ExperimentalFeature{ "Repair", "repair", "https://aka.ms/winget-settings", Feature::Repair };
default:
THROW_HR(E_UNEXPECTED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace AppInstaller::Settings
DirectMSI = 0x1,
Resume = 0x2,
Configuration03 = 0x4,
Repair = 0x8,
Max, // This MUST always be after all experimental features

// Features listed after Max will not be shown with the features command
Expand Down
2 changes: 0 additions & 2 deletions src/AppInstallerCommonCore/Public/winget/UserSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ namespace AppInstaller::Settings
EFDirectMSI,
EFResume,
EFConfiguration03,
EFRepair,
// Telemetry
TelemetryDisable,
// Install behavior
Expand Down Expand Up @@ -152,7 +151,6 @@ namespace AppInstaller::Settings
SETTINGMAPPING_SPECIALIZATION(Setting::EFDirectMSI, bool, bool, false, ".experimentalFeatures.directMSI"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFResume, bool, bool, false, ".experimentalFeatures.resume"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFConfiguration03, bool, bool, false, ".experimentalFeatures.configuration03"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFRepair, bool, bool, false, ".experimentalFeatures.repair"sv);
// Telemetry
SETTINGMAPPING_SPECIALIZATION(Setting::TelemetryDisable, bool, bool, false, ".telemetry.disable"sv);
// Install behavior
Expand Down
1 change: 0 additions & 1 deletion src/AppInstallerCommonCore/UserSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ namespace AppInstaller::Settings
WINGET_VALIDATE_PASS_THROUGH(EFDirectMSI)
WINGET_VALIDATE_PASS_THROUGH(EFResume)
WINGET_VALIDATE_PASS_THROUGH(EFConfiguration03)
WINGET_VALIDATE_PASS_THROUGH(EFRepair)
WINGET_VALIDATE_PASS_THROUGH(AnonymizePathForDisplay)
WINGET_VALIDATE_PASS_THROUGH(TelemetryDisable)
WINGET_VALIDATE_PASS_THROUGH(InteractivityDisable)
Expand Down

1 comment on commit 6375dd2

@github-actions
Copy link

Choose a reason for hiding this comment

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

@check-spelling-bot Report

🔴 Please review

See the 📜action log for details.

Unrecognized words (1)

ocale

Previously acknowledged words that are now absent bitspace Mta PFM testdata :arrow_right:
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 [email protected]:Madhusudhan-MSFT/winget-cli.git repository
on the user/masudars/winget_repair_cli_implementation 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/Madhusudhan-MSFT/winget-cli/actions/runs/7907442197/attempts/1'
Available 📚 dictionaries could cover words not in the 📘 dictionary

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

Dictionary Entries Covers
cspell:win32/src/win32.txt 53509 20
cspell:python/src/python/python-lib.txt 3873 3
cspell:python/src/python/python.txt 453 2
cspell:python/src/common/extra.txt 741 2
cspell:php/php.txt 2597 2
cspell:npm/npm.txt 288 2
cspell:java/java.txt 7642 2
cspell:django/django.txt 859 2
cspell:csharp/csharp.txt 19 2
cspell:sql/src/tsql.txt 455 1

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

      with:
        extra_dictionaries:
          cspell:win32/src/win32.txt
          cspell:python/src/python/python-lib.txt
          cspell:python/src/python/python.txt
          cspell:python/src/common/extra.txt
          cspell:php/php.txt
          cspell:npm/npm.txt
          cspell:java/java.txt
          cspell:django/django.txt
          cspell:csharp/csharp.txt
          cspell:sql/src/tsql.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''
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.

Please sign in to comment.