open-sauced / pizza

This is an engine that sources git commits and turns them to insights
Apache License 2.0
31 stars 13 forks source link

Feature: Flag to consume yaml file at path to prevent eviction from cache of configured repos #26

Closed jpmcb closed 1 year ago

jpmcb commented 1 year ago

Type of feature

🍕 Feature

Current behavior

Currently, besides consistently sending requests, there's no way to prevent a repo from being evicted from the disk cache. But even then, a very hot cache could evict a repo from the disk even if it's being queried frequently.

There are a subset of repos (like kubernetes/kubernets, the open-sauced repos, etc.) that we probably don't want to evict from the cache regardless of its position.

Suggested solution

During server startup, there should be an optional flag that sets a path to a yaml file with a list of repos that should never be evicted from the cache, regardless of their position.

$ ./pizza-oven --config /var/config/pizza-oven-config.yaml
never-evict-repos:
- https://github.com/kubernetes/kubernetes
- https://github.com/open-sauced/pizza
- https://github.com/open-sauced/pizza-cli
- ...

In the future, this yamlfile could become a more general configuration file that users utilize over environment variables, but for now, this setup is fine.

Additional context

No response

Code of Conduct

Contributing Docs