woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.28k stars 369 forks source link

Cache forge api requests #1039

Open anbraten opened 2 years ago

anbraten commented 2 years ago

We currently query our forges quite often for some calls. Some of those calls could be cached:

lafriks commented 2 years ago

isn't permissions requested only on sync?

branch caching could be tricky as they could change quite often

anbraten commented 2 years ago

isn't permissions requested only on sync?

No we currently fetch it quite frequently at the moment #485. Some users are even running in rate-limits by this with Github. Only on sync (if you mean the sync repos button when adding new buttons) wouldn't be enough as you could add / remove users on your forge which should be represented in Woodpecker as well.

branch caching could be tricky as they could change quite often

I think this is the problem with this kind of caching in general. In addition to TOL there should probably be some way to clear the cache for a specific Woodpecker project when some action got triggered. For example on "project repair" in the settings.

lafriks commented 2 years ago

No we currently fetch it quite frequently at the moment #485. Some users are even running in rate-limits by this with Github. Only on sync (if you mean the sync repos button when adding new buttons) wouldn't be enough as you could add / remove users on your forge which should be represented in Woodpecker as well.

Yeah, than this should be cached

I think this is the problem with this kind of caching in general. In addition to TOL there should probably be some way to clear the cache for a specific Woodpecker project when some action got triggered. For example on "project repair" in the settings.

Branch cache could be updated/cleared when webhooks are received (branch pushed or deleted)