feat: add bundle subcommand to run the bundler on a schema file - #354
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #354 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 19 +1
Lines 2003 2059 +56
=========================================
+ Hits 2003 2059 +56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
applejag
left a comment
There was a problem hiding this comment.
I just started my vacation, so I can't help review this right now.
losisin
left a comment
There was a problem hiding this comment.
@somaz94 Nice work overall and this looks good to merge with one UX/documentation addition.
Since helm schema bundle doesn't call LoadConfig(), settings from .schema.yaml (and --config) are silently ignored today. That’s acceptable for this PR, but worth making explicit so users aren’t surprised, especially if they rely on .schema.yaml as the single source of truth for bundleRoot, indent, k8sSchemaVersion, etc...
Can you add a short notice block about this in the README.md? Optionally, add a one-line reminder on stderr when the bundle command runs would be appreciated but it's not a deal breaker.
Also noting for a follow-up: bundle-related flags are currently registered twice (root command + bundle subcommand). Works fine for now, but worth extracting a shared helper later to avoid drift. After we merge this, a follow up issue needs to be opened to address this.
3ca5571 to
69cbcc3
Compare
|
Thanks for the review @losisin! Addressed the feedback:
Re: the duplicated flag registration (root + bundle) — agreed it's worth a shared helper; happy to open a follow-up issue after this merges so we don't grow the diff here. |
Which problem does the PR fix?
Closes #266
What's in this PR?
Adds a
helm schema bundle SCHEMA_FILEsubcommand that runs only the bundler on an existing JSON schema file and prints the bundled result to stdout, without generating a new schema from values files:It reuses the existing
Bundle()logic, so it supports the same--bundle-root,--bundle-without-id,--k8s-schema-urland--k8s-schema-versionoptions, plus--indent.Checklist
newBundleCmd100%,BundleFile91.3% coverage)go test -short ./...,golangci-lint,gosec,go vetandgofmtall clean