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

Improve package dependency lookup when an exact version is defined #3433

Closed
2 tasks done
AdmiringWorm opened this issue Apr 25, 2024 · 1 comment · Fixed by #3435
Closed
2 tasks done

Improve package dependency lookup when an exact version is defined #3433

AdmiringWorm opened this issue Apr 25, 2024 · 1 comment · Fixed by #3435
Assignees
Milestone

Comments

@AdmiringWorm
Copy link
Member

AdmiringWorm commented Apr 25, 2024

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my request.

Is Your Feature Request Related To A Problem? Please describe.

When a package has dependencies and we are installing these, the dependencies are looked up by querying all of the available versions for those dependencies.

This causes unnecessary length of time and issues in some cases.

An additional problem is that when the package being installed has a dependency on a package in the moderation queue or Chocolatey Community Repository, where the package attempted to be installed is approved/exempted, but the dependency has not been approved/exempted, the installation will fail because of this. Even when a specific version is attempted.

Describe The Solution. Why is it needed?

We should update the dependency lookup to be a bit smarter.

When a version range with an inclusive upper limit is specified, then attempt to look up this exact version first. This would cover both inclusive upper limits, and exact version ranges so we do not have to do additional larger queries.

If there is no upper limit then we should attempt to look up the absolute latest version of the package (stable or pre-release dependending on configuration).

When an exclusive upper limit is used, or if the previous two checks fails it should fall back to the grabbing all the available versions of the dependency.

Additional Context

N/A

Related Issues

No response

@AdmiringWorm AdmiringWorm added this to the 2.3.0 milestone Apr 25, 2024
@AdmiringWorm AdmiringWorm self-assigned this Apr 25, 2024
@AdmiringWorm AdmiringWorm changed the title Improve how dependencies are looked up when an exact version is defined Improve how dependencies are looked up when an exact version or version with upper limit is defined Apr 25, 2024
@AdmiringWorm AdmiringWorm changed the title Improve how dependencies are looked up when an exact version or version with upper limit is defined Improve how dependencies are looked up when an exact version is defined Apr 26, 2024
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Apr 29, 2024
This updates the dependency handling of packages to directly look up the
version when an exact version range is being used. This improves
packages that uses such queries, and allows less data being requested
from servers in the cases that we are able to do this determination.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Apr 29, 2024
This updates the configuration when we are attempting to resolve the
dependencies of a packages when the package requested is explicitly
specified as a pre-release version.

This allows dependencies that are pre-releases to also be resolved
during this cases.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Apr 29, 2024
This updates the dependency handling of packages to directly look up the
version when an exact version range is being used. This improves
packages that uses such queries, and allows less data being requested
from servers in the cases that we are able to do this determination.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Apr 29, 2024
This updates the configuration when we are attempting to resolve the
dependencies of a packages when the package requested is explicitly
specified as a pre-release version.

This allows dependencies that are pre-releases to also be resolved
during this cases.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Apr 29, 2024
This updates the dependency handling of packages to directly look up the
version when an exact version range is being used. This improves
packages that uses such queries, and allows less data being requested
from servers in the cases that we are able to do this determination.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Apr 29, 2024
This updates the configuration when we are attempting to resolve the
dependencies of a packages when the package requested is explicitly
specified as a pre-release version.

This allows dependencies that are pre-releases to also be resolved
during this cases.
gep13 pushed a commit to AdmiringWorm/choco that referenced this issue Apr 30, 2024
This updates the dependency handling of packages to directly look up the
version when an exact version range is being used. This improves
packages that uses such queries, and allows less data being requested
from servers in the cases that we are able to do this determination.
gep13 pushed a commit to AdmiringWorm/choco that referenced this issue Apr 30, 2024
This updates the configuration when we are attempting to resolve the
dependencies of a packages when the package requested is explicitly
specified as a pre-release version.

This allows dependencies that are pre-releases to also be resolved
during this cases.
gep13 pushed a commit to AdmiringWorm/choco that referenced this issue May 3, 2024
This updates the dependency handling of packages to directly look up the
version when an exact version range is being used. This improves
packages that uses such queries, and allows less data being requested
from servers in the cases that we are able to do this determination.
gep13 pushed a commit to AdmiringWorm/choco that referenced this issue May 3, 2024
This updates the configuration when we are attempting to resolve the
dependencies of a packages when the package requested is explicitly
specified as a pre-release version.

This allows dependencies that are pre-releases to also be resolved
during this cases.
gep13 pushed a commit to AdmiringWorm/choco that referenced this issue May 3, 2024
This updates the dependency handling of packages to directly look up the
version when an exact version range is being used. This improves
packages that uses such queries, and allows less data being requested
from servers in the cases that we are able to do this determination.
gep13 pushed a commit to AdmiringWorm/choco that referenced this issue May 3, 2024
This updates the configuration when we are attempting to resolve the
dependencies of a packages when the package requested is explicitly
specified as a pre-release version.

This allows dependencies that are pre-releases to also be resolved
during this cases.
gep13 added a commit that referenced this issue May 3, 2024
…ies-are-looked-up-when-an-exact-version-or-version-with-upper-limit-is-defined

(#3433) Optimize queries used when resolving dependencies of exact versions
@gep13 gep13 added 4 - Done and removed 3 - Review labels May 3, 2024
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue May 27, 2024
It was found later when including Chocolatey Licensed Extension that it
would fail to load due to the change to the base source cache context.

As such this commit updates the public API in this case to add the old
method as a deprecated overload.
gep13 pushed a commit to AdmiringWorm/choco that referenced this issue May 27, 2024
It was found later when including Chocolatey Licensed Extension that it
would fail to load due to the change to the base source cache context.

As such this commit updates the public API in this case to add the old
method as a deprecated overload.
gep13 added a commit that referenced this issue May 27, 2024
(#3433) Add overload for FindPackages method
@pauby pauby changed the title Improve how dependencies are looked up when an exact version is defined Improve dependency lookup when an exact version is defined May 28, 2024
@pauby pauby changed the title Improve dependency lookup when an exact version is defined Improve package dependency lookup when an exact version is defined May 28, 2024
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.3.0 🎉

The release is available on:

Your GitReleaseManager bot 📦 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants