Repository navigation
Conversation
manusa
left a comment
There was a problem hiding this comment.
Pull Request Review: #369
Thanks for contributing helm get manifest, and sorry this sat so long without a review! The command is missing from helm-java today: GetCommand only offers values(). Other helm get subcommands came up in #322, and Helm.get(release).manifest() slots naturally next to values().
The Go side is right. It mirrors GetValues and does what the CLI's helm get manifest does (action.NewGet, an optional Version, then rel.Manifest). The branch is quite far behind main (78 commits), but it applies cleanly on top of current main, and with it the native library builds, go vet passes and the Java sources compile on Java 8. I couldn't exercise it against a cluster.
To get it merged:
1. Tests (required)
The PR adds no tests. The existing get values coverage gives you a template for both layers:
- Go: add envtest-based tests next to
TestGetValues*innative/internal/helm/envtest_test.go. Install a chart, callGetManifest, and assert that the output contains the renderedDeployment/Service. Also coverRevision,KubeConfigContents, and a non-existent release (expect anot founderror). - Java: add black-box tests through the public API in
HelmKubernetesTest, next to theHelm.get(...).values()tests. Cover the latest revision,withRevision,withNamespace,withKubeConfigContents, and the non-existent release case.
2. Project conventions
GetManifestOptions.javais missing the Apache 2.0 license header (make licenseadds it).- The new code uses 4-space indentation, while the rest of the codebase uses 2 spaces (
GetCommand.java,GetManifestOptions.java). The newmanifest()method is also indented one level deeper thanvalues(). - Please add your
@authortag to the Java files you touched (make check-authors). - The builder methods' Javadoc is missing
@param/@return, unlike the neighbouringGetValuesSubcommand. - The commit's author name and email are both
=. Could you amend it with your real name and email so the contribution is attributed to you?
3. Docs
The README has a "Get" section with "Get values". A short "Get manifest" entry would document the new API.
Nit
There is a doubled blank line after struct GetManifestOptions in native/main.go.
Once rebased with tests, this should be a nice small addition. Happy to take another look then.
| @@ -0,0 +1,27 @@ | |||
| package com.marcnuri.helm.jni; | |||
There was a problem hiding this comment.
This file needs the Apache 2.0 license header, like the other *Options.java files (make license adds it), plus an @author Javadoc tag. Indentation in this project is 2 spaces.
| * | ||
| * @return the GetManifestSubcommand subcommand. | ||
| */ | ||
| public GetManifestSubcommand manifest() { |
There was a problem hiding this comment.
Small style point: this method is indented one level deeper than values() above, and the class uses 4-space indentation where the rest of the codebase uses 2. Please also add @author to the class Javadoc.
| * Get the named release with revision. | ||
| * If not specified, the latest release is returned. | ||
| */ | ||
| public GetManifestSubcommand withRevision(int revision) { |
There was a problem hiding this comment.
Could these builder methods get @param / @return tags, like the ones in GetValuesSubcommand?
| KubeConfigContents string | ||
| } | ||
|
|
||
| func GetManifest(options *GetManifestOptions) (string, error) { |
There was a problem hiding this comment.
This matches what helm get manifest does in the CLI. Please add envtest coverage next to TestGetValues* in envtest_test.go: install, then GetManifest, asserting on the rendered resources, plus the revision, kube config contents and non-existent release cases. Add matching Java tests in HelmKubernetesTest, next to the Helm.get(...).values() ones.
| char* kubeConfigContents; | ||
| }; | ||
|
|
||
|
|
Add helm command