Skip to content

feat: add syncset controller, feat: syncset readiness#3030

Merged
acpana merged 47 commits into
open-policy-agent:masterfrom
acpana:acpana/syncsets-rt-r
Nov 23, 2023
Merged

feat: add syncset controller, feat: syncset readiness#3030
acpana merged 47 commits into
open-policy-agent:masterfrom
acpana:acpana/syncsets-rt-r

Conversation

@acpana
Copy link
Copy Markdown
Contributor

@acpana acpana commented Oct 3, 2023

in support of the sync set proposal

  • Adds a syncset_controller and necessary changes for tracking readiness from syncsets and config resources
  • Introduces a reconciler for data expectations
  • Implements "TryCancel" for data expectations
  • Improves the CacheManager to distinguish the watch errors for the gvks it's given
  • Adds the SyncSet CRD to the manifest.

acpana added 4 commits October 3, 2023 20:21
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Copy link
Copy Markdown
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.

Added comments, have not reviewed tests.

Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/controller/config/config_controller.go Outdated
Comment thread pkg/controller/syncset/syncset_controller.go Outdated
Comment thread pkg/controller/syncset/syncset_controller.go Outdated
Comment thread pkg/controller/syncset/syncset_controller.go Outdated
Comment thread pkg/readiness/object_tracker.go Outdated
Comment thread pkg/readiness/object_tracker.go Outdated
Comment thread pkg/readiness/ready_tracker.go Outdated
Comment thread pkg/readiness/ready_tracker.go
Comment thread pkg/readiness/ready_tracker.go
acpana added 3 commits October 5, 2023 01:23
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
plus naming, style, etc

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 6, 2023

Codecov Report

❌ Patch coverage is 70.42254% with 126 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.78%. Comparing base (aed792f) to head (430deea).
⚠️ Report is 685 commits behind head on master.

Files with missing lines Patch % Lines
pkg/controller/syncset/syncset_controller.go 46.47% 31 Missing and 7 partials ⚠️
pkg/readiness/ready_tracker.go 74.46% 30 Missing and 6 partials ⚠️
pkg/cachemanager/cachemanager.go 76.62% 15 Missing and 3 partials ⚠️
pkg/readiness/pruner/pruner.go 65.51% 9 Missing and 1 partial ⚠️
pkg/cachemanager/aggregator/aggregator.go 50.00% 6 Missing and 1 partial ⚠️
pkg/watch/errorlist.go 81.57% 7 Missing ⚠️
pkg/watch/set.go 0.00% 5 Missing ⚠️
pkg/watch/manager.go 25.00% 2 Missing and 1 partial ⚠️
pkg/controller/config/config_controller.go 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3030      +/-   ##
==========================================
+ Coverage   53.21%   53.78%   +0.56%     
==========================================
  Files         134      136       +2     
  Lines       11917    12198     +281     
==========================================
+ Hits         6342     6561     +219     
- Misses       5080     5136      +56     
- Partials      495      501       +6     
Flag Coverage Δ
unittests 53.78% <70.42%> (+0.56%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@acpana acpana requested a review from maxsmythe October 6, 2023 18:08
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
acpana added 3 commits October 9, 2023 15:43
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
- rework interpretErr to return failing gvks
- implement TryCancel for trackerMap

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana marked this pull request as ready for review October 9, 2023 23:46
Copy link
Copy Markdown
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.

Getting closer!

Have not reviewed tests.

Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread main.go Outdated
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/controller/config/config_controller.go Outdated
Comment thread pkg/controller/syncset/syncset_controller.go Outdated
Comment thread pkg/controller/syncset/syncset_controller.go Outdated
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana requested a review from maxsmythe October 11, 2023 06:32
@ritazh ritazh added this to the v3.14.0 milestone Oct 11, 2023
@ritazh
Copy link
Copy Markdown
Member

ritazh commented Oct 11, 2023

@acpana can you please update #2393 to include what this PR covers and what still remains in order to close that issue out?

Comment thread pkg/readiness/pruner/pruner.go Outdated
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/readiness/ready_tracker.go
Comment thread pkg/readiness/ready_tracker.go Outdated
Comment thread pkg/readiness/tracker_map.go
Comment thread pkg/watch/errorlist.go Outdated
Comment thread test/testutils/controller.go Outdated
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Comment thread pkg/watch/errorlist.go Outdated
Comment thread pkg/watch/errorlist.go Outdated
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana requested a review from maxsmythe November 7, 2023 22:10
Comment thread pkg/cachemanager/cachemanager.go Outdated
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana requested a review from maxsmythe November 9, 2023 19:15
Comment thread pkg/cachemanager/cachemanager.go Outdated
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana requested a review from maxsmythe November 10, 2023 00:19
Copy link
Copy Markdown
Contributor

@julianKatz julianKatz left a comment

Choose a reason for hiding this comment

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

Great work!! Way to stick with it.

passing the baton to Max to close things out on Google approval

Comment thread pkg/cachemanager/aggregator/aggregator.go Outdated
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/cachemanager/cachemanager.go
Comment thread pkg/cachemanager/cachemanager_test.go
Comment thread pkg/controller/syncset/syncset_controller.go
Comment thread pkg/controller/syncset/syncset_controller_test.go Outdated
Comment thread pkg/controller/syncset/syncset_controller_test.go Outdated
Comment thread pkg/controller/syncset/syncset_controller_test.go Outdated
Comment thread pkg/watch/errorlist_test.go
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@anlandu
Copy link
Copy Markdown
Member

anlandu commented Nov 11, 2023

Looks great!!

Copy link
Copy Markdown
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.

Once the bug in cache manager is addressed and the aggregator test has assertions, LGTM

Comment thread pkg/cachemanager/aggregator/aggregator_test.go Outdated
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/readiness/pruner/pruner_test.go
Comment thread pkg/readiness/ready_tracker_unit_test.go Outdated
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana requested a review from maxsmythe November 16, 2023 00:01
Copy link
Copy Markdown
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.

Two minor fixes, then LGTM

Comment thread pkg/cachemanager/aggregator/aggregator_test.go
Comment thread pkg/cachemanager/cachemanager.go Outdated
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Copy link
Copy Markdown
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 acpana requested review from ritazh and sozercan November 17, 2023 00:30
Copy link
Copy Markdown
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

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

minor comments

Comment thread pkg/readiness/pruner/pruner.go
Comment thread pkg/cachemanager/cachemanager.go
Comment thread pkg/cachemanager/cachemanager.go
Comment thread pkg/cachemanager/cachemanager.go Outdated
Comment thread pkg/cachemanager/aggregator/aggregator.go Outdated
Comment thread pkg/readiness/ready_tracker.go
Comment thread pkg/readiness/ready_tracker.go Outdated
Comment thread pkg/readiness/ready_tracker.go Outdated
Comment thread pkg/readiness/ready_tracker.go Outdated
acpana and others added 3 commits November 22, 2023 11:59
Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
Signed-off-by: alex <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana requested a review from ritazh November 22, 2023 20:11
Copy link
Copy Markdown
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for getting this feature cross the finishing line! 🎉

@acpana acpana merged commit 6276cb2 into open-policy-agent:master Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants