Skip to content

Conversation

@rdimitrov
Copy link
Member

The following PR adds the managed registry type as per the design doc for the configuration.
Details:

  • Includes the relevant Go objects
  • Updates the config validation
  • Adds appropriate unit tests for managed registries
  • Reflects that managed registries don't have sync support

rdimitrov and others added 2 commits November 24, 2025 16:55
Implements support for managed registries as per design doc Option 3
(explicit managed section).

Managed registries:
- Are directly managed via API (no external data source)
- Do not have sync loops (no automatic synchronization)
- Do not require syncPolicy or filter configuration
- Get initialized with "Complete" status instead of "Failed"
- Support the `managed: {}` configuration block

Implementation:
- Add SourceTypeManaged constant
- Add ManagedConfig type (empty struct, placeholder for future options)
- Update RegistryConfig to include Managed field
- Update validation to accept managed as fourth source type
- Update GetType() to return SourceTypeManaged when applicable
- Coordinator skips starting sync loops for managed registries
- Coordinator initializes managed registries with appropriate status

This aligns with the multi-registry architecture design document
and enables API-driven registry management for future extensions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds extensive test coverage for the managed registry type:

Config validation tests (internal/config/config_test.go):
- Valid managed registry without syncPolicy
- Valid managed registry with ignored syncPolicy
- Valid managed registry with ignored filter
- Error cases for specifying managed with other source types
- Mixed configurations with both managed and synced registries
- Updated GetType() test to include managed type
- Updated error messages to include "managed" in source type lists

Coordinator tests (internal/sync/coordinator/coordinator_test.go):
- Status initialization for managed registries (Complete vs Failed)
- Mixed configurations with both managed and synced registries
- Verification that managed registries get proper status messages

All tests pass and verify that managed registries:
- Don't require syncPolicy or filter fields
- Initialize with SyncPhaseComplete status
- Display appropriate message: "Managed registry (data managed via API)"
- Can coexist with file/git/api synced registries

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 62.85714% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.05%. Comparing base (6ee7090) to head (e0ff283).

Files with missing lines Patch % Lines
internal/sync/coordinator/coordinator.go 48.00% 11 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #176      +/-   ##
==========================================
+ Coverage   67.59%   68.05%   +0.46%     
==========================================
  Files          54       54              
  Lines        3240     3262      +22     
==========================================
+ Hits         2190     2220      +30     
+ Misses        907      899       -8     
  Partials      143      143              

☔ 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.

Copy link
Collaborator

@dmartinol dmartinol left a comment

Choose a reason for hiding this comment

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

just a doubt about the validation logic

@rdimitrov rdimitrov merged commit 9aef900 into main Nov 24, 2025
13 checks passed
@rdimitrov rdimitrov deleted the add-managed branch November 24, 2025 17:30
@dmartinol
Copy link
Collaborator

post-merge comment: maybe we could add one sample manifest under examples/?

@dmartinol dmartinol mentioned this pull request Nov 25, 2025
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.

4 participants