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

Add workflow to update go mod version. #928

Merged
merged 3 commits into from
Jun 4, 2024
Merged

Conversation

robdimsdale
Copy link
Member

@robdimsdale robdimsdale commented May 31, 2024

Summary

This PR adds a workflow to update the version of go and the toolchain in go.mod. It also adds the associated failure labels for when this job fails.

See https://github.com/orgs/paketo-buildpacks/discussions/283

Use cases

We want to keep the toolchain go1.X.Y line up to date with the latest version of go available, as that is the actual version of the go toolchain that will be used to build the module. If this line is present, go will guarantee to build with this version of go toolchain, regardless of what version is provided in CI. Essentially this line locks down the version of go used to build a module at a specific point in time. By keeping it up to date, we guarantee that we're always building with the latest version of go.

One caveat is that this toolchain line requires a minimum version of the go 1.x line in the go.mod - specifically it requires go 1.21 or greater. So this workflow will also bump that version if it is lower than 1.21. It will ignore the line if it is greater than or equal to go 1.21.

I think running this job once per week is sufficient. Go doesn't release patch versions that frequently, and we don't release buildpacks more frequently than weekly. We can always invoke it directly with the workflow_dispatch in case of a critical CVE fix between scheduled runs.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@robdimsdale robdimsdale requested a review from a team as a code owner May 31, 2024 20:24
@robdimsdale robdimsdale enabled auto-merge (rebase) May 31, 2024 20:29
@robdimsdale robdimsdale merged commit 0e20d7e into main Jun 4, 2024
4 checks passed
@robdimsdale robdimsdale deleted the add-go-mod-update-workflow branch June 4, 2024 13:41
@sophiewigmore sophiewigmore mentioned this pull request Jun 4, 2024
2 tasks
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