-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Bot upgrades golang packages to Invalid pseudo-version #4310
Comments
Copied reproduction steps to https://github.com/renovate-tests/gomod6 |
It allows to use GOPROXY without errors. The bad pseudo versions where introduced by renovate. See renovatebot/renovate#4310
It allows to use GOPROXY without errors. The bad pseudo versions where introduced by renovate. See renovatebot/renovate#4310
- Fix the invalid pseudo-versions for go modules - Set the GOPROXY=https://proxy.golang.org on both travis and appveyor See renovatebot/renovate#4310
- Fix the invalid pseudo-versions for go modules - Set the GOPROXY=https://proxy.golang.org on both travis and appveyor See renovatebot/renovate#4310
- Fix the invalid pseudo-versions for go modules - Set the GOPROXY=https://proxy.golang.org on both travis and appveyor See renovatebot/renovate#4310
- Fix the invalid pseudo-versions for go modules - Set the GOPROXY=https://proxy.golang.org on both travis and appveyor See renovatebot/renovate#4310
Moreover, note that the code there is always using a A more robust approach would be to invoke |
Thanks for the suggestion. Currently, if a dependency was required using a pseudo version and has since adopted versioning, Renovate should detect that and update it from v0.0.0 pseudo version to a "real" version. Is that what you mean, or something else? Also, running |
Pseudo-versions can end up with a greater-than- Moreover, if a module is at a major version above 0, the pseudo-version will start with the corresponding major version (e.g. So it's true that most untagged repos will have |
So |
@bcmills thanks again for the insights. So if we can implement a fix to generate the |
The majority? Probably, but there are known edge-cases you'd miss. I would think that with an automated system like renovatebot you'd want to bias toward something that works 100% of the time — and that would be to use |
After being bitten many times in the past, we have a strong aversion to shelling out to binaries for results instead understanding the algorithms well enough to map back to our internal concepts. Of course if it's impossible then I'll reconsider, but this position really comes from painful experience. In this case my blind spot appears to be the need for non-v0.0.0 pseudo versions.
Could you elaborate on this idea? e.g. instead of |
Exactly. When the So if you just write the commit hash into the file and then invoke a |
That's fine, but in this case the inputs to the algorithm are fairly broad (potentially the entire history leading up to the requested commit, including the tags found on any ancestor commits), and even if you're excluding commits that have canonically-versioned parents there are many edge-cases to consider (see https://tip.golang.org/cmd/go/#hdr-Pseudo_versions):
|
@bcmills does this work with Go 1.12 or only with Go 1.13? Also I'm a bit confused because when I browse to https://github.com/golang/sys I see that the last commit was in July, not August. Can someone help clear up my confusion about why we're seeing August timestamps in this example? |
@rarkins Git tracks two dates in commits: author date and commit date. On https://github.com/golang/sys/commits/master, you can see |
@nono thanks for that answer - makes sense to base it on the commit date and not author date. GitHub's UI confused me there. Here's something else I've found:
What should we do? Edit: Running go 1.12.9 btw |
@rarkins thanks for looking into this! Will you create a process that run these command on the background and commit the changes to git repository? or you want to build the latest version programmatically. I see that you started to consider running some commands so I would suggest to let golang take care of the upgrades for you and no need to invest time understanding how go build the version. I see it is a bit complicated to replicate what go do to upgrade and if go fails to upgrade then no automation will work and someone need to fix & upgrade manually. You can even let users define on For example this will upgrade golang.org/x/sys
it will upgrade to the latest version of Ref -> https://github.com/golang/go/wiki/Modules#go-111-modules |
@Clivern my strategy is:
In theory we could skip (2) and maybe just use Clarification: obviously patch/minor/major is not applicable for pseudo version updates, but it is for true modules and we want a similar algorithm for all. |
It may strip some So whenever you upgrade a dependency:
In general, it make sure that |
In that case I think we are ok to fix the original topic of this issue (v0.0.0 pseudo version with wrong time stamp). I have not verified yet if it also works with the other edge cases identified but hopefully it should. |
hopefully it covers the majority, i think that's also what @bcmills suggested. |
We will run “go get” 100% of the time and users can opt into “go mod tidy” 100% of the time too. If there are edge cases still missed then I’ll look into it again |
🎉 This issue has been resolved in version 19.34.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What Renovate type are you using?
Renovate GitHub App
Describe the bug
Renovate is picking the wrong timestamp when it upgrades a golang package. It picks the commit timestamp of the main go package not the commit timestamp of the dependency.
So here mgechev/revive#221.
the bot updated at 2019-08-15 the package
golang.org/x/sys
like thisBut actually it should pick the date from here golang/sys@fde4db3 which is 2019-08-13. Even if you do the upgrade manually on your laptop it will be
To Reproduce
main.go
I think this line cause the issue
renovate/lib/manager/gomod/update.ts
Lines 60 to 64 in 6f99118
Additional context
This is fine now but once golang 1.13 released which is soon, there will be more troubles since go will validate the timestamp during package installation (See here https://tip.golang.org/doc/go1.13#version-validation) and when i try to use packages like revive that depend on the bot for upgrades with latest go version 1.13, things fail with error
The text was updated successfully, but these errors were encountered: