Skip to content

Commit

Permalink
(chocolatey#2958) Deprecate WebPI source runner
Browse files Browse the repository at this point in the history
The WebPI service has been discontinued by Microsoft, and we plan to
remove our WebPI source in v2.0 of Chocolatey.

Deprecating this now to give folks a heads-up for anyone that is somehow
managing to still use it.
  • Loading branch information
vexx32 committed Feb 10, 2023
1 parent 27059b2 commit 2c9d5cb
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,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 @@ -264,6 +264,7 @@ Side by side installations has been deprecated and will be removed in v2.0.0.
if similar functionality is needed going forward.
");
"chocolatey".Log().Warn(NugetService.InstallWithFilePathDeprecationMessage);
"chocolatey".Log().Warn(WebPiService.DeprecationMessage);

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Usage");
"chocolatey".Log().Info(@"
Expand Down Expand Up @@ -398,7 +399,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 @@ -176,9 +176,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 @@ -189,11 +190,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 @@ -248,7 +251,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 @@ -14,6 +14,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using System;

namespace chocolatey.infrastructure.app.domain
{
/// <summary>
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
22 changes: 22 additions & 0 deletions src/chocolatey/infrastructure.app/services/WebPiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace chocolatey.infrastructure.app.services
using results;
using platforms;

[Obsolete("The WebPI service has been retired, and this source type will be removed in v2.0.0 of Chocolatey.")]
public sealed class WebPiService : ISourceRunner
{
private readonly ICommandExecutor _commandExecutor;
Expand Down Expand Up @@ -127,19 +128,34 @@ public void ensure_source_app_installed(ChocolateyConfiguration config, Action<P
}
}

internal const string DeprecationMessage = @"
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
";

private void write_deprecation_warning()
{
this.Log().Warn(ChocolateyLoggers.Important, "DEPRECATION WARNING");
this.Log().Warn(DeprecationMessage);
}

public int count_run(ChocolateyConfiguration config)
{
throw new NotImplementedException("Count is not supported for this source runner.");
}

public void list_noop(ChocolateyConfiguration config)
{
write_deprecation_warning();
var args = ExternalCommandArgsBuilder.build_arguments(config, _listArguments);
this.Log().Info("Would have run '{0} {1}'".format_with(EXE_PATH.escape_curly_braces(), args.escape_curly_braces()));
}

public IEnumerable<PackageResult> list_run(ChocolateyConfiguration config)
{
write_deprecation_warning();
var packageResults = new List<PackageResult>();
var args = ExternalCommandArgsBuilder.build_arguments(config, _listArguments);

Expand Down Expand Up @@ -191,13 +207,15 @@ public IEnumerable<PackageResult> list_run(ChocolateyConfiguration config)

public void install_noop(ChocolateyConfiguration config, Action<PackageResult> continueAction)
{
write_deprecation_warning();
var args = ExternalCommandArgsBuilder.build_arguments(config, _installArguments);
args = args.Replace(PACKAGE_NAME_TOKEN, config.PackageNames.Replace(';', ','));
this.Log().Info("Would have run '{0} {1}'".format_with(EXE_PATH.escape_curly_braces(), args.escape_curly_braces()));
}

public ConcurrentDictionary<string, PackageResult> install_run(ChocolateyConfiguration config, Action<PackageResult> continueAction)
{
write_deprecation_warning();
var packageResults = new ConcurrentDictionary<string, PackageResult>(StringComparer.InvariantCultureIgnoreCase);
var args = ExternalCommandArgsBuilder.build_arguments(config, _installArguments);

Expand Down Expand Up @@ -255,22 +273,26 @@ public ConcurrentDictionary<string, PackageResult> install_run(ChocolateyConfigu

public ConcurrentDictionary<string, PackageResult> upgrade_noop(ChocolateyConfiguration config, Action<PackageResult> continueAction)
{
write_deprecation_warning();
this.Log().Warn(ChocolateyLoggers.Important, "{0} does not implement upgrade".format_with(APP_NAME));
return new ConcurrentDictionary<string, PackageResult>(StringComparer.InvariantCultureIgnoreCase);
}

public ConcurrentDictionary<string, PackageResult> upgrade_run(ChocolateyConfiguration config, Action<PackageResult> continueAction, Action<PackageResult> beforeUpgradeAction = null)
{
write_deprecation_warning();
throw new NotImplementedException("{0} does not implement upgrade".format_with(APP_NAME));
}

public void uninstall_noop(ChocolateyConfiguration config, Action<PackageResult> continueAction)
{
write_deprecation_warning();
this.Log().Warn(ChocolateyLoggers.Important, "{0} does not implement uninstall".format_with(APP_NAME));
}

public ConcurrentDictionary<string, PackageResult> uninstall_run(ChocolateyConfiguration config, Action<PackageResult> continueAction, Action<PackageResult> beforeUninstallAction = null)
{
write_deprecation_warning();
throw new NotImplementedException("{0} does not implement uninstall".format_with(APP_NAME));
}

Expand Down

0 comments on commit 2c9d5cb

Please sign in to comment.