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

Automatically bump go patch version in main branch go.mod #8392

Closed
wants to merge 1 commit into from

Conversation

kaovilai
Copy link
Member

@kaovilai kaovilai commented Nov 12, 2024

Thank you for contributing to Velero!

Please add a summary of your change

Add new action that creates PR to bump version of golang used based on golang version in container image.
https://go.dev/doc/toolchain introduced toolchain to go.mod and we wanted to avoid go mod tidy triggering adding this line.

This PR adds new action that creates PR to bump version of golang used based on golang version in container image and avoids main branch using older golang than release branch (ie. release-1.15 branch uses golang 1.22.8, when main is using older golang 1.22.0).

It is practically impossible to run go mod tidy with just go 1.22 as some user have requested. A patch version of golang always end up in a separate toolchain line which defeats the purpose of using generic 1.22.

At least with this PR, go.mod of main branch will be latest possible golang patch version.

We would expect upon merging that next day or upon manual trigger, a PR with go.mod updated to latest go patch matching container image is created.

See manual runs from this workflow here https://github.com/kaovilai/velero/actions/workflows/auto_bump_golang.yml

PRs created by this workflow: https://github.com/kaovilai/velero/pulls?q=is%3Apr+author%3Aapp%2Fgithub-actions+base%3Amain+head%3Aactions%2Fupdate-go-mod-patch+

This is similar to dependabot updating deps. However, dependabot do not currently updates golang version in go.mod.

Lookout for following log in this PR's action run.

go: upgraded go 1.22.0 => 1.22.9

Does your change fix a particular issue?

Fixes #(issue)

Please indicate you've done the following:

@kaovilai
Copy link
Member Author

/kind changelog-not-required

@github-actions github-actions bot added the kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes label Nov 12, 2024
@kaovilai kaovilai closed this Nov 12, 2024
@kaovilai kaovilai reopened this Nov 12, 2024
@kaovilai kaovilai force-pushed the main branch 4 times, most recently from 128558b to 0690b4c Compare November 12, 2024 06:06
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.96%. Comparing base (1fbd22f) to head (1e53458).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8392   +/-   ##
=======================================
  Coverage   58.96%   58.96%           
=======================================
  Files         367      367           
  Lines       38895    38895           
=======================================
  Hits        22933    22933           
  Misses      14500    14500           
  Partials     1462     1462           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kaovilai kaovilai changed the title Automatically bump go patch version in go.mod Automatically bump go patch version in main branch go.mod Nov 12, 2024
@kaovilai kaovilai marked this pull request as ready for review November 12, 2024 14:47
Signed-off-by: Tiger Kaovilai <[email protected]>
@kaovilai
Copy link
Member Author

The requirement of the user is more accurately represented by #8397 and this PR do not satisfy the requirement.

@kaovilai kaovilai closed this Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant