Add multi-repo config schema and source_repo metadata
For bd-307: Multi-repo hydration layer Changes: - Add MultiRepoConfig to internal/config - Add GetMultiRepoConfig() to retrieve repos.primary and repos.additional - Add source_repo field to Issue type to track ownership - Prepare for hydration logic that reads from N repos
This commit is contained in:
@@ -167,3 +167,36 @@ func AllSettings() map[string]interface{} {
|
||||
}
|
||||
return v.AllSettings()
|
||||
}
|
||||
|
||||
// GetStringSlice retrieves a string slice configuration value
|
||||
func GetStringSlice(key string) []string {
|
||||
if v == nil {
|
||||
return []string{}
|
||||
}
|
||||
return v.GetStringSlice(key)
|
||||
}
|
||||
|
||||
// MultiRepoConfig contains configuration for multi-repo support
|
||||
type MultiRepoConfig struct {
|
||||
Primary string // Primary repo path (where canonical issues live)
|
||||
Additional []string // Additional repos to hydrate from
|
||||
}
|
||||
|
||||
// GetMultiRepoConfig retrieves multi-repo configuration
|
||||
// Returns nil if multi-repo is not configured (single-repo mode)
|
||||
func GetMultiRepoConfig() *MultiRepoConfig {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Check if repos.primary is set (indicates multi-repo mode)
|
||||
primary := v.GetString("repos.primary")
|
||||
if primary == "" {
|
||||
return nil // Single-repo mode
|
||||
}
|
||||
|
||||
return &MultiRepoConfig{
|
||||
Primary: primary,
|
||||
Additional: v.GetStringSlice("repos.additional"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ type Issue struct {
|
||||
CompactedAt *time.Time `json:"compacted_at,omitempty"`
|
||||
CompactedAtCommit *string `json:"compacted_at_commit,omitempty"` // Git commit hash when compacted
|
||||
OriginalSize int `json:"original_size,omitempty"`
|
||||
SourceRepo string `json:"source_repo,omitempty"` // Which repo owns this issue (multi-repo support)
|
||||
Labels []string `json:"labels,omitempty"` // Populated only for export/import
|
||||
Dependencies []*Dependency `json:"dependencies,omitempty"` // Populated only for export/import
|
||||
Comments []*Comment `json:"comments,omitempty"` // Populated only for export/import
|
||||
|
||||
Reference in New Issue
Block a user