nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: helm/helm
Pull request #8738 (2020-09-16 02:01:18)

fix incorrect wildcard expand
Previously, when there is no *.{gz,zip} files under _dist, the wildcard
will be expanded to 2 strings '_dist/*.gz' and '_dist/*.zip'(see below).
helm$ make checksum
for f in _dist/*.{gz,zip} ; do \
	shasum -a 256 "${f}" | sed 's/_dist\///' > "${f}.sha256sum" ; \
	shasum -a 256 "${f}" | awk '{print $1}' > "${f}.sha256" ; \
done
shasum: _dist/*.gz:
shasum: _dist/*.gz:
shasum: _dist/*.zip:
shasum: _dist/*.zip:

Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.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/master/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**:

**Special notes for your reviewer**:

**If applicable**:
- [ ] this PR contains documentation
- [ ] this PR contains unit tests
- [ ] this PR has been tested for backwards compatibility


bacongobbler: Could you please clarify what circumstances would you end up with an empty directory without any files? What issue are you trying to fix here?
bacongobbler: For context, `make sign` is called after calling `make fetch-dist` or `make dist`, both of which populates the directory with tarballs.

Patch:
diff --git a/Makefile b/Makefile
index a9eac8033..79fc31976 100644
--- a/Makefile
+++ b/Makefile
@@ -165,7 +165,7 @@ fetch-dist:
 
 .PHONY: sign
 sign:
-	for f in _dist/*.{gz,zip,sha256,sha256sum} ; do \
+	for f in $$(ls _dist/*.{gz,zip,sha256,sha256sum} 2>/dev/null) ; do \
 		gpg --armor --detach-sign $${f} ; \
 	done
 
@@ -178,7 +178,7 @@ sign:
 # removed in Helm v4.
 .PHONY: checksum
 checksum:
-	for f in _dist/*.{gz,zip} ; do \
+	for f in $$(ls _dist/*.{gz,zip} 2>/dev/null) ; do \
 		shasum -a 256 "$${f}" | sed 's/_dist\///' > "$${f}.sha256sum" ; \
 		shasum -a 256 "$${f}" | awk '{print $$1}' > "$${f}.sha256" ; \
 	done
diff --git a/cmd/helm/flags.go b/cmd/helm/flags.go
index d1329c279..544fb7608 100644
--- a/cmd/helm/flags.go
+++ b/cmd/helm/flags.go
@@ -69,7 +69,7 @@ func bindOutputFlag(cmd *cobra.Command, varRef *output.Format) {
 				formatNames = append(formatNames, format)
 			}
 		}
-		return formatNames, cobra.ShellCompDirectiveNoFileComp
+		return formatNames, cobra.ShellCompDirectiveDefault
 	})
 
 	if err != nil {


Test patch:
diff --git a/cmd/helm/testdata/output/output-comp.txt b/cmd/helm/testdata/output/output-comp.txt
index e7799a56b..be574756b 100644
--- a/cmd/helm/testdata/output/output-comp.txt
+++ b/cmd/helm/testdata/output/output-comp.txt
@@ -1,5 +1,5 @@
 table
 json
 yaml
-:4
-Completion ended with directive: ShellCompDirectiveNoFileComp
+:0
+Completion ended with directive: ShellCompDirectiveDefault
Repository: helm/helm
Pull request #8853 (2020-10-06 08:52:22)

Correctly determine lockfile path in helm repo add
**What this PR does / why we need it**:
`helm repo add` automatically creates a lockfile based on the repository config file path by replacing the file extension with `.lock`.
When the given filepath for `--repository-config` did not include a file extension, a lockfile in a nonexistent directory
would have been created.
For Example `helm --repository-config /tmp/repo-config repo add ...` resulted in Helm trying to create `.lock/tmp/repo-config`.
This PR corrects this, so that the extension is appended in those cases.

**Special notes for your reviewer**:

**If applicable**:
- [ ] this PR contains documentation
- [x] this PR contains unit tests
- [ ] this PR has been tested for backwards compatibility



Patch:
diff --git a/cmd/helm/repo_add.go b/cmd/helm/repo_add.go
index f79c213c0..c56ed595a 100644
--- a/cmd/helm/repo_add.go
+++ b/cmd/helm/repo_add.go
@@ -95,7 +95,14 @@ func (o *repoAddOptions) run(out io.Writer) error {
 	}
 
 	// Acquire a file lock for process synchronization
-	fileLock := flock.New(strings.Replace(o.repoFile, filepath.Ext(o.repoFile), ".lock", 1))
+	repoFileExt := filepath.Ext(o.repoFile)
+	var lockPath string
+	if len(repoFileExt) > 0 && len(repoFileExt) < len(o.repoFile) {
+		lockPath = strings.Replace(o.repoFile, repoFileExt, ".lock", 1)
+	} else {
+		lockPath = o.repoFile + ".lock"
+	}
+	fileLock := flock.New(lockPath)
 	lockCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
 	defer cancel()
 	locked, err := fileLock.TryLockContext(lockCtx, time.Second)


Test patch:
diff --git a/cmd/helm/repo_add_test.go b/cmd/helm/repo_add_test.go
index f3bc54985..739173ee7 100644
--- a/cmd/helm/repo_add_test.go
+++ b/cmd/helm/repo_add_test.go
@@ -142,6 +142,18 @@ func TestRepoAddConcurrentDirNotExist(t *testing.T) {
 	repoAddConcurrent(t, testName, repoFile)
 }
 
+func TestRepoAddConcurrentNoFileExtension(t *testing.T) {
+	const testName = "test-name-3"
+	repoFile := filepath.Join(ensure.TempDir(t), "repositories")
+	repoAddConcurrent(t, testName, repoFile)
+}
+
+func TestRepoAddConcurrentHiddenFile(t *testing.T) {
+	const testName = "test-name-4"
+	repoFile := filepath.Join(ensure.TempDir(t), ".repositories")
+	repoAddConcurrent(t, testName, repoFile)
+}
+
 func repoAddConcurrent(t *testing.T, testName, repoFile string) {
 	ts, err := repotest.NewTempServerWithCleanup(t, "testdata/testserver/*.*")
 	if err != nil {
Repository: helm/helm
Pull request #8923 (2020-10-19 21:35:57)

bump version to v3.4.0
(cherry picked from commit 7090a89efc8a18f3d8178bf47d2462450349a004)


Patch:
diff --git a/internal/version/version.go b/internal/version/version.go
index 2941bb489..73c433f57 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.3"
+	version = "v3.4"
 
 	// 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 910493bc4..e37819483 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.3", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.4", GitCommit:"", GitTreeState:"", GoVersion:""}
diff --git a/cmd/helm/testdata/output/version-client.txt b/cmd/helm/testdata/output/version-client.txt
index 910493bc4..e37819483 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.3", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.4", GitCommit:"", GitTreeState:"", GoVersion:""}
diff --git a/cmd/helm/testdata/output/version-short.txt b/cmd/helm/testdata/output/version-short.txt
index a6c626024..794508350 100644
--- a/cmd/helm/testdata/output/version-short.txt
+++ b/cmd/helm/testdata/output/version-short.txt
@@ -1,1 +1,1 @@
-v3.3
+v3.4
diff --git a/cmd/helm/testdata/output/version-template.txt b/cmd/helm/testdata/output/version-template.txt
index 48c6d2b04..eefb1dfcb 100644
--- a/cmd/helm/testdata/output/version-template.txt
+++ b/cmd/helm/testdata/output/version-template.txt
@@ -1,1 +1,1 @@
-Version: v3.3
\ No newline at end of file
+Version: v3.4
\ No newline at end of file
diff --git a/cmd/helm/testdata/output/version.txt b/cmd/helm/testdata/output/version.txt
index 910493bc4..e37819483 100644
--- a/cmd/helm/testdata/output/version.txt
+++ b/cmd/helm/testdata/output/version.txt
@@ -1,1 +1,1 @@
-version.BuildInfo{Version:"v3.3", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.4", GitCommit:"", GitTreeState:"", GoVersion:""}
diff --git a/pkg/chartutil/capabilities_test.go b/pkg/chartutil/capabilities_test.go
index 66eeee755..4ba2f847f 100644
--- a/pkg/chartutil/capabilities_test.go
+++ b/pkg/chartutil/capabilities_test.go
@@ -62,7 +62,7 @@ func TestDefaultCapabilities(t *testing.T) {
 func TestDefaultCapabilitiesHelmVersion(t *testing.T) {
 	hv := DefaultCapabilities.HelmVersion
 
-	if hv.Version != "v3.3" {
-		t.Errorf("Expected default HelmVersion to be v3.3, got %q", hv.Version)
+	if hv.Version != "v3.4" {
+		t.Errorf("Expected default HelmVersion to be v3.4, got %q", hv.Version)
 	}
 }
Repository: helm/helm
Pull request #9084 (2020-12-01 16:55:41)

Fix helm create sample chart `appVersion:` with quotes
This PR updates `helm create` command for the sample chart and adds quotes to the version `appVersion: "1.16.0"`
As there are many docker tags which do not follow semver, so in YAML it is float, for example `appVersion: 14.0` it will the helm lint, adding quotes appVersion: "14.0" it makes the string and helm lint will not fail for the chart.

The conclusion is that not wrapping it in quotes can lead to issues in some cases. That by doing it by default it can help people avoid those.



Patch:
diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go
index 6cd0a00ea..b6dffb231 100644
--- a/pkg/chartutil/create.go
+++ b/pkg/chartutil/create.go
@@ -99,7 +99,8 @@ version: 0.1.0
 # This is the version number of the application being deployed. This version number should be
 # incremented each time you make changes to the application. Versions are not expected to
 # follow Semantic Versioning. They should reflect the version the application is using.
-appVersion: 1.16.0
+# It is recommended to use it with quotes.
+appVersion: "1.16.0"
 `
 
 const defaultValues = `# Default values for %s.


Test patch:
diff --git a/cmd/helm/testdata/testcharts/chart-with-only-crds/Chart.yaml b/cmd/helm/testdata/testcharts/chart-with-only-crds/Chart.yaml
index a8b4c2022..ec3497670 100644
--- a/cmd/helm/testdata/testcharts/chart-with-only-crds/Chart.yaml
+++ b/cmd/helm/testdata/testcharts/chart-with-only-crds/Chart.yaml
@@ -17,5 +17,5 @@ type: application
 version: 0.1.0
 
 # This is the version number of the application being deployed. This version number should be
-# incremented each time you make changes to the application.
-appVersion: 1.16.0
+# incremented each time you make changes to the application and it is recommended to use it with quotes.
+appVersion: "1.16.0"
diff --git a/pkg/lint/rules/testdata/multi-template-fail/Chart.yaml b/pkg/lint/rules/testdata/multi-template-fail/Chart.yaml
index f022d5ad9..b57427de9 100644
--- a/pkg/lint/rules/testdata/multi-template-fail/Chart.yaml
+++ b/pkg/lint/rules/testdata/multi-template-fail/Chart.yaml
@@ -17,5 +17,5 @@ type: application
 version: 0.1.0
 
 # This is the version number of the application being deployed. This version number should be
-# incremented each time you make changes to the application.
-appVersion: 1.16.0
+# incremented each time you make changes to the application and it is recommended to use it with quotes.
+appVersion: "1.16.0"
diff --git a/pkg/lint/rules/testdata/v3-fail/Chart.yaml b/pkg/lint/rules/testdata/v3-fail/Chart.yaml
index efbad1c86..7097e17d8 100644
--- a/pkg/lint/rules/testdata/v3-fail/Chart.yaml
+++ b/pkg/lint/rules/testdata/v3-fail/Chart.yaml
@@ -17,5 +17,5 @@ type: application
 version: 0.1.0
 
 # This is the version number of the application being deployed. This version number should be
-# incremented each time you make changes to the application.
-appVersion: 1.16.0
+# incremented each time you make changes to the application and it is recommended to use it with quotes.
+appVersion: "1.16.0"
Repository: helm/helm
Pull request #7553 (2020-02-07 18:36:53)

fix(version): bump version to v3.1
also fixes a small typo in the doc string.


Patch:
diff --git a/internal/version/version.go b/internal/version/version.go
index 22439d11b..fd0616920 100644
--- a/internal/version/version.go
+++ b/internal/version/version.go
@@ -23,14 +23,14 @@ import (
 )
 
 var (
-	// version is the current version of the Helm.
+	// version is the current version of Helm.
 	// Update this whenever making a new release.
 	// The version is of the format Major.Minor.Patch[-Prerelease][+BuildMetadata]
 	//
 	// Increment major number for new feature additions and behavioral changes.
 	// Increment minor number for bug fixes and performance enhancements.
 	// Increment patch number for critical fixes to existing releases.
-	version = "v3.0"
+	version = "v3.1"
 
 	// 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 4b493d31c..8f9ed6136 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.0", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.1", GitCommit:"", GitTreeState:"", GoVersion:""}
diff --git a/cmd/helm/testdata/output/version-client.txt b/cmd/helm/testdata/output/version-client.txt
index 4b493d31c..8f9ed6136 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.0", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.1", GitCommit:"", GitTreeState:"", GoVersion:""}
diff --git a/cmd/helm/testdata/output/version-short.txt b/cmd/helm/testdata/output/version-short.txt
index d9fb9c736..861668947 100644
--- a/cmd/helm/testdata/output/version-short.txt
+++ b/cmd/helm/testdata/output/version-short.txt
@@ -1,1 +1,1 @@
-v3.0
+v3.1
diff --git a/cmd/helm/testdata/output/version-template.txt b/cmd/helm/testdata/output/version-template.txt
index 776c1919b..e5a779bbf 100644
--- a/cmd/helm/testdata/output/version-template.txt
+++ b/cmd/helm/testdata/output/version-template.txt
@@ -1,1 +1,1 @@
-Version: v3.0
\ No newline at end of file
+Version: v3.1
\ No newline at end of file
diff --git a/cmd/helm/testdata/output/version.txt b/cmd/helm/testdata/output/version.txt
index 4b493d31c..8f9ed6136 100644
--- a/cmd/helm/testdata/output/version.txt
+++ b/cmd/helm/testdata/output/version.txt
@@ -1,1 +1,1 @@
-version.BuildInfo{Version:"v3.0", GitCommit:"", GitTreeState:"", GoVersion:""}
+version.BuildInfo{Version:"v3.1", GitCommit:"", GitTreeState:"", GoVersion:""}