scala-steward icon indicating copy to clipboard operation
scala-steward copied to clipboard

Strict mode that fails if any version bump fails for any update

Open alexklibisz opened this issue 2 years ago • 2 comments

I would like for a scala-steward run to fail if any of the updates fails (i.e., if any of the updates prints "Unable to bump version for update ...").

I have noticed that there are two cases where "Unable to bump version for update" occurs:

  1. True positive: the version should have been updated, the log occurs, and in reality the version was not updated.
  2. False positive: the version should have been updated, the log occurs, but actually the version was updated.

In the worst case, scala-steward always succeeds (exit code = 0), but never makes an update. So, I would rather be extra cautious and just fail the whole run if either of these occur.

For now, I have worked around this as follows:

  1. tee the scala-steward logs to a file
  2. grep the file for "Unable to bump version for update"
  3. fail the Github Actions job if the grep returns non-empty

This workaround is good enough for me, for now. But I'm wondering if it would make sense to add this kind of strict, all-or-nothing mode as a command line argument?

alexklibisz avatar Jan 10 '23 00:01 alexklibisz

I think strict mode is not necessary if we reduced the misleading "Unable to bump version for update" logs as described in https://github.com/scala-steward-org/scala-steward/issues/2906

exoego avatar Feb 09 '23 05:02 exoego

Agreed it would be good to clean up that logging.

Are there any other cases where scala-steward can fail and still complete w/ a successful response? I feel like I remember seeing some others at times.

Maybe another way to solve this is to emit some sort of JSON digest, summarizing everything that scala-steward did during its run. Then the caller can parse this digest and apply their own definition of success or failure. Obviously not a small task, but just mentioning it as an idea.

alexklibisz avatar Feb 12 '23 18:02 alexklibisz