-
Notifications
You must be signed in to change notification settings - Fork 261
Refactor FBC caching #1051
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
Refactor FBC caching #1051
Conversation
4b7ab99 to
712627b
Compare
|
Updated coverage report is here: https://app.codecov.io/github/operator-framework/operator-registry/commit/712627b1d32deeeb29773629724dbb785321d68d Trying to track down what I did to make coverage go down... 🤔 |
712627b to
d957cbf
Compare
This commit improves maintainability and extensibility of the FBC caching used to serve the GRPC API. It: - introduces a new cache package and interface, which defines primitives for checking cache integrity, building the cache, and loading the cache. - moves the existing registry.Querier to an implementation of the cache interface, called cache.JSON This refactor also resolves two outstanding issues: 1. The current code contains a bug that causes panics when certain failures occur loading the cache. 2. The current code is hardcoded to always rebuild the cache if it is unreadable or its digest doesn't contain the expected value. This commit: 1. Refactors and removes the cases the led to the panic situation 2. Adds a new flag, --cache-enforce-integrity, that causes `opm serve` to exit with a failure if the cache is unreadable or its digest doesn't contain the expected value. This is useful in production contexts when one always expects the cache to be pre-populated correctly. Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
d957cbf to
174fad2
Compare
Codecov Report
@@ Coverage Diff @@
## master #1051 +/- ##
==========================================
- Coverage 52.06% 51.98% -0.08%
==========================================
Files 102 104 +2
Lines 9218 9216 -2
==========================================
- Hits 4799 4791 -8
- Misses 3505 3514 +9
+ Partials 914 911 -3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
everettraven
left a comment
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.
These changes look good and seem reasonable to me. I like the approach of making the cache an interface which will make it nice if we ever feel we need to extend to support different types of caches.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: everettraven, joelanford The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
This commit improves maintainability and extensibility of the FBC caching used to serve the GRPC API.
It:
This refactor also resolves two outstanding issues:
This commit:
opm serveto exit with a failure if the cache is unreadable or its digest doesn't contain the expected value. This is useful in production contexts when one always expects the cache to be pre-populated correctly.Closes #1049
Closes #1050
Signed-off-by: Joe Lanford joe.lanford@gmail.com
Reviewer Checklist
/docs