Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Coordinate updates if multiple versions of the same dependency are used #129

Closed
fthomas opened this issue Nov 5, 2018 · 1 comment · Fixed by #1990
Closed

Coordinate updates if multiple versions of the same dependency are used #129

fthomas opened this issue Nov 5, 2018 · 1 comment · Fixed by #1990
Labels
bug Something isn't working

Comments

@fthomas
Copy link
Member

fthomas commented Nov 5, 2018

If a project uses multiple versions of the same dependency, Scala Steward does a bad job at handling them in a coordinated fashion which results in bad PRs like circe/circe-jackson#36 or scala/scala-collection-compat#432. This is a common situation for projects that support multiple Scala versions or when a project provides integration for multiple versions of another library (e.g. circe-jackson25, circe-jackson26, etc.).

@fthomas fthomas added the bug Something isn't working label Nov 5, 2018
@fthomas fthomas changed the title Investigate jackson update in circe-jackson Coordinate updates if multiple versions of the same dependency are used Feb 27, 2021
@SethTisue SethTisue mentioned this issue Mar 2, 2021
@fthomas
Copy link
Member Author

fthomas commented Mar 3, 2021

One way to improve the situation here is by preventing "overtaking" updates. Suppose a project depends on two versions of scala-library:

"org.scala-lang" % "scala-library" % "2.12.13"
"org.scala-lang" % "scala-library" % "2.13.5"

Scala Steward checks each dependency individually for updates. It finds an update for the first dependency from 2.12.13 -> 2.13.5 but none for the second since that is already on the latest version. It then creates a PR for this update which is the reason for the bad PRs above.

I propose we discard the update because it "overtakes" the second dependency. An update is overtaking if there exists another dependency with the same groupId and artifactId but a version that is greater than the update's current version (2.13.5 is greater than 2.12.13) and smaller or equal to the update's next version (2.13.5 is equal to 2.13.5).

This will prevent updates of scala-library 2.12.13 until there is a newer 2.12 version available or the project removes the 2.13.5 dependency.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant