Skip to content

chore: bump go directive and fix trivy CVEs in go.mod#108

Open
keegancsmith wants to merge 3 commits intomainfrom
egg-change/go-version-trivy-fixes
Open

chore: bump go directive and fix trivy CVEs in go.mod#108
keegancsmith wants to merge 3 commits intomainfrom
egg-change/go-version-trivy-fixes

Conversation

@keegancsmith
Copy link
Copy Markdown
Member

This PR was generated by Sourcegraph Batch Changes.

Changes

  • Bumps the go directive:
    • To go 1.25.9 for modules currently below 1.26
    • To go 1.26.2 for modules already on 1.26.x
  • Removes any toolchain directive (toolchain selection is handled automatically)
  • Runs go mod tidy to keep go.sum consistent with the new directive
  • Fixes all CVEs reported by trivy fs go.mod by upgrading specific transitive
    dependencies to their minimum safe versions

Why

Ensures a consistent, secure Go toolchain version across all first-party
github.com/sourcegraph/* modules that are depended on by sourcegraph/sourcegraph.

Hatched by a Sourcegraph egg.

Sourcegraph Egg and others added 3 commits April 29, 2026 08:35
The PR moved the module to Go 1.25.9, but the workflow was still booting Go 1.22.x. That left Actions auto-switching toolchains mid-job, rewrote go.mod/go.sum during tidy, and broke the test step before the branch could prove the dependency updates.

This aligns the workflow with the declared toolchain, commits the tidy output produced by Go 1.25.9, and migrates the golangci-lint config to the v2 schema so the workflow's latest linter still runs after the tidy step succeeds.

Test Plan:
- GOTOOLCHAIN=go1.25.9 go mod tidy
- GOTOOLCHAIN=go1.25.9 go test -shuffle=on -v -race -coverprofile=coverage -covermode=atomic -json ./... > test-report.json
- GOTOOLCHAIN=go1.25.9 golangci-lint run --timeout=30m

Amp-Thread-ID: https://ampcode.com/threads/T-019dd892-fa9b-741b-9d07-e0cca9f7a850
Co-authored-by: Amp <amp@ampcode.com>
The lint workflow was still invoking golangci-lint-action v3, which currently resolves to a v1.64 binary built with Go 1.24. Once the PR moved the module to Go 1.25.9, that linter could no longer even load the configuration, so the lint job failed after the module tidy step was fixed.

Switching the action to a v2-capable release and pinning a current v2 binary keeps linting on a toolchain new enough to understand the module version the PR now targets.

Test Plan:
- Inspect the failing GitHub Actions log for job 73551483658
- Confirm the failure is "the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.25.9)"
- Update the workflow to use golangci/golangci-lint-action@v9 with golangci-lint v2.11.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant