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

(#2412) Change importing of Licensed extension to output warning #2414

Conversation

AdmiringWorm
Copy link
Member

@AdmiringWorm AdmiringWorm commented Oct 21, 2021

Description Of Changes

Version 0.11.1 introduced changes to how the Chocolatey Licensed Extension was loaded, and changed any failures of loading the extension away from being a warning to be a Error instead.

This pull request updates the importing to instead re-introduce the failure as a warning by wrapping the imports inside a try/catch block instead.

Motivation and Context

To revert a breaking change that had been introduced in v0.11.1, and to keep it backwards compatible.

What Have I Done To Test This

This have been tested with following scenarios in mind.

  1. Manual importing of the chocolateyInstaller.psm1 script, which did not use to write out an error.
  2. Create a AU package, or import an existing one that uses Get-ChocolateyWebFile, and make sure any monkey patch is not already available. Try updating the package.
  3. Load in an extension version we are sure that will fail to load (like loading official licensed extension, into an unofficial Chocolatey build).

Change Types Made

  • Bug fix (non-breaking change)
  • Feature / Enhancement (non-breaking change)
  • Breaking change (fix or feature that could cause existing functionality to change)

Related Issue

Change Checklist

  • Requires a change to the documentation
  • Documentation has been updated
  • Tests to cover my changes, have been added
  • All new and existing tests passed.

@AdmiringWorm AdmiringWorm self-assigned this Oct 21, 2021
Copy link
Member

@pauby pauby left a comment

Choose a reason for hiding this comment

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

LGTM.

@gep13 gep13 force-pushed the 2412-Faling-to-load-all-helper-cmdlets-when-extensions-fails-to-load branch from 874c796 to 15a55aa Compare October 21, 2021 20:23
@gep13 gep13 changed the base branch from develop to hotfix/0.11.3 October 21, 2021 20:23
This commit updates the chocolateyInstaller module to not output an error
when failing to load the Chocolatey Licensed Extension which would prevent
all helper cmdlets in FOSS being exported.

Instead the importing have been wrapped inside a try/catch block and writes
out a Warning that includes the reason the importing failed.
@gep13 gep13 force-pushed the 2412-Faling-to-load-all-helper-cmdlets-when-extensions-fails-to-load branch from 15a55aa to a9b0ea9 Compare October 21, 2021 20:30
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

LGTM!

@gep13 gep13 merged commit 708a860 into chocolatey:hotfix/0.11.3 Oct 21, 2021
@gep13
Copy link
Member

gep13 commented Oct 21, 2021

@AdmiringWorm thank you for getting this fixed up!

@AdmiringWorm AdmiringWorm deleted the 2412-Faling-to-load-all-helper-cmdlets-when-extensions-fails-to-load branch November 20, 2021 05:14
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.

Chocolatey fails to load all PowerShell helper cmdlets when attempting to loads modules
3 participants