chore: install helm-schema plugin via nix#353
Conversation
The helm-values-schema-json plugin was managed by `helm plugin install` in the Justfile, which silently no-ops when already installed and never refreshes the binary. That left the on-disk binary drifting from the manifest version, eventually breaking `just pc` when the cobra-rewritten v2.x binary rejected the legacy `-input`/`-output` flags. Move the plugin into the dev shell via `wrapHelm` so its version is locked alongside everything else. Update the recipe to the cobra flag syntax (`--values`/`--output`) and bump nixpkgs to 25.11 (which forces go_1_26 since go_1_23 is EOL). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
WalkthroughThe Justfile removes the dedicated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Justfile`:
- Around line 16-17: The helm-schema justfile recipe uses a default path value
of '' which yields absolute paths like /values.yaml when invoked without args;
change the default for the parameter named path in the helm-schema recipe from
an empty string to '.' so the template invocations (helm schema --values
{{path}}/values.yaml --output {{path}}/values.schema.json) resolve to
project-relative ./values.yaml and ./values.schema.json instead of root-level
files.
🪄 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: ddf2ae2c-af07-4810-b28a-1f8e161d8a31
⛔ Files ignored due to path filters (1)
flake.lockis excluded by!**/*.lock,!**/*.lock
📒 Files selected for processing (2)
Justfileflake.nix
| helm-schema path='': | ||
| helm schema -input {{path}}/values.yaml -output {{path}}/values.schema.json | ||
| helm schema --values {{path}}/values.yaml --output {{path}}/values.schema.json |
There was a problem hiding this comment.
Default path='' can produce invalid absolute paths.
If called without args, Line 17 targets /values.yaml and /values.schema.json. Default to . to keep paths project-relative.
Suggested fix
-helm-schema path='':
- helm schema --values {{path}}/values.yaml --output {{path}}/values.schema.json
+helm-schema path='.':
+ helm schema --values {{path}}/values.yaml --output {{path}}/values.schema.json📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| helm-schema path='': | |
| helm schema -input {{path}}/values.yaml -output {{path}}/values.schema.json | |
| helm schema --values {{path}}/values.yaml --output {{path}}/values.schema.json | |
| helm-schema path='.': | |
| helm schema --values {{path}}/values.yaml --output {{path}}/values.schema.json |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Justfile` around lines 16 - 17, The helm-schema justfile recipe uses a
default path value of '' which yields absolute paths like /values.yaml when
invoked without args; change the default for the parameter named path in the
helm-schema recipe from an empty string to '.' so the template invocations (helm
schema --values {{path}}/values.yaml --output {{path}}/values.schema.json)
resolve to project-relative ./values.yaml and ./values.schema.json instead of
root-level files.
Summary
helm-values-schema-jsonplugin out ofhelm plugin installand into the dev shell viawrapHelmso its version is pinned inflake.lockalongside everything elsehelm-schemarecipe to use the v2.x cobra flag syntax (--values/--output); the legacy-input/-outputform was silently broken once the on-disk binary drifted past v2.00.2511.*) sokubernetes-helmPlugins.helm-schemais available, and bumpgoVersionto 26 (go 1.23 was removed as EOL in newer nixpkgs)Why
helm plugin install … --version vX.Y.Z || trueno-ops when the plugin is already installed, so the install hook never re-runs and the binary stays on whatever was last fetched. That's howjust pcended up calling a cobra-based v2 binary with v1 flags. Owning the plugin in nix removes that whole drift class.Test plan
nix develop --command helm plugin listshowsschema 2.3.0nix develop --command just helm-schema ./charts/regionssucceeds with new flagshelm schemaagainst all 9 charts — every one generates cleanly🤖 Generated with Claude Code