-
Notifications
You must be signed in to change notification settings - Fork 23
Add ability to remove keys by type or API call #85
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
base: dev
Are you sure you want to change the base?
Conversation
1a0d5d8
to
6db0282
Compare
6db0282
to
8363583
Compare
8363583
to
e940ac8
Compare
@LouisHaftmann @DrJume let me know if you think these features are viable or you would prefer seeing it differently. Thank you! |
e940ac8
to
922234e
Compare
Fixes falcondev-oss#79 Partially related to falcondev-oss#74 Signed-off-by: Oleksandr Porunov <[email protected]>
922234e
to
6840204
Compare
If enabled then any specifically structured keys will be automatically removed if there are more keys of such type than | ||
the amount specified via `MAX_STORED_KEYS_PER_TYPE`. | ||
Key type is defined by the following format: | ||
`{key_type}{TYPED_KEY_DELIMITER}{optional custom string}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of the optional custom string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably take the same params as the GET _apis/artifactcache/cache
route:
- keys
- optional version
I would also prefer a route name like /extra/caches/prune
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding more functions for the different methods of pruning caches, I would just add filter functionality to the existing pruneCaches
function. This file now also has many untyped functions which should be avoided.
If `ENABLE_TYPED_KEY_PREFIX_REMOVAL` is `true` then this is the maximum amount of the most recent keys to keep per key type. | ||
Any other older keys will be automatically removed. | ||
|
||
#### `TYPED_KEY_DELIMITER` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe cache keys cannot contain ,
so we could just use it as a delimiter
This PR adds keys eviction strategy by specified keys "type" (key prefix).
Additionally, this PR adds a custom endpoint which can be used to clear all keys associated with specific prefix (useful for PR closing events or other types of events which indicate that some keys won't be used anymore).
This functionality was tested manually on self-hosted GitHub runners.
Migration is not needed for these features to work.
See updated documentation for more information: docs/content/1.getting-started/1.index.md
Fixes #79
Partially related to #74