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

refactor: introduce CacheManager #2785

Merged
merged 24 commits into from
Jun 15, 2023

Conversation

acpana
Copy link
Contributor

@acpana acpana commented May 22, 2023

meta

  • in support of the sync set proposal
  • CacheManager (CM) will be built on to encapsulate the replay of the cache in upcoming PRs

Factors out data mgmt & replication from the sync_controller.

@acpana acpana requested review from julianKatz and maxsmythe May 22, 2023 18:00
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2023

Codecov Report

❗ No coverage uploaded for pull request base (master@2413cf8). Click here to learn what that means.
Patch coverage: 48.33% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #2785   +/-   ##
=========================================
  Coverage          ?   53.58%           
=========================================
  Files             ?      132           
  Lines             ?    11550           
  Branches          ?        0           
=========================================
  Hits              ?     6189           
  Misses            ?     4882           
  Partials          ?      479           
Flag Coverage Δ
unittests 53.58% <48.33%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/controller/constraint/constraint_controller.go 5.68% <ø> (ø)
...onstrainttemplate/constrainttemplate_controller.go 59.23% <ø> (ø)
pkg/controller/expansion/expansion_controller.go 52.29% <ø> (ø)
pkg/syncutil/opadataclient.go 0.00% <ø> (ø)
pkg/syncutil/stats_reporter.go 21.25% <5.08%> (ø)
pkg/syncutil/cachemanager/cachemanager.go 89.58% <89.58%> (ø)
pkg/controller/config/config_controller.go 63.51% <90.90%> (ø)
pkg/readiness/object_tracker.go 84.09% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@maxsmythe
Copy link
Contributor

maxsmythe commented May 23, 2023

The PR title should avoid using an abbreviation for a net-new concept (CMT) as it will make release notes harder to read

@acpana
Copy link
Contributor Author

acpana commented May 24, 2023

@anlandu fyi

@acpana acpana changed the title refactor: introduce cmt refactor: introduce CacheManager May 24, 2023
@acpana acpana requested a review from julianKatz May 24, 2023 18:23
acpana added 3 commits June 5, 2023 23:50
Signed-off-by: Alex Pana <[email protected]>
Signed-off-by: Alex Pana <[email protected]>
Signed-off-by: Alex Pana <[email protected]>
acpana added 2 commits June 6, 2023 13:04
removes todos

Signed-off-by: alex <[email protected]>
Signed-off-by: Alex Pana <[email protected]>
@@ -0,0 +1,138 @@
package cachemanager
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remember that config_controller_test, by definition, tests the sync controller, which will test that the CM handles the current uses cases as well.

So the new tests here are meant to only target the cachemanager in as much isolation as possible from controllers.

Another point to remember is that as we build the background replay process more into the cachemanager, the tests will change to cover the new functionality.

Signed-off-by: Alex Pana <[email protected]>
@acpana acpana requested a review from julianKatz June 6, 2023 22:57
@acpana acpana marked this pull request as ready for review June 6, 2023 23:35
@acpana acpana requested review from sozercan and ritazh June 6, 2023 23:35
@acpana
Copy link
Contributor Author

acpana commented Jun 6, 2023

@maxsmythe @ritazh @sozercan PTAL when y'all have some time! 🙏🏼

@julianKatz
Copy link
Contributor

@maxsmythe @ritazh @sozercan PTAL when y'all have some time! 🙏🏼

ping :)

@acpana acpana requested a review from maxsmythe June 9, 2023 22:06
Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@acpana
Copy link
Contributor Author

acpana commented Jun 12, 2023

@ritazh or @sozercan kindly let me know if y'all have any questions or concerns.

Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, thanks! LGTM

@sozercan sozercan merged commit 2835519 into open-policy-agent:master Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants