nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: helm/helm
Pull request #30571 (2025-02-22 11:07:40)

feat: error out when post-renderer produces no output
**What this PR does / why we need it**:

When the templating post-renderer produces no output, something went wrong so we error out.

- Closes https://github.com/helm/helm/issues/13473

**If applicable**:
- [X] this PR contains unit tests
- [X] this PR has been tested for backwards compatibility (releases with 0 resources will fail now)



Patch:
diff --git a/pkg/postrender/exec.go b/pkg/postrender/exec.go
index 167e737d6..84357c656 100644
--- a/pkg/postrender/exec.go
+++ b/pkg/postrender/exec.go
@@ -64,6 +64,12 @@ func (p *execRender) Run(renderedManifests *bytes.Buffer) (*bytes.Buffer, error)
 		return nil, errors.Wrapf(err, "error while running command %s. error output:\n%s", p.binaryPath, stderr.String())
 	}
 
+	// If the binary returned almost nothing, it's likely that it didn't
+	// successfully render anything
+	if len(bytes.TrimSpace(postRendered.Bytes())) == 0 {
+		return nil, errors.Errorf("post-renderer %q produced empty output", p.binaryPath)
+	}
+
 	return postRendered, nil
 }
 


Test patch:
diff --git a/pkg/postrender/exec_test.go b/pkg/postrender/exec_test.go
index 19a6ec6c4..2b091cc12 100644
--- a/pkg/postrender/exec_test.go
+++ b/pkg/postrender/exec_test.go
@@ -121,6 +121,21 @@ func TestExecRun(t *testing.T) {
 	is.Contains(output.String(), "BARTEST")
 }
 
