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

(#2872) Fix selecting All for interactive prompts #2921

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

vexx32
Copy link
Member

@vexx32 vexx32 commented Nov 29, 2022

Description Of Changes

  • When restoring configuration backups, do not overwrite/change the value of the PromptForConfirmation configuration option.

Motivation and Context

The configuration that choosing "yes to all" modifies for the run should be remembered, even if we need to take/restore config backups, so that the option works as intended.

Testing

  1. Ensure the allowGlobalConfirmation feature is disabled
  2. Run choco with arguments install curl wget -f
  3. When prompted to run the scripts for curl, select "[A] Yes to all"
  4. No further prompts should appear and both installations should complete

Operating Systems Testing

  • Windows 11

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 v2 compatibility checked?

Related Issue

Fixes #2872

@vexx32 vexx32 requested a review from corbob November 29, 2022 13:37
Fixed a regression between 1.1.0 and 1.2.0 where the configuration
backup logic was overwriting the prompt confirmation setting after the
user had selected the 'yes to all' option, making it not auto-confirm
future prompts.

This change ensures that the configuration backup logic effectively
ignores the PromptForConfirmation property, making it a "global" config
setting that is not changed by restoring a config backup.
@vexx32 vexx32 force-pushed the 2872-interactive-ack-all branch from 4849ff9 to b14b0d8 Compare November 29, 2022 14:11
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.

LGTM

@corbob corbob merged commit 2f4fee9 into chocolatey:hotfix/1.2.1 Nov 29, 2022
@corbob
Copy link
Member

corbob commented Nov 29, 2022

Thanks for getting this fixed up @vexx32

@vexx32 vexx32 deleted the 2872-interactive-ack-all branch November 29, 2022 18:41
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.

Selecting [A] Yes to all at package script prompt does not work correctly
2 participants