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

(#3396) Add specific version check on v3 searches #3567

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

AdmiringWorm
Copy link
Member

Description Of Changes

This updates the handling of searching for packages while at the same time specifying the version that is wanted of the packages.

This ensures that packages will be looked up to verify it has the version the user wants, before returning any results.

Motivation and Context

When a v3 only feed was being used, no package would be outputted to the console.

Testing

  1. Run the integration tests
  2. Copy the contents of the index.json file from one of your sources.
  3. Remove the entry in the file mentioning LegacyGallery.
  4. Upload the file to a remote location, and update your sources.
  5. Run choco search <PACKAGE_NAME> --version <PACKAGE_VERSION> (replace values with known values of a package and older version)
  6. Run the same command against your original feed that have a entry for LegacyGallery
  7. Compare the results and verify both feeds returned the same information (some metadata may be missing on v3 only feed).

Operating Systems Testing

  • Windows 10

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 #3396

@AdmiringWorm AdmiringWorm requested a review from corbob November 19, 2024 14:56
@gep13 gep13 changed the base branch from develop to hotfix/2.4.1 November 20, 2024 09:01
This updates the handling of searching for packages while at the same
time specifying the version that is wanted of the packages.

This ensures that packages will be looked up to verify it has the
version the user wants, before returning any results.
@gep13
Copy link
Member

gep13 commented Nov 20, 2024

@AdmiringWorm @corbob I have taken the liberty of rebasing this PR against the head of the hotfix/2.4.1 branch.

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
Copy link
Member

gep13 commented Nov 20, 2024

I have taken this for a spin (jumped on a quick call with @AdmiringWorm just to verify one aspect of it), and happy to say that this is working as expected!

I like what is happening here with the WireMock tests! At some point, we will want to bring some of these helper methods out to somewhere that we can use everywhere (perhaps via the creation of some extension methods) but for now, they are fine being isolated where they are.

Great work!

@gep13 gep13 merged commit a95a24b into chocolatey:hotfix/2.4.1 Nov 20, 2024
5 checks passed
@AdmiringWorm AdmiringWorm deleted the v3-only-fix branch January 7, 2025 11:49
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.

Searching for specific version on a NuGet v3 only feed returns no results
2 participants