+func TestExecRunWithNoOutput(t *testing.T) {
+	if runtime.GOOS == "windows" {
+		// the actual Run test uses a basic sed example, so skip this test on windows
+		t.Skip("skipping on windows")
+	}
+	is := assert.New(t)
+	testpath := setupTestingScript(t)
+
+	renderer, err := NewExec(testpath)
+	require.NoError(t, err)
+
+	_, err = renderer.Run(bytes.NewBufferString(""))
+	is.Error(err)
+}
+
 func TestNewExecWithOneArgsRun(t *testing.T) {
 	if runtime.GOOS == "windows" {
 		// the actual Run test uses a basic sed example, so skip this test on windows
Repository: helm/helm
Pull request #30572 (2025-02-22 12:27:28)

fix: error when more than one post-renderer is specified
We now make sure the post-renderer flag can be passed at most once instead of silently taking the last one passed.

Example:

```bash
$ helm template test ...  --post-renderer=true --post-renderer=cat
Error: invalid argument "cat" for "--post-renderer" flag: cannot specify --post-renderer flag more than once
```

- Closes https://github.com/helm/helm/issues/13472
-----
- [X] this PR contains unit tests
- [X] this PR has been tested for backwards compatibility (runs which specify more than one `--post-renderer` now fail)



Patch:
diff --git a/cmd/helm/flags.go b/cmd/helm/flags.go
index 8d0f644d6..379b2140d 100644
--- a/cmd/helm/flags.go
+++ b/cmd/helm/flags.go
@@ -143,6 +143,9 @@ func (p *postRendererString) Set(val string) error {
 	if val == "" {
 		return nil
 	}
+	if p.options.binaryPath != "" {
+		return fmt.Errorf("cannot specify --post-renderer flag more than once")
+	}
 	p.options.binaryPath = val
 	pr, err := postrender.NewExec(p.options.binaryPath, p.options.args...)
 	if err != nil {


Test patch:
diff --git a/cmd/helm/flags_test.go b/cmd/helm/flags_test.go
index 3a9d7e6ef..e55c51ce4 100644
--- a/cmd/helm/flags_test.go
+++ b/cmd/helm/flags_test.go
@@ -20,6 +20,9 @@ import (
 	"fmt"
 	"testing"
 
+	"github.com/stretchr/testify/require"
+
+	"helm.sh/helm/v4/pkg/action"
 	chart "helm.sh/helm/v4/pkg/chart/v2"
 	"helm.sh/helm/v4/pkg/release"
 	helmtime "helm.sh/helm/v4/pkg/time"
@@ -93,3 +96,24 @@ func outputFlagCompletionTest(t *testing.T, cmdName string) {
 	}}
 	runTestCmd(t, tests)
 }
+
+func TestPostRendererFlagSetOnce(t *testing.T) {
+	cfg := action.Configuration{}
+	client := action.NewInstall(&cfg)
+	str := postRendererString{
+		options: &postRendererOptions{
+			renderer: &client.PostRenderer,
+		},
+	}
+	// Set the binary once
+	err := str.Set("echo")
+	require.NoError(t, err)
+
+	// Set the binary again to the same value is not ok
+	err = str.Set("echo")
+	require.Error(t, err)
+
+	// Set the binary again to a different value is not ok
+	err = str.Set("cat")
+	require.Error(t, err)
+}
Repository: helm/helm
Pull request #30775 (2025-04-18 22:47:51)

Bump toml
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. Make sure to read the Contributing Guide before submitting your PR: https://github.com/helm/helm/blob/main/CONTRIBUTING.md
2. If this PR closes another issue, add 'closes #<issue number>' somewhere in the PR summary. GitHub will automatically close that issue when this PR gets merged. Alternatively, adding 'refs #<issue number>' will not close the issue, but help provide the reviewer more context.-->

**What this PR does / why we need it**:

Looking at the [toml diff](https://github.com/BurntSushi/toml/compare/v1.4.0...v1.5.0). I think it's safe to change the test here.

Closes: https://github.com/helm/helm/pull/30683

cc @robertsirc 

**Special notes for your reviewer**:

**If applicable**:
- [ ] this PR contains user facing changes (the `docs needed` label should be applied if so)
- [ ] this PR contains unit tests
- [ ] this PR has been tested for backwards compatibility



Patch:
diff --git a/go.mod b/go.mod
index 01f6386ae..912d382bc 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.24.0
 
 require (
 	github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24
-	github.com/BurntSushi/toml v1.4.0
+	github.com/BurntSushi/toml v1.5.0
 	github.com/DATA-DOG/go-sqlmock v1.5.2
 	github.com/Masterminds/semver/v3 v3.3.0
 	github.com/Masterminds/sprig/v3 v3.3.0
diff --git a/go.sum b/go.sum
index f3c00f539..ea10b6adc 100644
--- a/go.sum
+++ b/go.sum
@@ -6,8 +6,8 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9
 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
 github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=
 github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
-github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
-github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
+github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
+github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
 github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
 github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
 github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=


Test patch:
diff --git a/pkg/engine/funcs_test.go b/pkg/engine/funcs_test.go
index a4f4d604f..a7e2506a3 100644
--- a/pkg/engine/funcs_test.go
+++ b/pkg/engine/funcs_test.go
@@ -63,7 +63,7 @@ keyInElement0 = "valueInElement0"
 keyInElement1 = "valueInElement1"`,
 	}, {
 		tpl:    `{{ fromToml . }}`,
-		expect: "map[Error:toml: line 0: unexpected EOF; expected key separator '=']",
+		expect: "map[Error:toml: line 1: unexpected EOF; expected key separator '=']",
 		vars:   "one",
 	}, {
 		tpl:    `{{ toJson . }}`,
Repository: helm/helm
Pull request #11119 (2022-07-06 20:35:29)

fix: use `go install` instead of `go get`
There were a few other locations where `go get` was being used, which was missed in #11110. This fixes the current issues in CI.


Patch:
diff --git a/Makefile b/Makefile
index 0a7b326a8..d42234a29 100644
--- a/Makefile
+++ b/Makefile
@@ -149,15 +149,15 @@ gen-test-golden: test-unit
 # ------------------------------------------------------------------------------
 #  dependencies
 
-# If go get is run from inside the project directory it will add the dependencies
-# to the go.mod file. To avoid that we change to a directory without a go.mod file
-# when downloading the following dependencies
+# If go install is run from inside the project directory it will add the
+# dependencies to the go.mod file. To avoid that we change to a directory
+# without a go.mod file when downloading the following dependencies
 
 $(GOX):
-	(cd /; GO111MODULE=on go get -u github.com/mitchellh/gox)
+	(cd /; GO111MODULE=on go install github.com/mitchellh/gox@latest)
 
 $(GOIMPORTS):
-	(cd /; GO111MODULE=on go get -u golang.org/x/tools/cmd/goimports)
+	(cd /; GO111MODULE=on go install golang.org/x/tools/cmd/goimports@latest)
 
 # ------------------------------------------------------------------------------
 #  release


Test patch:
diff --git a/pkg/engine/funcs_test.go b/pkg/engine/funcs_test.go
index 62c63ec2b..29bc121b5 100644
--- a/pkg/engine/funcs_test.go
+++ b/pkg/engine/funcs_test.go
@@ -117,9 +117,9 @@ func TestFuncs(t *testing.T) {
 // version of mergo (even accidentally) that causes a breaking change. See
 // sprig changelog and notes for more details.
 // Note, Go modules assume semver is never broken. So, there is no way to tell
-// the tooling to not update to a minor or patch version. `go get -u` could be
-// used to accidentally update mergo. This test and message should catch the
-// problem and explain why it's happening.
+// the tooling to not update to a minor or patch version. `go install` could
+// be used to accidentally update mergo. This test and message should catch
+// the problem and explain why it's happening.
 func TestMerge(t *testing.T) {
 	dict := map[string]interface{}{
 		"src2": map[string]interface{}{
Repository: helm/helm
Pull request #11214 (2022-08-09 06:16:05)

fix special string in the filename
Signed-off-by: d-d-up <qhr6113@163.com>

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. Make sure to read the Contributing Guide before submitting your PR: https://github.com/helm/helm/blob/main/CONTRIBUTING.md
2. If this PR closes another issue, add 'closes #<issue number>' somewhere in the PR summary. GitHub will automatically close that issue when this PR gets merged. Alternatively, adding 'refs #<issue number>' will not close the issue, but help provide the reviewer more context.-->

**What this PR does / why we need it**:
Fixes:issue https://github.com/helm/helm/issues/11196
**Special notes for your reviewer**:

**If applicable**:
- [ ] this PR contains documentation
- [ ] this PR contains unit tests
- [ ] this PR has been tested for backwards compatibility



Patch:
diff --git a/pkg/cli/values/options.go b/pkg/cli/values/options.go
index a28ffa99f..1329fa0fc 100644
--- a/pkg/cli/values/options.go
+++ b/pkg/cli/values/options.go
@@ -112,7 +112,10 @@ func readFile(filePath string, p getter.Providers) ([]byte, error) {
 	if strings.TrimSpace(filePath) == "-" {
 		return ioutil.ReadAll(os.Stdin)
 	}
-	u, _ := url.Parse(filePath)
+	u, err := url.Parse(filePath)
+	if err != nil {
+		return nil, err
+	}
 
 	// FIXME: maybe someone handle other protocols like ftp.
 	g, err := p.ByScheme(u.Scheme)


Test patch:
diff --git a/pkg/cli/values/options_test.go b/pkg/cli/values/options_test.go
index d988274bf..54124c0fa 100644
--- a/pkg/cli/values/options_test.go
+++ b/pkg/cli/values/options_test.go
@@ -19,6 +19,8 @@ package values
 import (
 	"reflect"
 	"testing"
+
+	"helm.sh/helm/v3/pkg/getter"
 )
 
 func TestMergeValues(t *testing.T) {
@@ -75,3 +77,12 @@ func TestMergeValues(t *testing.T) {
 		t.Errorf("Expected a map with different keys to merge properly with another map. Expected: %v, got %v", expectedMap, testMap)
 	}
 }
+
+func TestReadFile(t *testing.T) {
+	var p getter.Providers
+	filePath := "%a.txt"
+	_, err := readFile(filePath, p)
+	if err == nil {
+		t.Errorf("Expected error when has special strings")
+	}
+}
Repository: helm/helm
Pull request #11336 (2022-09-12 19:30:28)

bump version to v3.10.0


Patch:
diff --git a/internal/version/version.go b/internal/version/version.go
index 6919e29d8..bf2af39bb 100644
--- a/internal/version/version.go
+++ b/internal/version/version.go
@@ -29,7 +29,7 @@ var (
 	//
 	// Increment major number for new feature additions and behavioral changes.
 	// Increment minor number for bug fixes and performance enhancements.
-	version = "v3.9"
+	version = "v3.10"
 
 	// metadata is extra build time data
 	metadata = ""


Test patch:
diff --git a/cmd/helm/testdata/output/version-client-shorthand.txt b/cmd/helm/testdata/output/version-client-shorthand.txt
index fc4dde52b..9eb69189d 100644
--- a/cmd/helm/testdata/output/version-client-shorthand.txt
+++ b/cmd/helm/testdata/output/version-client-shorthand.txt
@@ -1,1 +1,1 @@
-version.BuildInfo{Version:"v3.9", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.10", GitCommit:"", GitTreeState:"", GoVersion:""}
diff --git a/cmd/helm/testdata/output/version-client.txt b/cmd/helm/testdata/output/version-client.txt
index fc4dde52b..9eb69189d 100644
--- a/cmd/helm/testdata/output/version-client.txt
+++ b/cmd/helm/testdata/output/version-client.txt
@@ -1,1 +1,1 @@
-version.BuildInfo{Version:"v3.9", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.10", GitCommit:"", GitTreeState:"", GoVersion:""}
diff --git a/cmd/helm/testdata/output/version-short.txt b/cmd/helm/testdata/output/version-short.txt
index c8fc73f81..1d17edb02 100644
--- a/cmd/helm/testdata/output/version-short.txt
+++ b/cmd/helm/testdata/output/version-short.txt
@@ -1,1 +1,1 @@
-v3.9
+v3.10
diff --git a/cmd/helm/testdata/output/version-template.txt b/cmd/helm/testdata/output/version-template.txt
index e5eba56dc..02ffe32fd 100644
--- a/cmd/helm/testdata/output/version-template.txt
+++ b/cmd/helm/testdata/output/version-template.txt
@@ -1,1 +1,1 @@
-Version: v3.9
\ No newline at end of file
+Version: v3.10
\ No newline at end of file
diff --git a/cmd/helm/testdata/output/version.txt b/cmd/helm/testdata/output/version.txt
index fc4dde52b..9eb69189d 100644
--- a/cmd/helm/testdata/output/version.txt
+++ b/cmd/helm/testdata/output/version.txt
@@ -1,1 +1,1 @@
-version.BuildInfo{Version:"v3.9", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.10", GitCommit:"", GitTreeState:"", GoVersion:""}
diff --git a/pkg/chartutil/capabilities_test.go b/pkg/chartutil/capabilities_test.go
index 2938f12e3..ffd8d76da 100644
--- a/pkg/chartutil/capabilities_test.go
+++ b/pkg/chartutil/capabilities_test.go
@@ -62,8 +62,8 @@ func TestDefaultCapabilities(t *testing.T) {
 func TestDefaultCapabilitiesHelmVersion(t *testing.T) {
 	hv := DefaultCapabilities.HelmVersion
 
-	if hv.Version != "v3.9" {
-		t.Errorf("Expected default HelmVersion to be v3.9, got %q", hv.Version)
+	if hv.Version != "v3.10" {
+		t.Errorf("Expected default HelmVersion to be v3.10, got %q", hv.Version)
 	}
 }
Repository: helm/helm
Pull request #11704 (2023-01-10 02:23:54)

bump version to v3.11.0


Patch:
diff --git a/internal/version/version.go b/internal/version/version.go
index bf2af39bb..3cfcfef92 100644
--- a/internal/version/version.go
+++ b/internal/version/version.go
@@ -29,7 +29,7 @@ var (
 	//
 	// Increment major number for new feature additions and behavioral changes.
 	// Increment minor number for bug fixes and performance enhancements.
-	version = "v3.10"
+	version = "v3.11"
 
 	// metadata is extra build time data
 	metadata = ""


Test patch:
diff --git a/cmd/helm/testdata/output/version-client-shorthand.txt b/cmd/helm/testdata/output/version-client-shorthand.txt
index 9eb69189d..a623a516f 100644
--- a/cmd/helm/testdata/output/version-client-shorthand.txt
+++ b/cmd/helm/testdata/output/version-client-shorthand.txt
@@ -1,1 +1,1 @@
-version.BuildInfo{Version:"v3.10", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.11", GitCommit:"", GitTreeState:"", GoVersion:""}
diff --git a/cmd/helm/testdata/output/version-client.txt b/cmd/helm/testdata/output/version-client.txt
index 9eb69189d..a623a516f 100644
--- a/cmd/helm/testdata/output/version-client.txt
+++ b/cmd/helm/testdata/output/version-client.txt
@@ -1,1 +1,1 @@
-version.BuildInfo{Version:"v3.10", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.11", GitCommit:"", GitTreeState:"", GoVersion:""}
diff --git a/cmd/helm/testdata/output/version-short.txt b/cmd/helm/testdata/output/version-short.txt
index 1d17edb02..7784d9743 100644
--- a/cmd/helm/testdata/output/version-short.txt
+++ b/cmd/helm/testdata/output/version-short.txt
@@ -1,1 +1,1 @@
-v3.10
+v3.11
diff --git a/cmd/helm/testdata/output/version-template.txt b/cmd/helm/testdata/output/version-template.txt
index 02ffe32fd..9c5308b73 100644
--- a/cmd/helm/testdata/output/version-template.txt
+++ b/cmd/helm/testdata/output/version-template.txt
@@ -1,1 +1,1 @@
-Version: v3.10
\ No newline at end of file
+Version: v3.11
\ No newline at end of file
diff --git a/cmd/helm/testdata/output/version.txt b/cmd/helm/testdata/output/version.txt
index 9eb69189d..a623a516f 100644
--- a/cmd/helm/testdata/output/version.txt
+++ b/cmd/helm/testdata/output/version.txt
@@ -1,1 +1,1 @@
-version.BuildInfo{Version:"v3.10", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.11", GitCommit:"", GitTreeState:"", GoVersion:""}
diff --git a/pkg/chartutil/capabilities_test.go b/pkg/chartutil/capabilities_test.go
index ffd8d76da..2704d34c1 100644
--- a/pkg/chartutil/capabilities_test.go
+++ b/pkg/chartutil/capabilities_test.go
@@ -62,8 +62,8 @@ func TestDefaultCapabilities(t *testing.T) {
 func TestDefaultCapabilitiesHelmVersion(t *testing.T) {
 	hv := DefaultCapabilities.HelmVersion
 
-	if hv.Version != "v3.10" {
-		t.Errorf("Expected default HelmVersion to be v3.10, got %q", hv.Version)
+	if hv.Version != "v3.11" {
+		t.Errorf("Expected default HelmVersion to be v3.11, got %q", hv.Version)
 	}
 }
Repository: Unleash/unleash-client-go
Pull request #102 (2022-03-10 21:16:18)

fix: empty userWithIdStrategy case
 I'm new to Unleash, so my apologies if this pull request turns out to be nonsensical.

`IsEnabled` returns true for an empty UserIdStrategy when `UserId` is missing from the context. The reason is that `strings.Split` for an empty string returns `[""]`, giving the `userId` comparison loop a chance to both run _and_ find a match.


Patch:
diff --git a/internal/strategies/user_with_id.go b/internal/strategies/user_with_id.go
index 564a55e..b0e76cf 100644
--- a/internal/strategies/user_with_id.go
+++ b/internal/strategies/user_with_id.go
@@ -23,7 +23,7 @@ func (s userWithIdStrategy) IsEnabled(params map[string]interface{}, ctx *contex
 	}
 
 	userIds, ok := value.(string)
-	if !ok {
+	if !ok || userIds == "" {
 		return false
 	}
 


Test patch:
diff --git a/internal/strategies/user_with_id_test.go b/internal/strategies/user_with_id_test.go
index 969d423..dc81d8a 100644
--- a/internal/strategies/user_with_id_test.go
+++ b/internal/strategies/user_with_id_test.go
@@ -55,4 +55,11 @@ func TestUserWithIdStrategy_IsEnabled(t *testing.T) {
 		}
 		assert.True(s.IsEnabled(params, ctx), "user-with-id-strategy should be enabled for userId in list")
 	})
+	t.Run("u=empty", func(t *testing.T) {
+		params := map[string]interface{}{
+			strategy.ParamUserIds: "",
+		}
+		ctx := &context.Context{}
+		assert.False(s.IsEnabled(params, ctx), "user-with-id-strategy should not be enabled for empty strategy")
+	})
 }