From 3cb29d3a56023cf694db957c402fcef0b9a3eb1f Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 19:18:55 +0000 Subject: [PATCH 1/5] chore: update gofumpt from v0.4.0 to v0.8.0 Co-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com> --- Makefile | 2 +- coderd/notifications/utils_test.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b6e69ac28f223..611c6544f0a18 100644 --- a/Makefile +++ b/Makefile @@ -462,7 +462,7 @@ fmt/go: # https://github.com/mvdan/gofumpt#visual-studio-code find . $(FIND_EXCLUSIONS) -type f -name '*.go' -print0 | \ xargs -0 grep --null -L "DO NOT EDIT" | \ - xargs -0 go run mvdan.cc/gofumpt@v0.4.0 -w -l + xargs -0 go run mvdan.cc/gofumpt@v0.8.0 -w -l .PHONY: fmt/go fmt/ts: site/node_modules/.installed diff --git a/coderd/notifications/utils_test.go b/coderd/notifications/utils_test.go index d27093fb63119..ce071cc6a0a53 100644 --- a/coderd/notifications/utils_test.go +++ b/coderd/notifications/utils_test.go @@ -94,7 +94,6 @@ func (i *dispatchInterceptor) Dispatcher(payload types.MessagePayload, title, bo } retryable, err = deliveryFn(ctx, msgID) - if err != nil { i.err.Add(1) i.lastErr.Store(err) From 543aa58f6721b817d7b12c0f5d5b1a281ce9f27b Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 20:58:17 +0000 Subject: [PATCH 2/5] chore: also update gofumpt in gen.sh to v0.8.0 --- agent/agentcontainers/dcspec/gen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/agentcontainers/dcspec/gen.sh b/agent/agentcontainers/dcspec/gen.sh index 276cb24cb4123..056fd218fd247 100755 --- a/agent/agentcontainers/dcspec/gen.sh +++ b/agent/agentcontainers/dcspec/gen.sh @@ -61,7 +61,7 @@ fi exec 3>&- # Format the generated code. -go run mvdan.cc/gofumpt@v0.4.0 -w -l "${TMPDIR}/${DEST_FILENAME}" +go run mvdan.cc/gofumpt@v0.8.0 -w -l "${TMPDIR}/${DEST_FILENAME}" # Add a header so that Go recognizes this as a generated file. if grep -q -- "\[-i extension\]" < <(sed -h 2>&1); then From e501497cdd639f61fa273180a76b6da69ff0cacf Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Fri, 27 Jun 2025 21:09:49 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=A7=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cli/configssh.go | 2 +- cli/configssh_test.go | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cli/configssh.go b/cli/configssh.go index c1be60b604a9e..b12b9d5c3d5cd 100644 --- a/cli/configssh.go +++ b/cli/configssh.go @@ -446,7 +446,7 @@ func (r *RootCmd) configSSH() *serpent.Command { if !bytes.Equal(configRaw, configModified) { sshDir := filepath.Dir(sshConfigFile) - if err := os.MkdirAll(sshDir, 0700); err != nil { + if err := os.MkdirAll(sshDir, 0o700); err != nil { return xerrors.Errorf("failed to create directory %q: %w", sshDir, err) } diff --git a/cli/configssh_test.go b/cli/configssh_test.go index 1ffe93a7b838c..7e42bfe81a799 100644 --- a/cli/configssh_test.go +++ b/cli/configssh_test.go @@ -204,10 +204,11 @@ func TestConfigSSH_MissingDirectory(t *testing.T) { _, err = os.Stat(sshConfigPath) require.NoError(t, err, "config file should exist") - // Check that the directory has proper permissions (0700) + // Check that the directory has proper permissions (rwx for owner, none for + // group and everyone) sshDirInfo, err := os.Stat(sshDir) require.NoError(t, err) - require.Equal(t, os.FileMode(0700), sshDirInfo.Mode().Perm(), "directory should have 0700 permissions") + require.Equal(t, os.FileMode(0o700), sshDirInfo.Mode().Perm(), "directory should have rwx------ permissions") } func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) { @@ -358,7 +359,8 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) { strings.Join([]string{ headerEnd, "", - }, "\n")}, + }, "\n"), + }, }, args: []string{"--ssh-option", "ForwardAgent=yes"}, matches: []match{ @@ -383,7 +385,8 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) { strings.Join([]string{ headerEnd, "", - }, "\n")}, + }, "\n"), + }, }, args: []string{"--ssh-option", "ForwardAgent=yes"}, matches: []match{ From 658ce7e819f57a2564dcf9411253265396319e50 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 3 Jul 2025 17:02:36 +0000 Subject: [PATCH 4/5] fix grep filter --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 611c6544f0a18..108622b368495 100644 --- a/Makefile +++ b/Makefile @@ -461,7 +461,7 @@ fmt/go: # VS Code users should check out # https://github.com/mvdan/gofumpt#visual-studio-code find . $(FIND_EXCLUSIONS) -type f -name '*.go' -print0 | \ - xargs -0 grep --null -L "DO NOT EDIT" | \ + xargs -0 grep -E --null -L '^// Code generated .* DO NOT EDIT\.$$' | \ xargs -0 go run mvdan.cc/gofumpt@v0.8.0 -w -l .PHONY: fmt/go From f66dae7e67dab3b1d5533bc969f9989a29d9e880 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 3 Jul 2025 17:14:20 +0000 Subject: [PATCH 5/5] fix weird merge issue --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2492bb1b563da..0ed464ba23a80 100644 --- a/Makefile +++ b/Makefile @@ -460,7 +460,7 @@ ifdef FILE # Format single file if [[ -f "$(FILE)" ]] && [[ "$(FILE)" == *.go ]] && ! grep -q "DO NOT EDIT" "$(FILE)"; then \ echo "$(GREEN)==>$(RESET) $(BOLD)fmt/go$(RESET) $(FILE)"; \ - go run mvdan.cc/gofumpt@v0.4.0 -w -l "$(FILE)"; \ + go run mvdan.cc/gofumpt@v0.8.0 -w -l "$(FILE)"; \ fi else go mod tidy @@ -470,6 +470,7 @@ else find . $(FIND_EXCLUSIONS) -type f -name '*.go' -print0 | \ xargs -0 grep -E --null -L '^// Code generated .* DO NOT EDIT\.$$' | \ xargs -0 go run mvdan.cc/gofumpt@v0.8.0 -w -l +endif .PHONY: fmt/go fmt/ts: site/node_modules/.installed