Skip to content

ci: run Go build and lint outside Nix - #5072

Merged
turip merged 2 commits into
mainfrom
feat/ci-upstream-go-split-lint
Sep 3, 2026
Merged

turip merged 2 commits into
mainfrom
feat/ci-upstream-go-split-lint

Conversation

@turip

@turip turip commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • run Go build and Go lint with upstream Go instead of entering Nix
  • persist the Nix-selected Go and GolangCI-Lint versions in .go-version and .golangci.version
  • run the complete lint-go pass once
  • move Nix, API specification, OpenAPI, Helm, and commit checks into a separate lint job

Benchmark

Final configuration, two CI samples on the same commit:

Measurement Sample 1 Sample 2 Midpoint
Build command 1:30 1:37 1:34
Build job 2:24 2:18 2:21
make lint-go 2:34 2:16 2:25
Go lint job 3:26 2:58 3:12
Other lint job 2:41 2:53 2:47

Compared with the earlier three-sample medians:

Variant Build command Go lint command Build job Combined lint job
Final split jobs 1:34 2:25 2:21 3:12 Go / 2:47 other
Upstream Go + Depot, unsplit 1:24 2:25 3:36 6:00
Nix + Depot cache 2:44 2:43 4:07 5:11
Nix without shared Go cache 4:12 3:29 5:48 5:49

The final Go command timings match the upstream benchmark within run variance. Removing Nix setup and serial non-Go checks reduced the complete Build job by about 35% and the Go lint job by about 47% versus the earlier unsplit upstream variant.

This PR changes flake.nix, so each PR attempt intentionally rebuilt and published an immutable Nix cache before Lint / Other. Build and Go lint do not depend on that gate and completed several minutes earlier. Once the new flake is on main, unchanged PRs can select the shared main Nix cache.

The Go build uses confluent-kafka-go's embedded librdkafka. Depot's runner-provided Go cache remains enabled and is verified without overriding executor cache paths.

No Jira ticket; this is CI optimization work following the benchmark.

Validation

  • GitHub Actions Build passed in both final samples
  • GitHub Actions Lint / Go passed in both final samples
  • GitHub Actions Lint / Other passed in both final samples
  • Generated version files match the Nix-selected versions

Greptile Summary

The PR moves Go compilation and linting out of the Nix environment while retaining Nix-dependent validation in a separate job.

  • Adds committed Go and GolangCI-Lint version files generated from the Nix-selected tools.
  • Splits Go linting from Nix, API specification, OpenAPI, Helm, and commit checks.
  • Allows build and Go lint jobs to run independently of the Nix cache rebuild.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
.github/workflows/ci.yaml Splits lint responsibilities, provisions upstream Go and GolangCI-Lint directly, and moves Nix-dependent checks into the gated lint job.
flake.nix Extends the shell hook to synchronize committed Go and GolangCI-Lint version files with Nix.
.go-version Pins the upstream Go version used by CI.
.golangci.version Pins the GolangCI-Lint release installed by the Go lint job.

Reviews (3): Last reviewed commit: "ci: run only the complete go lint pass" | Re-trigger Greptile

Summary by CodeRabbit

  • Chores

    • Standardized the Go and golangci-lint tool versions used by development and automated checks.
    • Updated the development environment to keep tool version files synchronized automatically.
  • Refactor

    • Improved build and lint workflows by separating Go checks from other validations.
    • Streamlined automated builds and added verification for tool versions and configuration validity.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 4bc77dc7-2edb-4a87-a96e-ba112de8a872

📥 Commits

Reviewing files that changed from the base of the PR and between 8347ece and 1da022a.

📒 Files selected for processing (4)
  • .github/workflows/ci.yaml
  • .go-version
  • .golangci.version
  • flake.nix

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The CI workflow now pins Go and golangci-lint versions, runs builds with direct Go setup, and separates Go linting from other checks. The Nix shell writes the pinned version files used by GitHub Actions.

Changes

CI toolchain and workflow

Layer / File(s) Summary
Toolchain version pinning
.go-version, .golangci.version, flake.nix
The project pins Go 1.27.0 and golangci-lint v2.13.1. The Nix shell writes these files from the active tool versions.
Build job migration
.github/workflows/ci.yaml
The build job uses actions/setup-go, verifies GOCACHEPROG, and runs make -j 4 build GO_BUILD_FLAGS= without the Nix shell.
Lint job separation
.github/workflows/ci.yaml
The workflow adds lint-go for Go linting and keeps Nix, flake, version, and commit checks in lint-other.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 1da02

CI now separates direct Go build and lint execution from other Nix-based checks while retaining pinned tool versions. The reported validation passes indicate the workflow is ready to merge.

Suggested reviewers: chrisgacsal, tothandras

Sequence Diagram(s)

Build execution flow

sequenceDiagram
  participant GitHubActions
  participant GoToolchain
  participant DepotGoCache
  participant Make
  GitHubActions->>GoToolchain: Set up version from .go-version
  GitHubActions->>DepotGoCache: Verify GOCACHEPROG
  GitHubActions->>Make: Run make -j 4 build GO_BUILD_FLAGS=
Loading

Go lint execution flow

sequenceDiagram
  participant GitHubActions
  participant GoToolchain
  participant GolangCILint
  participant Make
  GitHubActions->>GoToolchain: Set up version from .go-version
  GitHubActions->>GolangCILint: Install version from .golangci.version
  GitHubActions->>Make: Run make lint-go
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main CI change: running Go build and lint outside Nix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ci-upstream-go-split-lint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@turip turip added release-note/ignore Ignore this change when generating release notes devex-improvement Features/tools which are improves developer experience labels Sep 3, 2026
@turip
turip marked this pull request as ready for review September 3, 2026 19:18
@turip
turip requested a review from a team as a code owner September 3, 2026 19:18
@turip
turip force-pushed the feat/ci-upstream-go-split-lint branch from 75cafa1 to 1da022a Compare September 3, 2026 19:18
@turip
turip enabled auto-merge (squash) September 3, 2026 19:21
@turip
turip disabled auto-merge September 3, 2026 19:31
@turip
turip merged commit f1bb0a7 into main Sep 3, 2026
30 checks passed
@turip
turip deleted the feat/ci-upstream-go-split-lint branch September 3, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devex-improvement Features/tools which are improves developer experience release-note/ignore Ignore this change when generating release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants