Skip to content

Conversation

vexx32
Copy link
Member

@vexx32 vexx32 commented Oct 15, 2025

Description Of Changes

  • Ensure that CLI checks the current state of the chocolatey.licensed feed before overwriting it
  • If the currently existing source is disabled, retain that state when overwriting the licensed feed
  • Ensure users cannot make unsupported changes to the licensed feed source entry

Motivation and Context

See #3802

Testing

You will need two separate valid licenses in order to manually test the PR.

  1. With no license applied, run choco source list
  2. There should be no chocolatey.licensed feed present
  3. Install a valid and not-expired license
  4. choco source list
  5. The chocolatey.licensed feed should have been added automatically
  6. choco source disable -n chocolatey.licensed
  7. choco source list
  8. The licensed feed should be listed as [disabled]
  9. Replace the license with another valid license
  10. choco source list
  11. The licensed feed should still be listed as [disabled]
  12. Remove the license file
  13. choco source list
  14. The licensed feed should have been removed
  15. Reinstall either license
  16. choco source list
  17. The licensed feed should have been added back once again, but is now enabled.
    i. This is expected behaviour; CLI does not have a way to track the state of the licensed feed when it has been removed.

Operating Systems Testing

Win11

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).
  • Documentation changes.
  • PowerShell code changes.

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?
  • PowerShell code changes: PowerShell v3 compatibility checked?

Related Issue

Fixes #3802

Previously, when changing licenses the licensed source entry was not
retained at all and totally overwritten. This change ensures we at
least retain whether the source was disabled when we overwrite it.

Additionally, we ignore unsupported changes to the licensed source and
overwrite them.
@vexx32 vexx32 requested a review from corbob October 15, 2025 19:52
Copy link
Member

@corbob corbob left a comment

Choose a reason for hiding this comment

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

This looks good to me. It behaves as expected. I've kicked off a targeted Test Kitchen run, once that finishes I'll get this merged in.

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!

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.

Installing a New License Enables Licensed Feed Even When Originally Disabled

3 participants