scala-steward-org / scala-steward

:robot: A bot that helps you keep your projects up-to-date
Apache License 2.0
1.15k stars 502 forks source link

Option to abort on scalafix migration failure #3273

Open cptwunderlich opened 9 months ago

cptwunderlich commented 9 months ago

I'm currently trying to get custom scalafix migrations to work with our scala-steward setup. In the process, I'm doing a lot of tests and I noticed the following:

scala-steward finds my update, tries to apply the migrations, they fail for various reasons, scala-steward moves on. I now have an open PR with the bumped versions, but without the migrations applied, so it won't build. Fixing the migrations and re-running scala-steward won't help, bc. the dependency version hasn't changed. I cannot delete a PR on Github. Even if I close it and delete the source branch, scala-steward sees a closed PR for a given upgrade. So there is no way to "retry".

It'd be nice to have a config option to tell scala-steward not to open the PR at all, if migrations fail. Or to make specific migrations "mandatory", i.e., their failure will cause no PR to be opened.

fthomas commented 9 months ago

It'd be nice to have a config option to tell scala-steward not to open the PR at all, if migrations fail.

Sounds good to me. We could just throw before this line if result is a Left and the corresponding config option is set. This would abort the whole update and not create a PR.