feat: generalize flag sync to support model flags + generic flags#785
feat: generalize flag sync to support model flags + generic flags#785Gkrumbach07 merged 6 commits intomainfrom
Conversation
Extract FlagSpec type and SyncFlags function from the model-specific SyncModelFlags. Both model manifest (models.json) and a generic flags config (flags.json) produce []FlagSpec and feed into the same sync pipeline. Tags are per-flag — model flags get scope:workspace, generic flags get whatever they specify. Mount ConfigMaps as directories (not subPath) so kubelet auto-syncs changes without pod restarts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
… test assertions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude Code ReviewSummaryThis PR generalizes the Unleash flag sync pipeline by extracting The change is well-executed: clean abstraction, good test coverage, and proper log-injection sanitization at input boundaries. No security regressions found. Issues by SeverityBlocker IssuesNone. Critical IssuesNone. Major IssuesNone. Minor Issues1.
Per // Prevent log injection with newlines
name = strings.ReplaceAll(name, "\n", "")
name = strings.ReplaceAll(name, "\r", "")A future caller bypassing // SyncFlags ensures every FlagSpec has a corresponding Unleash feature flag.
// Callers MUST sanitize FlagSpec.Name, Description, and all Tag fields
// (strip \n and \r) before passing to prevent log injection.Or, more defensively, sanitize inside 2. Removed per-model exclusion logging reduces startup observability
The original log.Printf(" %s: default model, no flag needed", model.ID)
log.Printf(" %s: not available, skipping flag creation", model.ID)
Suggested: restore at least an aggregate count, or add per-model logging: log.Printf(" %s: skipped (default or unavailable)", model.ID)3.
The test doesn't Positive Highlights
Recommendations
🔍 View AI decision process (logs available for 90 days) 📋 View memory system files loaded (click to expand)What Amber Loaded for Code ReviewAmber automatically loaded these repository standards from the memory system:
Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines. |
Extract FlagSpec type and SyncFlags function from the model-specific SyncModelFlags. Both model manifest (models.json) and a generic flags config (flags.json) produce []FlagSpec and feed into the same sync pipeline. Tags are per-flag — model flags get scope:workspace, generic flags get whatever they specify.
Mount ConfigMaps as directories (not subPath) so kubelet auto-syncs changes without pod restarts.