OCTO-918: dotted-path + JSON deep-merge --variable-override (v0.7.0) - #22
Conversation
Add VariableOverrideParser for legacy KEY:VALUE, dotted-path JSON-coerced overrides, and --variable-override-json; deep-merge overrides in Template. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Adds richer CLI variable override support so users can override nested variables via dotted paths and JSON, with deep-merge semantics applied at template initialization time.
Changes:
- Introduces
VariableOverrideParserto parse legacyKEY:VALUE, dotted-path overrides with JSON coercion, and repeatable--variable-override-json, deep-merging in CLI order. - Updates CLI to use the new parser, handle parse errors as exit(1), and echo the resolved override hash once to stdout.
- Updates
Template#initializeto deep-merge overrides into resolved variables; bumps docs and version to0.7.0.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/kubernetes_template_rendering/variable_override_parser_spec.rb | Adds unit coverage for legacy, dotted-path parsing/escaping, JSON coercion, and error cases. |
| spec/kubernetes_template_rendering/template_spec.rb | Verifies template variable resolution deep-merges nested overrides and keeps legacy collisions unchanged. |
| spec/kubernetes_template_rendering/cli_spec.rb | Adds CLI coverage for override parsing, precedence, stdout echo, and error exit paths. |
| lib/kubernetes_template_rendering/variable_override_parser.rb | New parser implementing dotted-path + JSON override deep-merge behavior. |
| lib/kubernetes_template_rendering/cli.rb | Wires new flags, centralizes parsing via parser, rescues parse errors to exit 1, echoes overrides. |
| lib/kubernetes_template_rendering/template.rb | Switches override application from merge to deep_merge. |
| lib/kubernetes_template_rendering/version.rb | Bumps gem version to 0.7.0. |
| README.md | Documents new override forms, escaping rules, precedence, and stdout echo behavior. |
| CHANGELOG.md | Adds 0.7.0 entry describing new override capabilities and deep-merge behavior. |
| Gemfile.lock | Updates locked gem version to 0.7.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
✅ No issues found
About Unblocked
Unblocked has been set up to automatically review your team's pull requests to identify genuine bugs and issues.
📖 Documentation — Learn more in our docs.
💬 Ask questions — Mention @unblocked to request a review or summary, or ask follow-up questions.
👍 Give feedback — React to comments with 👍 or 👎 to help us improve.
⚙️ Customize — Adjust settings in your preferences.
…cases Cross-model review pass: confirm JSON array coercion/wholesale-replace on deep_merge, trailing-backslash-vs-escaped-dot boundary handling, non-ASCII path segments/values, and empty-string values all behave per spec. All green — no defects found, added for regression coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
…ean AS requires Replace <merge date> with 2026-07-23; use JSON.generate for stdout echo; drop redundant require "active_support" where core_ext/deep_merge suffices. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
VariableOverrideParsersupporting legacyKEY:VALUE(unchanged), dotted-path overrides with JSON value coercion and\.escaping, and repeatable--variable-override-json.ParseError→ exit 1; changeTemplate#initializetodeep_mergeoverrides over resolved variables.Test plan
bundle exec rspec— 138 examples, 0 failuresrender_templateswithdeploySha:12345+components.webServer.hpa.minReplicas:2produces quoted string deploySha and integer minReplicas; stdout echo present; no# Variable overrides used:comment--variable-override-jsonexits 1 withnot valid JSONon STDERRbundle exec rake release(rubygems publish) — AC 10, not done in this PRTicket
https://invoca.atlassian.net/browse/OCTO-918
Made with Cursor