Skip to content

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

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

Open
alexklibisz opened this issue Jan 10, 2023 · 2 comments
Open

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

alexklibisz opened this issue Jan 10, 2023 · 2 comments

Comments

@alexklibisz
Copy link
Contributor

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?

@exoego
Copy link
Contributor

exoego commented Feb 9, 2023

I think strict mode is not necessary if we reduced the misleading "Unable to bump version for update" logs as described in #2906

@alexklibisz
Copy link
Contributor Author

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants