Skip to content

Commit

Permalink
Merge branch 'support/1.x' into develop
Browse files Browse the repository at this point in the history
* support/1.x:
  (#3026) Deprecate CygwinService public methods
  (#2953) CygwinService: always set RootDirectory
  (tests) Enable local source
  (maint) Remove/Fix some comments mentioning WebPI
  (#2958) Deprecate WebPI source runner
  (#2981) Deprecate install with direct file path
  (#2985) Deprecate features/sources in `config list`
  (#2983) Deprecate `--remove` option for apikey cmd
  (#2930) Update GenerateDocs.ps1 for choco-theme
  (build) Update Github workflow action versions
  (maint) Add GitReleaseManager.yaml
  (build) Add GitVersion.yml file
  (build) Add missing Criteria
  (build) Update to latest Chocolatey.Cake.Recipe
  (build) Add parameter to not build AWS projects
  (#2870) Update sln and csproj files
  (#2870) Adds No7zip build to recipe.cake

# Conflicts:
#	GenerateDocs.ps1
#	GitVersion.yml
#	gitreleasemanager.yaml
#	src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1
#	tests/chocolatey-tests/commands/choco-install.Tests.ps1
#	tests/chocolatey-tests/commands/choco-list.Tests.ps1
  • Loading branch information
gep13 committed Feb 16, 2023
2 parents 80e76cd + d2db589 commit 3e5031c
Show file tree
Hide file tree
Showing 19 changed files with 159 additions and 32 deletions.
2 changes: 1 addition & 1 deletion GenerateDocs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function Convert-CommandText {
$commandText = $commandText -replace 'https://chocolatey.org/docs/features-package-reducer', 'https://docs.chocolatey.org/en-us/features/package-reducer'
$commandText = $commandText -replace 'https://chocolatey.org/docs/en-us/features/package-reducer', 'https://docs.chocolatey.org/en-us/features/package-reducer'
$commandText = $commandText -replace '\[community feed\)\]\(https://community.chocolatey.org/packages\)', '[community feed](https://community.chocolatey.org/packages))'
$commandText = $commandText -replace '> :choco-info: \*\*NOTE\*\*\s', '> :choco-info: **NOTE**
$commandText = $commandText -replace '> :choco-info: \*\*NOTE\*\*\s', '> :choco-info: **NOTE**
>
> '

Expand Down
6 changes: 3 additions & 3 deletions src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ $commandOptions = @{
list = "--lo --id-only --pre --exact --by-id-only --id-starts-with --detailed --approved-only --not-broken --source='' --user='' --password='' --local-only --prerelease --include-programs --page='' --page-size='' --order-by-popularity --download-cache-only --disable-package-repository-optimizations" + $proListOptions + $allcommands
search = "--pre --exact --by-id-only --id-starts-with --detailed --approved-only --not-broken --source='' --user='' --password='' --local-only --prerelease --include-programs --page='' --page-size='' --order-by-popularity --download-cache-only --disable-package-repository-optimizations" + $proListOptions + $allcommands
info = "--pre --lo --source='' --user='' --password='' --local-only --prerelease --disable-package-repository-optimizations" + $proInfoOptions + $allcommands
install = "-y -whatif -? --pre --version= --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --source='webpi' --user='' --password='' --prerelease --forcex86 --not-silent --package-parameters='' --exit-when-reboot-detected --ignore-detected-reboot --allow-downgrade --force-dependencies --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --allow-multiple-versions --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64='' --stop-on-first-package-failure --disable-package-repository-optimizations --pin" + $proInstallUpgradeOptions + $allcommands
install = "-y -whatif -? --pre --version= --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --user='' --password='' --prerelease --forcex86 --not-silent --package-parameters='' --exit-when-reboot-detected --ignore-detected-reboot --allow-downgrade --force-dependencies --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --allow-multiple-versions --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64='' --stop-on-first-package-failure --disable-package-repository-optimizations --pin" + $proInstallUpgradeOptions + $allcommands
pin = "--name='' --version='' -?" + $proPinOptions + $allcommands
outdated = "-? --source='' --user='' --password='' --ignore-pinned --ignore-unfound --pre --prerelease --disable-package-repository-optimizations" + $proOutdatedOptions + $allcommands
upgrade = "-y -whatif -? --pre --version='' --except='' --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --source='webpi' --user='' --password='' --prerelease --forcex86 --not-silent --package-parameters='' --exit-when-reboot-detected --ignore-detected-reboot --allow-downgrade --allow-multiple-versions --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --fail-on-unfound --fail-on-not-installed --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64='' --exclude-prerelease --stop-on-first-package-failure --use-remembered-options --ignore-remembered-options --skip-when-not-installed --install-if-not-installed --disable-package-repository-optimizations --pin" + $proInstallUpgradeOptions + $proUpgradeOptions + $allcommands
uninstall = "-y -whatif -? --force-dependencies --remove-dependencies --all-versions --source='windowsfeatures' --source='webpi' --version= --uninstall-arguments='' --override-arguments --not-silent --params='' --package-parameters='' --exit-when-reboot-detected --ignore-detected-reboot --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --use-autouninstaller --skip-autouninstaller --fail-on-autouninstaller --ignore-autouninstaller-failure --stop-on-first-package-failure" + $proUninstallOptions + $allcommands
upgrade = "-y -whatif -? --pre --version='' --except='' --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --user='' --password='' --prerelease --forcex86 --not-silent --package-parameters='' --exit-when-reboot-detected --ignore-detected-reboot --allow-downgrade --allow-multiple-versions --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --fail-on-unfound --fail-on-not-installed --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64='' --exclude-prerelease --stop-on-first-package-failure --use-remembered-options --ignore-remembered-options --skip-when-not-installed --install-if-not-installed --disable-package-repository-optimizations --pin" + $proInstallUpgradeOptions + $proUpgradeOptions + $allcommands
uninstall = "-y -whatif -? --force-dependencies --remove-dependencies --all-versions --source='windowsfeatures' --version= --uninstall-arguments='' --override-arguments --not-silent --params='' --package-parameters='' --exit-when-reboot-detected --ignore-detected-reboot --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --use-autouninstaller --skip-autouninstaller --fail-on-autouninstaller --ignore-autouninstaller-failure --stop-on-first-package-failure" + $proUninstallOptions + $allcommands
new = "--template-name='' --output-directory='' --automaticpackage --version='' --maintainer='' packageversion='' maintainername='' maintainerrepo='' installertype='' url='' url64='' silentargs='' --use-built-in-template -?" + $proNewOptions + $allcommands
pack = "--version='' --output-directory='' -?" + $allcommands
push = "--source='' --api-key='' --timeout='' -?" + $proPushOptions + $allcommands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,12 @@ public void should_output_removal_in_v2_0_0()
MockLogger.Messages.Keys.ShouldContain("Warn");
MockLogger.Messages["Warn"].ShouldContain(@"
Will be removed for the list command in v2.0.0.");
MockLogger.Messages["Warn"].ShouldContain(@"
The `webpi` source is deprecated and will be removed in Chocolatey v2.0.0.
The WebPI feed provided by Microsoft was retired on December 31st, 2022. For
more information, see the IIS team's blog post:
https://blogs.iis.net/iisteam/web-platform-installer-end-of-support-feed
");
}
}

Expand All @@ -542,10 +548,23 @@ public override void Because()
command.help_message(configuration);
}

[Fact, Obsolete("Will be removed in v2.0.0")]
public void should_output_deprecation_notice_header()
{
MockLogger.Messages.Keys.ShouldContain("Warn");
MockLogger.Messages["Warn"].ShouldContain("DEPRECATION NOTICE");
}

[Fact]
public void should_not_output_warnings()
public void should_ouput_webpi_removal_in_v2_0_0()
{
MockLogger.Messages.Keys.ShouldNotContain("Warn");
MockLogger.Messages.Keys.ShouldContain("Warn");
MockLogger.Messages["Warn"].ShouldContain(@"
The `webpi` source is deprecated and will be removed in Chocolatey v2.0.0.
The WebPI feed provided by Microsoft was retired on December 31st, 2022. For
more information, see the IIS team's blog post:
https://blogs.iis.net/iisteam/web-platform-installer-end-of-support-feed
");
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/chocolatey/infrastructure.app/ApplicationParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ public static class ExitCodes

public static class Tools
{
//public static readonly string WebPiCmdExe = _fileSystem.combine_paths(InstallLocation, "nuget.exe");
public static readonly string ShimGenExe = _fileSystem.combine_paths(InstallLocation, "tools", "shimgen.exe");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public class ChocolateyApiKeyCommand : ICommand
{
private readonly IChocolateyConfigSettingsService _configSettingsService;

private const string RemoveOptionDeprecationMessage = @"
The --rem / --remove option is deprecated and will be removed in v2.0.0.
In future versions, this option will be replaced with the `remove` subcommand.
";

public ChocolateyApiKeyCommand(IChocolateyConfigSettingsService configSettingsService)
{
_configSettingsService = configSettingsService;
Expand All @@ -49,7 +54,7 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon
"ApiKey - The API key for the source. This is the authentication that identifies you and allows you to push to a source. With some sources this is either a key or it could be a user name and password specified as 'user:password'.",
option => configuration.ApiKeyCommand.Key = option.remove_surrounding_quotes())
.Add("rem|remove",
"Removes an API key from Chocolatey",
"Removes an API key from Chocolatey (DEPRECATED)",
option => configuration.ApiKeyCommand.Remove = true)
;
}
Expand Down Expand Up @@ -82,6 +87,8 @@ source so it doesn't need to be specified every time.
Anything that doesn't contain source and key will list api keys.
");
this.Log().Warn(ChocolateyLoggers.Important, "DEPRECATION NOTICE");
this.Log().Warn(RemoveOptionDeprecationMessage);

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Usage");
"chocolatey".Log().Info(@"
Expand Down Expand Up @@ -152,6 +159,8 @@ public virtual void run(ChocolateyConfiguration configuration)
{
if (configuration.ApiKeyCommand.Remove)
{
this.Log().Warn(ChocolateyLoggers.Important, "DEPRECATION NOTICE");
this.Log().Warn(RemoveOptionDeprecationMessage);
_configSettingsService.remove_api_key(configuration);
}
else if (string.IsNullOrWhiteSpace(configuration.ApiKeyCommand.Key))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ public class ChocolateyConfigCommand : ICommand
{
private readonly IChocolateyConfigSettingsService _configSettingsService;

internal const string DeprecatedConfigListResultsMessage = @"
Starting in v2.0.0, the `config list` command will only list the
configuration values, instead of also listing the configured features
and sources.
Use the `choco feature` or `choco source` commands to list and interact
with these values.
";

public ChocolateyConfigCommand(IChocolateyConfigSettingsService configSettingsService)
{
_configSettingsService = configSettingsService;
Expand All @@ -58,7 +66,7 @@ public virtual void handle_additional_argument_parsing(IList<string> unparsedArg
{
configuration.Input = string.Join(" ", unparsedArguments);
var command = ConfigCommandType.unknown;
string unparsedCommand = unparsedArguments.DefaultIfEmpty(string.Empty).FirstOrDefault().to_string().Replace("-",string.Empty);
string unparsedCommand = unparsedArguments.DefaultIfEmpty(string.Empty).FirstOrDefault().to_string().Replace("-", string.Empty);
Enum.TryParse(unparsedCommand, true, out command);
if (command == ConfigCommandType.unknown)
{
Expand All @@ -73,7 +81,7 @@ public virtual void handle_additional_argument_parsing(IList<string> unparsedArg
)
&& unparsedArguments.Count > 1) throw new ApplicationException("A single features command must be listed. Please see the help menu for those commands");

if (string.IsNullOrWhiteSpace(configuration.ConfigCommand.Name) && unparsedArguments.Count >=2)
if (string.IsNullOrWhiteSpace(configuration.ConfigCommand.Name) && unparsedArguments.Count >= 2)
{
configuration.ConfigCommand.Name = unparsedArguments[1];
}
Expand All @@ -98,6 +106,9 @@ Chocolatey will allow you to interact with the configuration file settings.
NOTE: Available in 0.9.9.9+.
");

this.Log().Warn(ChocolateyLoggers.Important, "DEPRECATION NOTICE");
this.Log().Warn(DeprecatedConfigListResultsMessage);

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Usage");
"chocolatey".Log().Info(@"
choco config [list]|get|set|unset [<options/switches>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ Side by side installations has been deprecated and will be removed in v2.0.0.
Instead of using side by side installations, distinct packages should be created
if similar functionality is needed going forward.
");
"chocolatey".Log().Warn(WebPiService.DeprecationMessage);

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Usage");
"chocolatey".Log().Info(@"
Expand Down Expand Up @@ -302,7 +303,7 @@ choco install nodejs.install --version 0.10.35
choco install git -s ""'https://somewhere/out/there'""
choco install git -s ""'https://somewhere/protected'"" -u user -p pass
Choco can also install directly from a nuspec/nupkg file. This aids in
(DEPRECATED) Choco can also install directly from a nuspec/nupkg file. This aids in
testing packages:
choco install <path/to/nuspec>
Expand Down Expand Up @@ -397,7 +398,7 @@ This specifies the source is Ruby Gems and that we are installing a
the command will install that first.
e.g. `choco install compass -source ruby`
WebPI
WebPI (DEPRECATED)
This specifies the source is Web PI (Web Platform Installer) and that
we are installing a WebPI product, such as IISExpress. If you do not
have the Web PI command line installed, it will install that first and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ choco search <filter> [<options/switches>]
clist <filter> [<options/switches>] (DEPRECATED, will be removed in v2.0.0)
");

"chocolatey".Log().Warn(ChocolateyLoggers.Important, "DEPRECATION NOTICE");

if (configuration.CommandName.is_equal_to("list"))
{
"chocolatey".Log().Warn(ChocolateyLoggers.Important, "DEPRECATION NOTICE");
"chocolatey".Log().Warn(@"
Starting in v2.0.0 the list command will be made local only and will only
work with the installed packages. All options available for connecting
Expand All @@ -199,11 +200,13 @@ Starting in v2.0.0 the list command will be made local only and will only
or `choco find` instead. These will continue to work as usual.
Starting in v2.0.0 the shortcut `clist` will be removed and can not be used
to list package anymore. We recommend you make sure that you always
to list packages anymore. We recommend you make sure that you always
use the full command going forward (`choco list`).
");
}

"chocolatey".Log().Warn(WebPiService.DeprecationMessage);

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Examples");
"chocolatey".Log().Info(@"
choco list --local-only (DEPRECATED: will be default for list in v2.0.0)
Expand Down Expand Up @@ -258,7 +261,7 @@ file a ticket so we can document it at
"chocolatey".Log().Info(@"
Available in 0.9.10+.
WebPI
WebPI (DEPRECATED)
This specifies the source is Web PI (Web Platform Installer) and that
we are searching for a WebPI product, such as IISExpress. If you do
not have the Web PI command line installed, it will install that first
Expand Down
2 changes: 1 addition & 1 deletion src/chocolatey/infrastructure.app/domain/SourceType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public enum SourceType
{
//this is what it should be when it's not set
normal,

[Obsolete("The WebPI service has been retired, and this source type will be removed in v2.0.0 of Chocolatey.")]
webpi,
ruby,
python,
Expand Down
3 changes: 3 additions & 0 deletions src/chocolatey/infrastructure.app/domain/SourceTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

namespace chocolatey.infrastructure.app.domain
{
using System;

/// <summary>
/// This class contains the default source types that are implemented in
/// the Chocolatey CLI codebase. This is replacing the enumeration previously
Expand Down Expand Up @@ -50,6 +52,7 @@ public static class SourceTypes
/// The source is of type Web PI and need to be handled by an
/// alternative source runner.
/// </summary>
[Obsolete("The WebPI service has been retired, and this source type will be removed in v2.0.0 of Chocolatey.")]
public const string WEBPI = "webpi";

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace chocolatey.infrastructure.app.services
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using chocolatey.infrastructure.app.commands;
using configuration;
using infrastructure.services;
using logging;
Expand Down Expand Up @@ -372,11 +373,15 @@ public void config_list(ChocolateyConfiguration configuration)

this.Log().Info("");
this.Log().Info(ChocolateyLoggers.Important, "Sources");
this.Log().Warn(ChocolateyLoggers.Important, "DEPRECATION NOTICE");
this.Log().Warn(ChocolateyConfigCommand.DeprecatedConfigListResultsMessage);
source_list(configuration);
this.Log().Info("");
this.Log().Info(@"NOTE: Use choco source to interact with sources.");
this.Log().Info("");
this.Log().Info(ChocolateyLoggers.Important, "Features");
this.Log().Warn(ChocolateyLoggers.Important, "DEPRECATION NOTICE");
this.Log().Warn(ChocolateyConfigCommand.DeprecatedConfigListResultsMessage);
feature_list(configuration);
this.Log().Info("");
this.Log().Info(@"NOTE: Use choco feature to interact with features.");
Expand Down
Loading

0 comments on commit 3e5031c

Please sign in to comment.