From 151575942d1282f83a245033904c203657b3ace2 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Mon, 25 Nov 2024 23:54:37 +0000 Subject: [PATCH 1/7] chore: bump Go to 1.23.3 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 5e11c55..1ae705a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/coder/envbox -go 1.22.4 +go 1.23.3 // There are a few minor changes we make to Tailscale that we're slowly upstreaming. Compare here: // https://github.com/tailscale/tailscale/compare/main...coder:tailscale:main From d3c9f39bdf4d1aae445c68f0b81b6dcd12aeb2ff Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Mon, 25 Nov 2024 23:59:06 +0000 Subject: [PATCH 2/7] update workflows --- .github/workflows/ci.yaml | 2 +- .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 27ea117..48e6980 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,7 +37,7 @@ jobs: # Install Go! - uses: actions/setup-go@v3 with: - go-version: "~1.22" + go-version: "~1.23" # Check for Go linting errors! - name: Lint Go diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index adb1d2e..20e051b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -57,7 +57,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: "~1.22" + go-version: "~1.23" - name: Go Cache Paths id: go-cache-paths From 5f3f705dff6a2ce4ce455cf50451095c9f4ae308 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 00:29:13 +0000 Subject: [PATCH 3/7] update golangci --- .github/workflows/ci.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 48e6980..30623b0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,9 +41,9 @@ jobs: # Check for Go linting errors! - name: Lint Go - uses: golangci/golangci-lint-action@v6.0.1 + uses: golangci/golangci-lint-action@v6.1.1 with: - version: v1.59.1 + version: v1.61.1 args: "--out-${NO_FUTURE}format colored-line-number" - name: Lint shell scripts @@ -98,7 +98,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: "~1.22" + go-version: "~1.23" # Sadly the new "set output" syntax (of writing env vars to # $GITHUB_OUTPUT) does not work on both powershell and bash so we use the @@ -136,7 +136,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: "~1.22" + go-version: "~1.23" # Sadly the new "set output" syntax (of writing env vars to # $GITHUB_OUTPUT) does not work on both powershell and bash so we use the @@ -170,7 +170,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: "~1.22" + go-version: "~1.23" - name: Go Cache Paths id: go-cache-paths @@ -223,7 +223,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 with: - go-version: "~1.22" + go-version: "~1.23" - name: Go Cache Paths id: go-cache-paths @@ -257,7 +257,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: "~1.22" + go-version: "~1.23" - name: build image run: make -j build/image/envbox From 52ba3d8271b4c375ec2db0497c3ccde5e61c47e7 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 00:39:27 +0000 Subject: [PATCH 4/7] wrong version --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 30623b0..d5d17b2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,7 +43,7 @@ jobs: - name: Lint Go uses: golangci/golangci-lint-action@v6.1.1 with: - version: v1.61.1 + version: v1.62.2 args: "--out-${NO_FUTURE}format colored-line-number" - name: Lint shell scripts From 925d772a4a816ee58517d787b0a1d5843c15a541 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 00:55:29 +0000 Subject: [PATCH 5/7] lint --- cli/cliflag/cliflag_test.go | 7 +++++++ dockerutil/network.go | 1 + xunix/device.go | 1 + 3 files changed, 9 insertions(+) diff --git a/cli/cliflag/cliflag_test.go b/cli/cliflag/cliflag_test.go index 042fd04..7e9d1cc 100644 --- a/cli/cliflag/cliflag_test.go +++ b/cli/cliflag/cliflag_test.go @@ -113,9 +113,11 @@ func TestCliflag(t *testing.T) { flagset, name, shorthand, env, usage := randomFlag() def, _ := cryptorand.Intn(10) + //nolint:gosec cliflag.Uint8VarP(flagset, &ptr, name, shorthand, env, uint8(def), usage) got, err := flagset.GetUint8(name) require.NoError(t, err) + //nolint:gosec require.Equal(t, uint8(def), got) require.Contains(t, flagset.FlagUsages(), usage) require.Contains(t, flagset.FlagUsages(), fmt.Sprintf("Consumes $%s", env)) @@ -125,12 +127,14 @@ func TestCliflag(t *testing.T) { var ptr uint8 flagset, name, shorthand, env, usage := randomFlag() envValue, _ := cryptorand.Intn(10) + //nolint:gosec t.Setenv(env, strconv.FormatUint(uint64(envValue), 10)) def, _ := cryptorand.Intn(10) cliflag.Uint8VarP(flagset, &ptr, name, shorthand, env, uint8(def), usage) got, err := flagset.GetUint8(name) require.NoError(t, err) + //nolint:gosec require.Equal(t, uint8(envValue), got) }) @@ -141,9 +145,11 @@ func TestCliflag(t *testing.T) { t.Setenv(env, envValue) def, _ := cryptorand.Intn(10) + //nolint:gosec cliflag.Uint8VarP(flagset, &ptr, name, shorthand, env, uint8(def), usage) got, err := flagset.GetUint8(name) require.NoError(t, err) + //nolint:gosec require.Equal(t, uint8(def), got) }) @@ -164,6 +170,7 @@ func TestCliflag(t *testing.T) { var ptr int flagset, name, shorthand, env, usage := randomFlag() envValue, _ := cryptorand.Intn(10) + //nolint:gosec t.Setenv(env, strconv.FormatUint(uint64(envValue), 10)) def, _ := cryptorand.Intn(10) diff --git a/dockerutil/network.go b/dockerutil/network.go index 7c613a9..158181c 100644 --- a/dockerutil/network.go +++ b/dockerutil/network.go @@ -36,6 +36,7 @@ func mustNextIPv4(ip net.IP, inc int) net.IP { v += uint32(ip4[1]) << 16 v += uint32(ip4[2]) << 8 v += uint32(ip4[3]) + //nolint:gosec v += uint32(inc) v3 := byte(v & 0xFF) v2 := byte((v >> 8) & 0xFF) diff --git a/xunix/device.go b/xunix/device.go index e7c3332..0392af0 100644 --- a/xunix/device.go +++ b/xunix/device.go @@ -109,6 +109,7 @@ func createDevice(ctx context.Context, conf deviceConfig) error { return xerrors.Errorf("ensure parent dir: %w", err) } + //nolint:gosec err = fs.Mknod(conf.path, conf.ftype|conf.mode, int(conf.dev)) if err != nil { return xerrors.Errorf("mknod %s c %d %d: %w", conf.path, conf.major, conf.minor, err) From b1db113c056a410fcb0c73e388f91e57b2eb02b6 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 00:57:56 +0000 Subject: [PATCH 6/7] missed one --- cli/cliflag/cliflag_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/cliflag/cliflag_test.go b/cli/cliflag/cliflag_test.go index 7e9d1cc..a37cda5 100644 --- a/cli/cliflag/cliflag_test.go +++ b/cli/cliflag/cliflag_test.go @@ -131,10 +131,10 @@ func TestCliflag(t *testing.T) { t.Setenv(env, strconv.FormatUint(uint64(envValue), 10)) def, _ := cryptorand.Intn(10) + //nolint:gosec cliflag.Uint8VarP(flagset, &ptr, name, shorthand, env, uint8(def), usage) got, err := flagset.GetUint8(name) require.NoError(t, err) - //nolint:gosec require.Equal(t, uint8(envValue), got) }) From 0e45f336deb45366b483e119cfbfca73ecf08829 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 26 Nov 2024 01:01:53 +0000 Subject: [PATCH 7/7] missed one --- cli/cliflag/cliflag_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/cliflag/cliflag_test.go b/cli/cliflag/cliflag_test.go index a37cda5..89ec8bb 100644 --- a/cli/cliflag/cliflag_test.go +++ b/cli/cliflag/cliflag_test.go @@ -135,6 +135,7 @@ func TestCliflag(t *testing.T) { cliflag.Uint8VarP(flagset, &ptr, name, shorthand, env, uint8(def), usage) got, err := flagset.GetUint8(name) require.NoError(t, err) + //nolint:gosec require.Equal(t, uint8(envValue), got) })