Repository navigation
feat: add ConfigMap generation and apply Makefile targets (#6) - #13
Conversation
Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
…ent (#6, #11) Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Add configmap-gen target to generate Kubernetes ConfigMaps from agent config directories. The target creates two YAML files: - config.yaml: ConfigMap with agent config files (system-prompt.txt, agent-card.json, agent-config.yaml, prompts.json) - skills.yaml: ConfigMap with skill SKILL.md files Usage: make configmap-gen CONFIG_DIR=testdata/standalone make configmap-gen CONFIG_DIR=testdata/standalone NAME=my-agent Generated files are written to deploy/generated/<name>/ directory. Uses kubectl/oc --dry-run=client for offline generation. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
The configmap-apply target provides idempotent ConfigMap deployment directly to the cluster using the create --dry-run=client -o yaml | apply -f - pattern. This complements configmap-gen by allowing direct application without generating intermediate YAML files. Usage: make configmap-apply CONFIG_DIR=testdata/standalone Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR adds infrastructure for converting local agent configurations and skills directories into Kubernetes ConfigMaps via Makefile targets. It includes new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Makefile`:
- Around line 73-74: The SKILL_FILES key naming emits keys like
"$$skill_name.SKILL.md" which diverges from the documented
"<skill-name>/SKILL.md"; update the logic that builds SKILL_FILES (the lines
that append to SKILL_FILES using $$skill_name.SKILL.md and $$skill_dir/SKILL.md)
to instead produce keys in the "<skill-name>/SKILL.md" form (e.g.,
"$$skill_name/SKILL.md" or construct the key by joining $$skill_name and
"SKILL.md" with a slash) so generated filenames/paths match the docs and the
behavior is consistent across the occurrences (lines that reference SKILL_FILES
around the current code and the similar block at lines 108-109).
- Around line 68-82: The makefile currently builds SKILL_FILES but still calls
$(KUBECTL) create configmap $(NAME)-skills $$SKILL_FILES even when no SKILL.md
files were found; modify the target that handles CONFIG_DIR/skills so after the
loop you check whether SKILL_FILES is empty (test [ -z "$$SKILL_FILES" ]) and if
so echo a message like "No SKILL.md files found, skipping skills ConfigMap" and
skip the create configmap/invocation that writes $(OUTDIR)/skills.yaml,
otherwise proceed to call $(KUBECTL) create configmap ... >
$(OUTDIR)/skills.yaml; apply the same guard to the other skills block referenced
around lines 103-117.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b6f9927c-9ff5-488e-9df6-b1f75aacfbd8
📒 Files selected for processing (6)
.gitignoreMakefiledocs/dev/2026-04-10-cli-chat-client-design.mddocs/dev/2026-04-10-cli-chat-client-plan.mddocs/dev/2026-04-10-skill-to-configmap-design.mddocs/dev/2026-04-10-skill-to-configmap-plan.md
| SKILL_FILES="$$SKILL_FILES --from-file=$$skill_name.SKILL.md=$$skill_dir/SKILL.md"; \ | ||
| done; \ |
There was a problem hiding this comment.
Unify skills key naming with documented behavior.
Line 73 and Line 108 emit keys as $$skill_name.SKILL.md, while the design/plan docs in this PR describe <skill-name>/SKILL.md. This mismatch creates a user-facing contract drift (generated filenames/paths differ from docs). Align either implementation or docs to one format.
As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."
Also applies to: 108-109
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Makefile` around lines 73 - 74, The SKILL_FILES key naming emits keys like
"$$skill_name.SKILL.md" which diverges from the documented
"<skill-name>/SKILL.md"; update the logic that builds SKILL_FILES (the lines
that append to SKILL_FILES using $$skill_name.SKILL.md and $$skill_dir/SKILL.md)
to instead produce keys in the "<skill-name>/SKILL.md" form (e.g.,
"$$skill_name/SKILL.md" or construct the key by joining $$skill_name and
"SKILL.md" with a slash) so generated filenames/paths match the docs and the
behavior is consistent across the occurrences (lines that reference SKILL_FILES
around the current code and the similar block at lines 108-109).
Skip skills ConfigMap creation when skills/ directory exists but contains no SKILL.md files, preventing kubectl failure. Also update design doc to use dot separator in key naming (slashes are invalid in ConfigMap keys). Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
|
@coderabbitai ignore |
✅ Actions performedReviews paused. |
Summary
make configmap-gentarget to generate Kubernetes ConfigMap YAML files from an agent config directorymake configmap-applytarget to generate and apply ConfigMaps directly to a cluster (idempotent viacreate --dry-run=client | apply)deploy/generated/to.gitignoreTwo ConfigMaps are generated per agent config directory:
<name>-config— agent config files (system-prompt.txt, agent-card.json, agent-config.yaml, prompts.json)<name>-skills— all SKILL.md files (only if skills/ directory exists)Usage:
Closes #6
Test plan
make configmap-gen CONFIG_DIR=testdata/standalonegenerates config.yaml and skills.yamlmake configmap-gen CONFIG_DIR=testdata/standalone NAME=my-agentuses custom ConfigMap name prefixmake configmap-gen CONFIG_DIR=testdata/summarizer-hrskips skills ConfigMap (no skills/ dir)make configmap-gen CONFIG_DIR=testdata/nonexistentfails with clear errormake configmap-apply CONFIG_DIR=testdata/standalonedry-run parses correctlySummary by CodeRabbit
New Features
configmap-genandconfigmap-applyMake targets to generate and deploy Kubernetes ConfigMaps from agent configuration directories.docsclaw chatCLI subcommand for interactive terminal-based chat with agents.Chores
.gitignoreto exclude generated ConfigMap files.