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

win_chocolatey / win_chocolatey_facts - support choco cache #134

Open
2 tasks done
vexx32 opened this issue Jul 6, 2023 · 4 comments
Open
2 tasks done

win_chocolatey / win_chocolatey_facts - support choco cache #134

vexx32 opened this issue Jul 6, 2023 · 4 comments
Labels
0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue Improvement Issues that enhances existing functionality, or adds new features

Comments

@vexx32
Copy link
Member

vexx32 commented Jul 6, 2023

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.

Currently, there is no way to interact with the choco cache command that was introduced in Chocolatey CLI v2.1.0.

Describe The Solution. Why is it needed?

  • win_chocolatey
    • Support the --skip-http-cache global option
      • Add a skip_http_cache (or maybe skip_cache / ignore_cache) option
    • Support the choco cache remove command
      • Add an option purge_cache which defaults to none / nil and lets the user select all or expired
  • win_chocolatey_facts
    • Support using the choco cache list command and returning the cache information as part of the facts returned

Additional Context

The choco cache list command currently doesn't support --limit-output, so we will have a hard time making a lot of sense of the output until that is addressed:

Related Issues

No response

@vexx32 vexx32 added Improvement Issues that enhances existing functionality, or adds new features 0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue labels Jul 6, 2023
@pauby
Copy link
Member

pauby commented Jul 6, 2023

Do you need to make sense of the results? World checking the exit code not be enough to know if it succeeded or not.

What information would be needed and how would it be useful?

@vexx32
Copy link
Member Author

vexx32 commented Jul 6, 2023

For cache remove that's probably enough, but if folks want to do something with the results for cache list it'll be difficult if we can't expose the data in a way that you can do things with it from a playbook.

For example, if folks want to build in some logic that retries on a task failure if and only if there's cached data that might need to be removed or skipped before retrying, they'd probably need that information. Choco exposes the current cache locations and states in its output for choco cache list, so ideally we'd be able to surface the same info here in a way folks can interact with programmatically.

@Windos
Copy link
Member

Windos commented Jul 6, 2023

That output from choco cache list does look relatively static (i.e. the format is the same whether items are in the cache or not), so it should be possible to grab the relevant info out via regex and format it as a dictionary if we don't want to wait on --limit-output support.

Equally, the changes to win_chocolatey don't rely on the changes to win_chocolatey_facts so those can be done while waiting on chocolatey/choco#3254

@pauby
Copy link
Member

pauby commented Jul 7, 2023

The format is not guaranteed to stay the way it is, so I wouldn't rely on regex'ing the info.

The majority of the work here can be done without having --limit-output available. If that is something that should be kept, we should break that out into a separate issue and focus this one on providing cache commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue Improvement Issues that enhances existing functionality, or adds new features
Projects
None yet
Development

No branches or pull requests

3 participants