-
Notifications
You must be signed in to change notification settings - Fork 156
Registry filter #1905
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
Registry filter #1905
Conversation
- ConfigMap source handler - Basic unit tests Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
- Updated tests and implementation to replace hardcoded "registry.json" key with ConfigMapSourceDataKey constant. - Introduced ConfigMapStorageManager for managing registry data in ConfigMaps, including methods for storing, retrieving, and deleting data. - Added comprehensive unit tests for the new storage manager functionality. Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
- Updated test cases to replace hardcoded "registry.json" key with ConfigMapStorageDataKey constant. - Ensured consistency in data handling across storage manager methods. Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
- Updated ConfigMapSourceHandler to validate and parse registry data directly, removing legacy methods. - Enhanced test cases to utilize a new TestRegistryBuilder for generating test data, improving readability and maintainability. - Introduced new methods for handling registry data in a more structured way, including validation and conversion between formats. - Updated SyncResult to encapsulate parsed registry data instead of raw data, streamlining the sync process. Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
- Updated the storage manager implementation and tests to replace the hardcoded "registry-storage" component label with the new RegistryStorageComponent constant. - Improved consistency and maintainability in label handling across the storage manager. Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
- Introduced sync operation checks to determine if a sync is necessary before execution. - Enhanced the ConfigMapSourceHandler to fetch registry data and validate source configurations more effectively. - Improved test cases to reflect changes in method names and data handling. 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>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
- Implement name filtering with glob pattern matching using filepath.Match - Add tag filtering with exact string matching and precedence rules - Create FilterService coordinator applying both name and tag filters - Add comprehensive unit tests covering all filtering scenarios - Enhance filter interfaces to return detailed inclusion/exclusion reasons - Support include/exclude patterns with exclude taking precedence - Add package documentation explaining filtering architecture and usage Filtering system enables selective server inclusion from registry data based on name patterns and tags, with detailed logging for debugging. 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Daniele Martinoli <dmartino@redhat.com> Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
…cessing. Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
…idation and support for name and tag filtering scenarios. Added expectedServerCount field to test cases to verify correct server inclusion based on filtering rules. 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 #1905 +/- ##
==========================================
+ Coverage 46.22% 46.55% +0.33%
==========================================
Files 217 220 +3
Lines 26980 27201 +221
==========================================
+ Hits 12472 12664 +192
- Misses 13553 13583 +30
+ Partials 955 954 -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 implements a comprehensive registry filtering system for MCPRegistry resources that allows filtering MCP servers by name patterns (using glob matching) and tags (using exact string matching). The system enables precise control over which servers are included in specific registries.
Key changes:
- Added a complete filtering system with name and tag filtering capabilities
- Refactored the sync manager to incorporate filtering into the registry synchronization process
- Enhanced example configurations to demonstrate various filtering scenarios
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| examples/operator/mcp-registries/*.yaml | Updated example configurations to showcase different filtering scenarios including tag-based, name pattern, and combined filtering |
| cmd/thv-operator/pkg/sync/manager.go | Refactored sync manager to integrate filtering service and broke down sync process into smaller functions |
| cmd/thv-operator/pkg/sync/manager_test.go | Added comprehensive tests for filtering functionality and improved test coverage |
| cmd/thv-operator/pkg/filtering/*.go | New filtering package with name filter, tag filter, and filter service implementations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
just a single question but ready to be merged.
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Fixes #1824
doc.gofile:sync.managerpackage to break down the individual steps and avoid the cyclomatic complexity linting issue