Skip to content

travis: don't hardcode golang versions#2538

Closed
kolyshkin wants to merge 2 commits intoopencontainers:masterfrom
kolyshkin:travis-go
Closed

travis: don't hardcode golang versions#2538
kolyshkin wants to merge 2 commits intoopencontainers:masterfrom
kolyshkin:travis-go

Conversation

@kolyshkin
Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin commented Aug 1, 2020

Golang is supporting two minor releases (currently 1.14.x and 1.13.x),
and thus once a new minor release is out, the oldest supported one
becomes unsupported (e.g. when 1.15 is out, 1.13 becomes unsupported).

Instead of hardcoding golang versions, let's specify "stable" and
"oldstable" (which currently equals to 1.14.x and 1.13.x). This way,
we'll be sure we're testing stuff using up to date and supported golang
releases.

This was not possible before due to:

but apparently it's finally fixed. Hooray!

Previous discussion on the topic:

Also, add -mod=vendor to go fmt and go vet since it's required
for go 1.13 to honor vendor subdir. This should speed up CI a little bit.

Golang is supporting two minor releases (currently 1.14.x and 1.13.x),
and thus once a new minor release is out, the oldest supported one
becomes unsupported (e.g. when 1.15 is out, 1.13 becomes unsupported).

Instead of hardcoding golang versions, let's specify "stable" and
"oldstable" (which currently equals to 1.14.x and 1.13.x). This way,
we'll be sure we're testing stuff using up to date and supported golang
releases.

This was not possible before due to:
 - travis-ci/gimme#179
 - travis-ci/gimme#185

but apparently it's finally fixed. Hooray!

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin
Copy link
Copy Markdown
Contributor Author

So, stable gives us:

$ go version
go version go1.14.6 linux/amd64

and oldstable:

$ go version
go version go1.13.14 linux/amd64

so I guess we're good!

I have noticed that `go vet` from golang 1.13 ignores the vendor/
subdir, downloading all the modules when invoked in Travis CI env.

As the other go commands, in 1.13 it needs explicit -mod=vendor
flag, so let's provide one.

PS once golang 1.13 is unsupported, we will drop it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin
Copy link
Copy Markdown
Contributor Author

@thaJeztah PTAL

@AkihiroSuda
Copy link
Copy Markdown
Member

I'm not sure we want this. I think we want to be aware of the tested versions explicitly.

@thaJeztah
Copy link
Copy Markdown
Member

Yeah, not a fan; I generally prefer explicit > implicit as well; even if that means a PR to update twice a year

@dims
Copy link
Copy Markdown
Contributor

dims commented Aug 2, 2020

I agree with @thaJeztah and @AkihiroSuda here

@AkihiroSuda
Copy link
Copy Markdown
Member

@kolyshkin btw Makefile: fix go vet/fmt commit LGTM, could you cherry-pick in another PR?

@kolyshkin
Copy link
Copy Markdown
Contributor Author

Closing as per comments above. The Makefile fix is separated out to #2545

@kolyshkin kolyshkin closed this Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants