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

[CLI] Feature Request: cache for CLI #758

Open
pcorpet opened this issue Apr 21, 2019 · 3 comments
Open

[CLI] Feature Request: cache for CLI #758

pcorpet opened this issue Apr 21, 2019 · 3 comments

Comments

@pcorpet
Copy link

pcorpet commented Apr 21, 2019

Description of the problem, including code/CLI snippet

Feature/Improve suggestion: I use the gitlab cli extensively in my flow and would strongly benefit a cache feature. It would work like this:

gitlab --cache 600 project-member list --project-id 12345

See https://github.com/github/hub/blob/d0e9e009ffc537c656a6cb8ec5cc132be5e4b8df/github/http.go#L400 for inspiration (the --cache feature on the hub tool, equivalent for GitHub).

Expected Behavior

Running this command twice in less than 10 minutes (600 seconds) would only query GitLab API the first time and return the same result.

Actual Behavior

The second command is as long as the first one.

Specifications

  • python-gitlab version: 1.8.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): gitlab.com
@TigreModerata
Copy link
Contributor

Hi, I've given this a go (for personal learning more than anything), I could push a draft if that's ok?
I used cachetools (https://cachetools.readthedocs.io/en/latest/) which is probably not ideal (importing new stuff), dunno if it can be useful nonetheless.

@max-wittig
Copy link
Member

I'm not sure, if we really should blow up the CLI like that.

Maybe just write a Python script for your case.

@TigreModerata
Copy link
Contributor

Cool. I don't have a case either, I was just looking for stuff to try :)

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

No branches or pull requests

4 participants