Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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(gomod): preserve go/toolchain directives #34779
base: main
Are you sure you want to change the base?
fix(gomod): preserve go/toolchain directives #34779
Changes from 28 commits
72f8adf
3629f60
ab9f5b9
be3d457
0d94a80
59a450d
4b3fd95
7843e56
3f2750a
4db59ef
125e3db
de81b17
1667c12
ffe38b8
6f2afba
9064156
8f46eb1
f91d392
2fc88c9
875aa50
ed66459
a4c4690
e238578
0eb2aac
26c511c
ffec247
5264a45
0858735
c3bf9f8
dea2c8c
e321b50
60bdc84
f72f7ed
6a5b70d
575376f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code does enforce the version currently declared by the go directive.
Which in turn will prevent any dependency upgrade to succeed that requires even a higher minor version of go.
Wasn't there agreement that this is undesired?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's why I add this: https://github.com/renovatebot/renovate/pull/34779/files#diff-fd367c04a5c8c9b0dcbe22bb60da84f2b674ce21dadc840799ab1c2dd9b1a251R217-R221
we will execute this command: https://github.com/renovatebot/renovate/pull/34779/files#diff-4c37b8edc62aa49295d264c221717bd0361ccff0a791d4327f4421a0ea23521fR2355
go will check it for us
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/renovatebot/renovate/pull/34779/files#diff-4c37b8edc62aa49295d264c221717bd0361ccff0a791d4327f4421a0ea23521fR2214
Consider x/crypto would specify go1.23.7 in it's go.mod
[email protected] would not allow that ...
And users can not control that behavior in renovate. They would explicitly need to bump go before that. Why not allow the bump in same PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the language version should have more priority than library version. Users can always enable updating go directive, but they can't suppress updating go directive caused by library if they want, therefore is this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is what a sane default is:
Who would be able to take such decision @viceice ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is only the case for auto-merges of PRs. Otherwise users can transparently review and close unwanted PRs.
Please also consider that the changes currently WILL ALLOW go directive bumping. Here is the observation:
And that is if GOTOOLCHAIN is "auto". On "local" with a 1.22.0 toolchain, we get no switching:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I don't know this case.
A workaround would be using
go 1.23
instead ofgo 1.23.0
in go mod, but that requires user to change their code ...A better solution would be disabling go version switching and pick
1.23.0
when it hasgo 1.23
directive 😅There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, if users want renovate to touch go version, they can manually enable it.
So renovate will update the go directive to expected version based on user config.
If they group go directive with packages, they get one working PR.
And if they have seprated PRs for go direcive and package, they can still get a working PR for package after they merge the PR for go directive.
But I'm not opposed to a new config that let go command updating go directive, it would very easy to add such feature. we just don't push anything into
extraGetArguments
.For example
But it should be done in a seprated PR.