-
Notifications
You must be signed in to change notification settings - Fork 3
Activate data source synchronization #77
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
Conversation
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main stacklok/toolhive#77 +/- ##
==========================================
- Coverage 65.91% 59.34% -6.58%
==========================================
Files 35 44 +9
Lines 2224 2595 +371
==========================================
+ Hits 1466 1540 +74
- Misses 641 937 +296
- Partials 117 118 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR refactors the synchronization system to introduce a background sync coordinator that handles automatic registry synchronization. The key changes include:
- Removed controller-runtime return values and timing logic from sync manager in favor of coordinator-based scheduling
- Added new
pkg/sync/coordinatorpackage for background sync orchestration with ticker-based periodic syncs - Introduced file-based storage and status persistence to replace Kubernetes-specific storage
- Added file source handler for local filesystem data sources
- Updated Manager interface to remove
ctrl.Resultreturn and addmanualSyncRequestedparameter
Reviewed Changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/sync/manager.go | Simplified sync manager by removing requeue timing logic and controller-runtime dependencies |
| pkg/sync/mocks/mock_manager.go | Generated mock for updated Manager interface |
| pkg/sync/coordinator/*.go | New coordinator package for background sync scheduling and status management |
| pkg/sources/storage_manager.go | Implemented file-based storage manager replacing Kubernetes ConfigMap storage |
| pkg/sources/file.go | New file source handler for local filesystem data sources |
| pkg/config/config.go | Added file source configuration and validation |
| pkg/status/persistence.go | New status persistence layer for sync state tracking |
| cmd/thv-registry-api/app/serve.go | Refactored to use coordinator pattern with automatic sync |
| examples/*.yaml | Added comprehensive example configurations for all source types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@claude please review this |
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
jhrozek
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.
great work! The biggest concern is that with this amount of content we'll have no way of validating and keeping it up-to-date. Some suggestions sprinkled inline.
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
blkt
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.
I'm still going over the PR, here are a first batch of questions.
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
blkt
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.
LGTM, and big thanks for doing this.
One thing I ask of you is to please split these PRs into multiple ones in the future. For example, this one had the following areas of concern
- refactored application startup introducing
pkg/app - introduced persistence layer, which I believe @dmjb was working on as well
- introduced
pkg/sync, which is a big beast in and of itself
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Complete changes requested for stacklok/toolhive#42
./data/status.json)--configremainsAfter this we can start: