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

Provide option for Chocolatey CLI commands to skip cached query results #3193

Closed
4 tasks done
gep13 opened this issue Jun 5, 2023 · 3 comments · Fixed by #3212
Closed
4 tasks done

Provide option for Chocolatey CLI commands to skip cached query results #3193

gep13 opened this issue Jun 5, 2023 · 3 comments · Fixed by #3212
Assignees
Milestone

Comments

@gep13
Copy link
Member

gep13 commented Jun 5, 2023

Checklist

  • 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.

What You Are Seeing?

In Chocolatey CLI 2.0.0, we introduced the NuGet.Client libraries, which by default cache a number of HTTP queries, so that they can be re-used when required. This was further extended in the 2.1.0-alpha's of Chocolatey CLI, to address issues with performance problems. By introducing these caches, we need the ability to ignore the cached results for certain commands. This will mean that other cached queries will remain in tact, but the current process will skip the cache and always get fresh results. This should be implemented using a --ignore-http-cache option, which will be added to all commands, and set at a global level.

What is Expected?

There are times when we want to make sure that we get the most recent results to outgoing queries, rather than previously cached queries. At the same time, we don't want to clear all the cache, so rather skip the cache for the current process.

How Did You Get This To Happen?

There really aren't any steps to reproduce this problem, it is just a feature that needs to be implemented now that we are caching queries that are used within Chocolatey CLI.

System Details

  • Operating System: Windows 10
  • Windows PowerShell version: 5.1
  • Chocolatey CLI Version: 2.0.0
  • Chocolatey Licensed Extension version: N/A
  • Chocolatey License type: Open Source
  • Terminal/Emulator: Windows PowerShell

Installed Packages

N/A

Output Log

N/A

Additional Context

N/A

@gep13 gep13 added this to the 2.1.0 milestone Jun 5, 2023
@gep13
Copy link
Member Author

gep13 commented Jun 5, 2023

Does this also need to have a feature to always prevent usage of any cached results?

UPDATE:

For now, no, a feature is not required. Usage of the cached HTTP requests should be the default, and usage of either the cache remove or --ignore-http-cache option, will be the route to clear/ignore the cache. We don't see a need to always avoid the usage of the cached HTTP queries, but if there is a strong enough use-case, we can look to implement a feature in a later release.

@gep13
Copy link
Member Author

gep13 commented Jun 5, 2023

This is related to this issue.

@AdmiringWorm AdmiringWorm self-assigned this Jun 12, 2023
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 14, 2023
The changes here will add a global option that can be used
by the user to ignore any existing http cache that has been
created prior to the execution of the current command.

Using the option will still create a new cache for the running
execution and reuse that created cache in the current context,
and can be reused normally when not using the argument in the
future.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 14, 2023
The changes here will add a global option that can be used
by the user to ignore any existing http cache that has been
created prior to the execution of the current command.

Using the option will still create a new cache for the running
execution and reuse that created cache in the current context,
and can be reused normally when not using the argument in the
future.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 15, 2023
The changes here will add a global option that can be used
by the user to ignore any existing http cache that has been
created prior to the execution of the current command.

Using the option will still create a new cache for the running
execution and reuse that created cache in the current context,
and can be reused normally when not using the argument in the
future.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 15, 2023
The changes here will add a global option that can be used
by the user to ignore any existing http cache that has been
created prior to the execution of the current command.

Using the option will still create a new cache for the running
execution and reuse that created cache in the current context,
and can be reused normally when not using the argument in the
future.
gep13 pushed a commit to AdmiringWorm/choco that referenced this issue Jun 15, 2023
The changes here will add a global option that can be used
by the user to ignore any existing http cache that has been
created prior to the execution of the current command.

Using the option will still create a new cache for the running
execution and reuse that created cache in the current context,
and can be reused normally when not using the argument in the
future.
gep13 added a commit that referenced this issue Jun 15, 2023
…n-for-chocolatey

(#3193) Add ability to ignore current http cache
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.1.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