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

Add command to allow purging of cached HTTP queries #3194

Closed
4 tasks done
gep13 opened this issue Jun 5, 2023 · 1 comment · Fixed by #3209
Closed
4 tasks done

Add command to allow purging of cached HTTP queries #3194

gep13 opened this issue Jun 5, 2023 · 1 comment · Fixed by #3209
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 be able to purge/clear these caches when required. This should be something like choco cache remove in order to be consistent with other Chocolatey CLI commands that already exist.

What is Expected?

In the NuGet.exe, there is a command to clear/purge these cached queries, so we need something similar within the Chocolatey CLI.

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

This is related to this issue.

@gep13 gep13 added this to the 2.1.0 milestone Jun 5, 2023
@AdmiringWorm AdmiringWorm self-assigned this Jun 8, 2023
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 9, 2023
The changes in this commit adds a new command to Chocolatey CLI
that allows the user to clear any cached queries that have been saved
on their system.
This will clear both system and user level caches when running as an
administrator, and user level caches when running in a non-elevated
context.

Additionally, the ability to only remove expired caches is added as well
as just listing how many items has been cached.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 12, 2023
The changes in this commit adds a new command to Chocolatey CLI
that allows the user to clear any cached queries that have been saved
on their system.
This will clear both system and user level caches when running as an
administrator, and user level caches when running in a non-elevated
context.

Additionally, the ability to only remove expired caches is added as well
as just listing how many items has been cached.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 15, 2023
The changes in this commit adds a new command to Chocolatey CLI
that allows the user to clear any cached queries that have been saved
on their system.
This will clear both system and user level caches when running as an
administrator, and user level caches when running in a non-elevated
context.

Additionally, the ability to only remove expired caches is added as well
as just listing how many items has been cached.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 15, 2023
The changes in this commit adds a new command to Chocolatey CLI
that allows the user to clear any cached queries that have been saved
on their system.
This will clear both system and user level caches when running as an
administrator, and user level caches when running in a non-elevated
context.

Additionally, the ability to only remove expired caches is added as well
as just listing how many items has been cached.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 16, 2023
The changes in this commit adds a new command to Chocolatey CLI
that allows the user to clear any cached queries that have been saved
on their system.
This will clear both system and user level caches when running as an
administrator, and user level caches when running in a non-elevated
context.

Additionally, the ability to only remove expired caches is added as well
as just listing how many items has been cached.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 16, 2023
The changes in this commit adds a new command to Chocolatey CLI
that allows the user to clear any cached queries that have been saved
on their system.
This will clear both system and user level caches when running as an
administrator, and user level caches when running in a non-elevated
context.

Additionally, the ability to only remove expired caches is added as well
as just listing how many items has been cached.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 19, 2023
The changes in this commit adds a new command to Chocolatey CLI
that allows the user to clear any cached queries that have been saved
on their system.
This will clear both system and user level caches when running as an
administrator, and user level caches when running in a non-elevated
context.

Additionally, the ability to only remove expired caches is added as well
as just listing how many items has been cached.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 19, 2023
The changes in this commit adds a new command to Chocolatey CLI
that allows the user to clear any cached queries that have been saved
on their system.
This will clear both system and user level caches when running as an
administrator, and user level caches when running in a non-elevated
context.

Additionally, the ability to only remove expired caches is added as well
as just listing how many items has been cached.
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 19, 2023
The changes in this commit adds a new command to Chocolatey CLI
that allows the user to clear any cached queries that have been saved
on their system.
This will clear both system and user level caches when running as an
administrator, and user level caches when running in a non-elevated
context.

Additionally, the ability to only remove expired caches is added as well
as just listing how many items has been cached.
gep13 pushed a commit to AdmiringWorm/choco that referenced this issue Jun 20, 2023
The changes in this commit adds a new command to Chocolatey CLI
that allows the user to clear any cached queries that have been saved
on their system.
This will clear both system and user level caches when running as an
administrator, and user level caches when running in a non-elevated
context.

Additionally, the ability to only remove expired caches is added as well
as just listing how many items has been cached.
@gep13 gep13 changed the title Add command to allow purging of cached queries Add command to allow purging of cached HTTP queries Jun 20, 2023
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Jun 20, 2023
The changes in this commit adds a new command to Chocolatey CLI
that allows the user to clear any cached queries that have been saved
on their system.
This will clear both system and user level caches when running as an
administrator, and user level caches when running in a non-elevated
context.

Additionally, the ability to only remove expired caches is added as well
as just listing how many items has been cached.
gep13 added a commit that referenced this issue Jun 20, 2023
@gep13 gep13 removed the 2 - Working label Jun 20, 2023
@gep13 gep13 added 4 - Done and removed 3 - Review labels Jun 20, 2023
gep13 added a commit that referenced this issue Jun 21, 2023
This was missed in the original work that was done, but it was caught
during end-to-end tests.

This commit adds the necessary logic to allow tab completion of the new
choco cache command, including sub-commands, as well as options.
gep13 added a commit that referenced this issue Jun 29, 2023
* release/2.1.0: (52 commits)
  (maint) If statement formatting change
  (#3224) Add Assembly Loaded configuration option
  (maint) Resave without BOM
  (#3224) Update version check tests
  (#3174) Store non-normalized package version
  (maint) Add required whitespace
  (#3225) Add Pester Tests to ensure environment
  (#3201 #3225) Re-instate setting of config values
  (maint) Remove env variable for release version
  (maint) Fix encoding of file
  (#3194) Add tab completion for cache command
  (#2854) Re-save file with UTF-8 with BOM
  (#3218) Update Tab Expansion to use Test-Path
  (#3218) Remove try catch block for tab completion
  (build) Use latest Chocolatey.Cake.Recipe package
  (#2854) Do Write-Error instead of Write-Warning
  (#2854) Pester tests to Get-ChocolateyConfigValue
  (maint) Resave Get-ChocolateyConfigValue as CRLF
  (#2854) Add helper to read config values
  (#3214) Add Pester tests to ensure cache cleared
  ...
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.1.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

gep13 added a commit that referenced this issue Jun 29, 2023
* master:
  (maint) If statement formatting change
  (#3224) Add Assembly Loaded configuration option
  (maint) Resave without BOM
  (#3224) Update version check tests
  (#3174) Store non-normalized package version
  (maint) Add required whitespace
  (#3225) Add Pester Tests to ensure environment
  (#3201 #3225) Re-instate setting of config values
  (maint) Remove env variable for release version
  (maint) Fix encoding of file
  (#3194) Add tab completion for cache command
  (#2854) Re-save file with UTF-8 with BOM
  (#3218) Update Tab Expansion to use Test-Path
  (#3218) Remove try catch block for tab completion
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