Skip to content

choco source --noop doesn't reflect actual operation(s) #3703

@gep13

Description

@gep13

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

When using noop/whatif, updating a choco source password doesn't not match the behaviour seen when not using noop/whatif.

What is Expected?

If the password does not need to be updated, the output message should reflect that.

How Did You Get This To Happen?

  1. Set up a source (see "Updated ChocolateyInternal..."): choco source add --name="ChocolateyInternal" --source="https://2022bare.ch0.co:8443/repository/ChocolateyInternal/index.json" -p="'originalPassword'"
  2. "Update" the password to the same password (see "Nothing to change. Config already set."): choco source add --name="ChocolateyInternal" --source="https://2022bare.ch0.co:8443/repository/ChocolateyInternal/index.json" -p="'originalPassword'"
  3. Update the password to a new password (see "Updated ChocolateyInternal..."): choco source add --name="ChocolateyInternal" --source="https://2022bare.ch0.co:8443/repository/ChocolateyInternal/index.json" -p="'newPassword'"
  4. Reset the password to a known value (see: "Update ChocolateyInternal"): choco source add --name="ChocolateyInternal" --source="https://2022bare.ch0.co:8443/repository/ChocolateyInternal/index.json" -p="'originalPassword'"
  5. "Update" the password the same password, but noop (see "Would have made a change to the configuration."): choco source add --name="ChocolateyInternal" --source="https://2022bare.ch0.co:8443/repository/ChocolateyInternal/index.json" -p="'originalPassword'" --whatif
  6. Update the password to a new password, but noop (see "Would have made a change to the configuration."): choco source add --name="ChocolateyInternal" --source="https://2022bare.ch0.co:8443/repository/ChocolateyInternal/index.json" -p="'newPassword'" --whatif
  7. "Update" the password the same password, but noop and limit-output (see "Would have made a change to the configuration."): choco source add --name="ChocolateyInternal" --source="https://2022bare.ch0.co:8443/repository/ChocolateyInternal/index.json" -p="'originalPassword'" --whatif --limit-output

...etc.

System Details

  • Operating System: N/A
  • Windows PowerShell Version: N/A
  • Chocolatey CLI Version: 2.3.0
  • Chocolatey Licensed Extension version: 6.2.1
  • Chocolatey License type (Professional / Business / ?): Business
  • Terminal/Emulator: Windows Terminal

Installed Packages

N/A

Output Log

N/A

Workarounds

  1. Monitor the config file and see if it's changed (not appropriate if you don't want to modify if it doesn't need changing)
  2. Calculate expected value and compare it to the config file (not appropriate to distribute to customers?)

Proposed Solution

  1. Whatif/Noop should reflect the action (or inaction) of the operation

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions