scala-steward
scala-steward copied to clipboard
feature request : create a PR/MR when the heuristic failed to find a line to update
I'd suggest that steward creates a PR/MR with some comment to suggest that the update is fixed manually.
The current behaviour is the libraries are not updated, and I only discovered that by digging into scala-steward logs. It means that projects which rely on steward to get updates only have parts of their libraries updated and are not notified at all.
What about have steward add a line in build.sbt like
// an update was found for org.apache.poi:{poi, poi-ooxml} : 4.0.1 -> 4.1.2
// the update could not be applied automatically because scala-steward could not determine which line to change
// you will need to apply this update manually
// see this page (TODO link to doc) to see how you can name your versions in a supported way
@fthomas if you agree with this idea, and give some quick pointers on which parts of this code needs to change, I'd be happy to implement and test this feature
I like the idea but would slightly modify it. The current UpdateHeuristic
s are responsible for bumping the version number. They are tried consecutively on all files that contain the current version number until a heuristic is able to bump the version. They are ordered by how confident we are that they'll modify the correct version. Now instead of adding a comment to build.sbt
, how about we add another heuristic that is tried last and just bumps all version strings without checking if it is the correct one? If the current version number is unique in the source files, even this simplistic heuristic will do the right thing. In other cases where it also modifies other unrelated strings, manual intervention would be needed.
For my public Scala Steward instance I wouldn't want to enable this heuristic by default because I would lose track where the current heuristics are lacking and how they could be improved. Therefore it would need to be configurable via a flag in the repo config which also means that you could enable it globally in your Scala Steward instance via the default repo config.
I think this is a very valid idea.
Today I had to fix a MR created via scala-steward which had a similar issue : it bumped both flyway and sbt-flyway (which were at the same version, but sbt-flyway did not have a new version available). Fixing it was OK.
Unfortunately I won't have time soon to work on the implementation ...