Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): use consistent Go version in builds and CI #377

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

cwaldren-ld
Copy link
Contributor

@cwaldren-ld cwaldren-ld commented Jul 11, 2024

Currently we are building with whatever Go version is installed on the runner at the time of the build. At the same time, we're testing with a particular Go version in CI.

This PR unifies the versions used in test and build. That way we know we've tested what we're shipping.

  • PR has a matrix build of go versions

- name: Set Go Version Matrices
id: set-matrix
run: |
echo "all=[\"${{ steps.set-env.outputs.latest }}\",\"${{ steps.set-env.outputs.penultimate }}\"]" >> $GITHUB_OUTPUT
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This whole file is copied from Relay. It'd be nice to make it reusable.. but not sure it's worth it yet.)

@cwaldren-ld
Copy link
Contributor Author

cwaldren-ld commented Jul 11, 2024

There is a choice we can make for supporting Go versions. We can support the latest release N and penultimate N-1, and keep these up-to-date automatically with a workflow.

This would be equivalent to roughly 1 year of Go support, and is what Relay does.

Or, we could support latest release N and some other minimum compatible version < N, not necessarily the penultimate. This allows for wider compatibility, at the cost of having to think about when to bump the minimum version.

Since we're shipping binaries of this, and people likely aren't building from source, I think the first option is easiest.

@@ -1,6 +1,6 @@
module github.com/launchdarkly/ldcli

go 1.20
go 1.21
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it's not strictly true that we require 1.21, since we're building with 1.21 and 1.22 we can't claim this. See my other comment for an alternative.

@cwaldren-ld cwaldren-ld merged commit 83cf380 into main Jul 11, 2024
5 checks passed
@cwaldren-ld cwaldren-ld deleted the cw/consistent-go-version branch July 11, 2024 18:11
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.

2 participants