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

Dependabot updates major +incompatible versions for go modules #4453

Closed
mctofu opened this issue Nov 24, 2021 · 3 comments
Closed

Dependabot updates major +incompatible versions for go modules #4453

mctofu opened this issue Nov 24, 2021 · 3 comments
Labels
core 🍏 Relates to the dependabot-core library itself L: go:modules Golang modules T: bug 🐞 Something isn't working

Comments

@mctofu
Copy link
Contributor

mctofu commented Nov 24, 2021

Package ecosystem
go_modules

Package manager version
1.17

Updated dependency
github.com/twitchtv/twirp

What you expected to see, versus what you actually saw
Prior to #4434 Dependabot would not update github.com/twitchtv/twirp from 5.12.1+incompatible to the latest release v8.1.0+incompatible. The original code to find the latest version would always ignore major version upgrades.

With the switch to go list -m -versions to resolve versions the behavior has slightly changed. For dependencies that are go modules the command only returns versions within the specified major version so the prior behavior is preserved. However, for dependencies that aren't go modules, such as github.com/twitchtv/twirp, the command returns all versions so major version upgrades are allowed.

I think this is not actually a bug but wanted to document the change. For true go modules we currently avoid updating major versions because it would involve extra work to update source files to the new module path. However, this may be a feature we support in the future. For dependencies that aren't go modules Dependabot only needs to update the go.mod to the new major version which it currently does.

If this new behavior is not desired it's possible to define an ignore condition in dependabot.yml to avoid major version updates for affected dependencies: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#ignore

@jeffwidman
Copy link
Member

jeffwidman commented Nov 24, 2021

However, this may be a feature we support in the future.

This may also eventually be supported in go upstream, which would make it much easier to extend support for within Dependabot. There's a few open tickets already in the go repo, although I don't have time to dig them up right now.

@jurre
Copy link
Member

jurre commented Nov 25, 2021

It'd be nice if we could rewrite the import paths for these cases at least, I think having to fix breaking changes in code is to be expected, but at least dependabot can take care of the busywork. I've had a PoC of that open for a while and I think it's doable. Against these latest changes that PR would be slimmed down a bunch.

I believe that not being able to update import paths has also been the reason we don't raise PRs for major versions in go, because it results in any PR that dependabot opens for a major version update to be broken by default, even if the breaking changes don't affect the repo in question.

someone can simply close the PR to ignore a particular version

This is tricky, because now they do miss updates to minor versions that they could pull in without questions. Also some of our users get annoyed by dependabot opening PRs they cannot act on.

@brrygrdn brrygrdn added the core 🍏 Relates to the dependabot-core library itself label Nov 26, 2021
lberrymage added a commit to accrescent/devconsole that referenced this issue Feb 2, 2022
dependabot won't do this for us as described in
dependabot/dependabot-core#4453. From that
issue:

> For true go modules we currently avoid updating major versions because
> it would involve extra work to update source files to the new module
> path. However, this may be a feature we support in the future.
@jeffwidman
Copy link
Member

Closing this as no further action needed.

This new behavior has been working well enough with minimal user complaints.

And the go ecosystem has rapidly adopted modules, so the +incompatible modules are becoming more and more rare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core 🍏 Relates to the dependabot-core library itself L: go:modules Golang modules T: bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
@jeffwidman @jurre @mctofu @brrygrdn and others