• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nats-io / nats-server / 13428056167
83%

Build:
DEFAULT BRANCH: main
Ran 20 Feb 2025 05:45AM UTC
Jobs 1
Files 57
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Feb 2025 02:06AM UTC coverage: 85.525% (+0.004%) from 85.521%
13428056167

push

github

web-flow
Explicitly set go toolchain in goreleaser config (#6420)

## Details
We have reproducible binaries,
[rpms/debs](https://github.com/nats-io/nats-server/pull/6359) and
[archives](https://github.com/nats-io/nats-server/pull/6299).
And `goreleaser.yml` holds [all the
knobs](https://goreleaser.com/customization/builds/go/) that can be
tuned to build the binary.

The only thing that affects the build and is not defined in the
goreleaser config is the go toolchain version.
Currently, we set the version of the go toolchain that is used for
releases in Travis:

<https://github.com/nats-io/nats-server/blob/<a class=hub.com/nats-io/nats-server/commit/5e6017135b4b1d333b435ff55b720275a39bb7af">5e6017135/.travis.yml#L11-L12>

<https://github.com/nats-io/nats-server/blob/5e6017135b4b1d333b435ff55b720275a39bb7af/.travis.yml#L67>

I spent some time [trying to understand the behavior of go and toolchain
directives](https://alexbozhenko.github.io/posts/2024-12-19-understand-go-toolchain-directive-or-your-money-back/).
I think setting the toolchain used for releases in .goreleser.yml would
make it more explicit and future-proof.


With this change, any human or script who has `go>1.21.0` and goreleaser
installed can checkout the repo at any commit, run one command, and get
binaries that will be _exactly_ as if we were cutting a release on that
commit.

```
goreleaser build --snapshot --clean --single-target
```

Several places would benefit from not having to worry about keeping
toolchain and all the go build flags in sync:

* get-nats.io(already uses gorelaser, but toolchain used to build
depends on the build host):

<https://github.com/ConnectEverything/client-tools/blob/eba999ac9/build-nightlies.sh#L184-L188>
* <redacted> number of private repos

If we land this, we can update the above places to use `goreleaser
build`, thus making sure we use _exactly the same_ binary everywhere,
and forever forget about managing/updating go versions in other places
that need to build the binary

## Reprodu... (continued)

69113 of 80810 relevant lines covered (85.53%)

882966.0 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
2
72.46
-0.45% src/github.com/nats-io/nats-server/server/avl/seqset.go
2
63.16
-10.53% src/github.com/nats-io/nats-server/server/jetstream_events.go
2
93.64
0.12% src/github.com/nats-io/nats-server/server/route.go
3
80.76
0.04% src/github.com/nats-io/nats-server/server/opts.go
6
93.82
-0.25% src/github.com/nats-io/nats-server/server/gateway.go
7
74.26
-2.07% src/github.com/nats-io/nats-server/server/store.go
35
87.94
-0.74% src/github.com/nats-io/nats-server/server/consumer.go
57
85.93
-0.42% src/github.com/nats-io/nats-server/server/events.go
108
84.0
-0.71% src/github.com/nats-io/nats-server/server/memstore.go
139
85.0
0.23% src/github.com/nats-io/nats-server/server/stream.go
166
90.46
-0.13% src/github.com/nats-io/nats-server/server/leafnode.go
179
85.34
0.33% src/github.com/nats-io/nats-server/server/raft.go
346
86.25
-0.22% src/github.com/nats-io/nats-server/server/accounts.go
445
83.8
-0.04% src/github.com/nats-io/nats-server/server/filestore.go
487
73.45
0.11% src/github.com/nats-io/nats-server/server/jetstream_api.go
637
81.84
0.53% src/github.com/nats-io/nats-server/server/jetstream_cluster.go
Jobs
ID Job ID Ran Files Coverage
1 13428056167.1 20 Feb 2025 05:45AM UTC 57
85.53
GitHub Action Run
Source Files on build 13428056167
  • Tree
  • List 57
  • Changed 45
  • Source Changed 12
  • Coverage Changed 20
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #13428056167
  • cad5114b on github
  • Prev Build on main (#13405581651)
  • Next Build on main (#13450211566)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc