Skip to content

Handle different output formats of "choco upgrade" command - #385

Open
fraenki wants to merge 2 commits into
puppetlabs:mainfrom
fraenki:fix_382
Open

Handle different output formats of "choco upgrade" command#385
fraenki wants to merge 2 commits into
puppetlabs:mainfrom
fraenki:fix_382

Conversation

@fraenki

@fraenki fraenki commented May 19, 2026

Copy link
Copy Markdown

Summary

The first commit fixes #382:

choco upgrade --noop <pkg> -r returns 3 pipe-delimited fields when no update is available (name|current|pinned) and 4 fields when one is (name|current|available|pinned). The provider's latest method always read values[2], so for up-to-date packages it returned the pinned flag ("false") as the version, causing spurious noop changes.

The second commit fixes #380:

Previously latest could return an empty string, nil, or a non-version string (e.g. the pinned flag bleeding into the version slot) when the source produced output that didn't match the documented machine-readable format. Puppet's package type then saw is != @latest, called provider.update, and ran choco again against the broken source.

Both fixes modify the same code, so in order to avoid conflicting PRs, I've added both fixes to this PR.

Additional Context

see #382 and #380

Related Issues (if any)

#382
#380

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@fraenki
fraenki requested a review from a team as a code owner May 19, 2026 13:38
@fraenki fraenki changed the title Handle both output formats of "choco upgrade" command Handle different output formats of "choco upgrade" command May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant