feat: add workspace sources for seeding files from ConfigMaps and Git repos#222
feat: add workspace sources for seeding files from ConfigMaps and Git repos#222xcoulon wants to merge 2 commits into
Conversation
… repos Extend `WorkspaceSpec` with `inlineSources`, `configMapSources`, and `gitSources` to seed agent configuration files (SOUL.md, AGENTS.md, TOOLS.md, etc.) from inline content, ConfigMap keys, or Git repositories with HTTPS token auth for private repos. - Add `SeedMode` type (`overwrite`/`seedIfMissing`) with three-tier cascade: item → source → global default (`overwrite`) - Add `InlineSource`, `ConfigMapSource`, `ConfigMapRef`, `ConfigMapItem`, `GitSource`, `GitItem` API types to `api/v1alpha1/claw_types.go` - Deprecate `spec.workspace.files`; controller normalizes entries to `InlineSources` with `seedIfMissing` mode for backward compatibility - Add `validateAllWorkspacePaths()` to reject duplicate target paths across source types - Add `validateConfigMapSources()` to verify referenced ConfigMaps exist and contain specified keys - Generate a seeding manifest (`_seed_manifest.json`) describing all file sources, targets, and modes — consumed by `init-seed` container - Add `injectConfigMapSourceVolumes()` for ConfigMap volume mounting - Add `injectGitSyncInitContainer()` with `alpine/git` clone script, proxy routing, and HTTPS token injection via `secretKeyRef` - Add `injectSeedInitContainer()` with mode-aware copy logic - Refactor `merge.js` to remove file seeding (moved to `init-seed`); builtin files (AGENTS.md, SOUL.md, BOOTSTRAP.md) now flow through the seed manifest - Add `GIT_SYNC_IMAGE` env var to `cmd/main.go` and `config/manager/manager.yaml` - Extract `enrichWorkspaceSources()` to reduce cyclomatic complexity Assisted-by: Claude Opus 4.6 (1M context) Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Will it be possible to mark certain workspace files as "readOnly"? |
Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #222 +/- ##
==========================================
+ Coverage 78.54% 79.16% +0.61%
==========================================
Files 33 33
Lines 4382 4704 +322
==========================================
+ Hits 3442 3724 +282
- Misses 598 622 +24
- Partials 342 358 +16
🚀 New features to boost your workflow:
|
Extend
WorkspaceSpecwithinlineSources,configMapSources, andgitSourcesto seed agent configuration files (SOUL.md, AGENTS.md,TOOLS.md, etc.) from inline content, ConfigMap keys, or Git repositories
with HTTPS token auth for private repos.
SeedModetype (overwrite/seedIfMissing) with three-tiercascade: item → source → global default (
overwrite)InlineSource,ConfigMapSource,ConfigMapRef,ConfigMapItem,GitSource,GitItemAPI types toapi/v1alpha1/claw_types.gospec.workspace.files; controller normalizes entries toInlineSourceswithseedIfMissingmode for backward compatibilityvalidateAllWorkspacePaths()to reject duplicate target pathsacross source types
validateConfigMapSources()to verify referenced ConfigMaps existand contain specified keys
_seed_manifest.json) describing all filesources, targets, and modes — consumed by
init-seedcontainerinjectConfigMapSourceVolumes()for ConfigMap volume mountinginjectGitSyncInitContainer()withalpine/gitclone script,proxy routing, and HTTPS token injection via
secretKeyRefinjectSeedInitContainer()with mode-aware copy logicmerge.jsto remove file seeding (moved toinit-seed);builtin files (AGENTS.md, SOUL.md, BOOTSTRAP.md) now flow through the
seed manifest
GIT_SYNC_IMAGEenv var tocmd/main.goandconfig/manager/manager.yamlenrichWorkspaceSources()to reduce cyclomatic complexityAssisted-by: Claude Opus 4.6 (1M context)
Signed-off-by: Xavier Coulon xcoulon@redhat.com