From a51fee18d6b80f92cd8771bfaa41ad21bee022f1 Mon Sep 17 00:00:00 2001 From: William Bezuidenhout Date: Fri, 23 Jan 2026 10:09:05 +0200 Subject: [PATCH 1/5] upgrade go to 1.25.6 --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index a1f15d3c03..959b476244 100644 --- a/mise.toml +++ b/mise.toml @@ -1,4 +1,4 @@ [tools] -golang = "1.25.4" +golang = "1.25.6" shfmt = "3.8.0" shellcheck = "0.10.0" From cd4cbb38c9c4d3729ba1e57eba8565fe5302cdee Mon Sep 17 00:00:00 2001 From: William Bezuidenhout Date: Fri, 23 Jan 2026 10:24:47 +0200 Subject: [PATCH 2/5] Use sourcegraph/actions/go-setup for Go setup --- .github/workflows/go-ci.yml | 9 ++------- .github/workflows/go-lint.yml | 5 ++--- .github/workflows/goreleaser-check.yml | 5 ++--- .github/workflows/goreleaser.yml | 5 ++--- .github/workflows/scip.yml | 6 ++---- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/.github/workflows/go-ci.yml b/.github/workflows/go-ci.yml index 17e8ae6926..ba885f473f 100644 --- a/.github/workflows/go-ci.yml +++ b/.github/workflows/go-ci.yml @@ -21,15 +21,10 @@ jobs: run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT shell: bash - name: Set up Go - uses: actions/setup-go@v6 + uses: sourcegraph/actions/go-setup@main with: go-version: ${{ steps.mise.outputs.go-version }} - - name: (Windows) Enable pulling Go modules from private sourcegraph/sourcegraph - if: runner.os == 'Windows' - run: git config --global url."https://$env:PRIVATE_TOKEN@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" - - name: (Default) Enable pulling Go modules from private sourcegraph/sourcegraph - if: runner.os != 'Windows' - run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" + private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }} - run: | go test -race -v ./... go test -v ./... diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index d4a8ee3847..3f207b1d60 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -17,9 +17,8 @@ jobs: id: mise run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT - name: Set up Go - uses: actions/setup-go@v6 + uses: sourcegraph/actions/go-setup@main with: go-version: ${{ steps.mise.outputs.go-version }} - - name: Enable pulling Go modules from private sourcegraph/sourcegraph - run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" + private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }} - run: ./dev/go-lint.sh diff --git a/.github/workflows/goreleaser-check.yml b/.github/workflows/goreleaser-check.yml index 547e6a554c..ec07eab81c 100644 --- a/.github/workflows/goreleaser-check.yml +++ b/.github/workflows/goreleaser-check.yml @@ -20,11 +20,10 @@ jobs: id: mise run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT - name: Set up Go - uses: actions/setup-go@v6 + uses: sourcegraph/actions/go-setup@main with: go-version: ${{ steps.mise.outputs.go-version }} - - name: Enable pulling Go modules from private sourcegraph/sourcegraph - run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" + private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }} - name: Check GoReleaser config uses: goreleaser/goreleaser-action@v5 with: diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 8f305d36a7..3da3999ecd 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -182,11 +182,10 @@ jobs: id: mise run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT - name: Set up Go - uses: actions/setup-go@v6 + uses: sourcegraph/actions/go-setup@main with: go-version: ${{ steps.mise.outputs.go-version }} - - name: Enable pulling Go modules from private sourcegraph/sourcegraph - run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" + private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }} - run: go test ./... - run: go test -race -v ./... - run: echo "${DOCKER_PASSWORD}" | docker login -u=$DOCKER_USERNAME --password-stdin diff --git a/.github/workflows/scip.yml b/.github/workflows/scip.yml index b546ea8bfa..d877ad14d7 100644 --- a/.github/workflows/scip.yml +++ b/.github/workflows/scip.yml @@ -15,9 +15,10 @@ jobs: id: mise run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT - name: Set up Go - uses: actions/setup-go@v6 + uses: sourcegraph/actions/go-setup@main with: go-version: ${{ steps.mise.outputs.go-version }} + private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }} - name: Set directory to safe for git run: git config --global --add safe.directory $GITHUB_WORKSPACE @@ -25,9 +26,6 @@ jobs: - name: Build src-cli run: go build -o ./src-cli ./cmd/src - - name: Enable pulling Go modules from private sourcegraph/sourcegraph - run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" - - name: Generate SCIP data run: scip-go From 0b96097e11a56eb8d3fe8fdf90d02994971b144b Mon Sep 17 00:00:00 2001 From: William Bezuidenhout Date: Thu, 26 Feb 2026 10:08:56 +0200 Subject: [PATCH 3/5] remove use of private access token --- .github/workflows/go-ci.yml | 5 ----- .github/workflows/go-lint.yml | 4 ---- .github/workflows/goreleaser-check.yml | 5 ----- .github/workflows/goreleaser.yml | 5 ----- .github/workflows/scip.yml | 4 ---- 5 files changed, 23 deletions(-) diff --git a/.github/workflows/go-ci.yml b/.github/workflows/go-ci.yml index ba885f473f..5f7d9e63c8 100644 --- a/.github/workflows/go-ci.yml +++ b/.github/workflows/go-ci.yml @@ -3,10 +3,6 @@ name: Go CI on: workflow_dispatch: push: -env: - GOPRIVATE: "github.com/sourcegraph/*" - PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}" - jobs: go-test: strategy: @@ -24,7 +20,6 @@ jobs: uses: sourcegraph/actions/go-setup@main with: go-version: ${{ steps.mise.outputs.go-version }} - private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }} - run: | go test -race -v ./... go test -v ./... diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index 3f207b1d60..2a851b2a1b 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -3,9 +3,6 @@ name: Go Lint on: workflow_dispatch: push: -env: - GOPRIVATE: "github.com/sourcegraph/*" - PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}" jobs: go-lint: @@ -20,5 +17,4 @@ jobs: uses: sourcegraph/actions/go-setup@main with: go-version: ${{ steps.mise.outputs.go-version }} - private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }} - run: ./dev/go-lint.sh diff --git a/.github/workflows/goreleaser-check.yml b/.github/workflows/goreleaser-check.yml index ec07eab81c..780a6ba76b 100644 --- a/.github/workflows/goreleaser-check.yml +++ b/.github/workflows/goreleaser-check.yml @@ -3,10 +3,6 @@ name: GoReleaser check on: push: workflow_dispatch: -env: - GOPRIVATE: "github.com/sourcegraph/*" - PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}" - jobs: goreleaser: name: check @@ -23,7 +19,6 @@ jobs: uses: sourcegraph/actions/go-setup@main with: go-version: ${{ steps.mise.outputs.go-version }} - private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }} - name: Check GoReleaser config uses: goreleaser/goreleaser-action@v5 with: diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 3da3999ecd..e7231900b5 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -5,10 +5,6 @@ on: push: tags: - '*' -env: - GOPRIVATE: "github.com/sourcegraph/*" - PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}" - # There are two cases where this GitHub action will run: # # 1. We are releasing a new latest version for src-cli, as a major, minor, or patch @@ -185,7 +181,6 @@ jobs: uses: sourcegraph/actions/go-setup@main with: go-version: ${{ steps.mise.outputs.go-version }} - private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }} - run: go test ./... - run: go test -race -v ./... - run: echo "${DOCKER_PASSWORD}" | docker login -u=$DOCKER_USERNAME --password-stdin diff --git a/.github/workflows/scip.yml b/.github/workflows/scip.yml index d877ad14d7..91d467626a 100644 --- a/.github/workflows/scip.yml +++ b/.github/workflows/scip.yml @@ -2,9 +2,6 @@ name: SCIP on: workflow_dispatch: push: -env: - GOPRIVATE: "github.com/sourcegraph/*" - PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}" jobs: scip-go: runs-on: ubuntu-latest @@ -18,7 +15,6 @@ jobs: uses: sourcegraph/actions/go-setup@main with: go-version: ${{ steps.mise.outputs.go-version }} - private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }} - name: Set directory to safe for git run: git config --global --add safe.directory $GITHUB_WORKSPACE From a9ee6588e535d16794d19fac84e00d55343677fd Mon Sep 17 00:00:00 2001 From: William Bezuidenhout Date: Thu, 26 Feb 2026 10:28:27 +0200 Subject: [PATCH 4/5] bump golanci lint and fix issues --- dev/golangci-lint.sh | 2 +- internal/batches/executor/run_steps.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/golangci-lint.sh b/dev/golangci-lint.sh index dffeb31b2f..e7adad08b2 100755 --- a/dev/golangci-lint.sh +++ b/dev/golangci-lint.sh @@ -6,7 +6,7 @@ pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null mkdir -p dev/.bin -version="2.6.1" +version="2.10.1" suffix="${version}-$(go env GOOS)-$(go env GOARCH)" target="$PWD/dev/.bin/golangci-lint-${suffix}" url="https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${suffix}.tar.gz" diff --git a/internal/batches/executor/run_steps.go b/internal/batches/executor/run_steps.go index 92d1966dd7..97e952be71 100644 --- a/internal/batches/executor/run_steps.go +++ b/internal/batches/executor/run_steps.go @@ -660,7 +660,7 @@ func (e stepFailedErr) Error() string { return lines[0] + fmt.Sprintf("\n\t(... and %d more lines)", len(lines)-1) } - out.WriteString(fmt.Sprintf("run: %s\ncontainer: %s\n", fmtRun(e.Run), e.Container)) + fmt.Fprintf(&out, "run: %s\ncontainer: %s\n", fmtRun(e.Run), e.Container) printOutput := func(output string) { for line := range strings.SplitSeq(output, "\n") { @@ -682,9 +682,9 @@ func (e stepFailedErr) Error() string { } if e.ExitCode != -1 { - out.WriteString(fmt.Sprintf("\nCommand failed with exit code %d.", e.ExitCode)) + fmt.Fprintf(&out, "\nCommand failed with exit code %d.", e.ExitCode) } else { - out.WriteString(fmt.Sprintf("\nCommand failed: %s", e.Err)) + fmt.Fprintf(&out, "\nCommand failed: %s", e.Err) } return out.String() From 06724213c31ff1e86c9d369dc648ddf1232d734f Mon Sep 17 00:00:00 2001 From: William Bezuidenhout Date: Thu, 26 Feb 2026 10:28:35 +0200 Subject: [PATCH 5/5] set golang version to 1.26 --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index 959b476244..74bb884ee3 100644 --- a/mise.toml +++ b/mise.toml @@ -1,4 +1,4 @@ [tools] -golang = "1.25.6" +golang = "1.26.0" shfmt = "3.8.0" shellcheck = "0.10.0"