-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only return a failure exit code when all repos have failed #3369
Only return a failure exit code when all repos have failed #3369
Conversation
When even one repository fails in a scala steward run the workspace is not persisted by GitHub Actions because GH Actions won't persist the workspace of a failing job. Persisting workspace is crucial for respecting `pullRequests.frequency` configuration because the workspace is how scala steward records that it has opened a pull request. This means that one failing repository can cause a lot of user annoyance because their configuration is no longer respected and they get too many PRs opened. This change aims to fix that by only returning a failure code if *all* repos have failed. So long as at least one repository succeeded the exit code will be success and the workspace will persist. If administrators need to know what repos are failing they can use the jobs summary introduced by: scala-steward-org#3071 See more here: guardian/scala-steward-public-repos#60 Co-authored-by: Roberto Tyley <[email protected]>
@mzuehlke how does this look to you? To us at the Guardian this does seems like the best fix to the problem? One possible alternative would be to modify the behaviour of |
Hey @ioannakok, thanks for this! I think this could make sense for a lot of use cases, but not for others. Maybe we can expand on it and put it behind a flag that's been sent in the params. That way we can propagate that flag from the action and people can decide whether to fail if everything is failing or not. What do you think? |
The new `--exit-code-success-if-any-repo-succeeds` CLI flag alters the default behaviour of the exit-code of the Scala Steward process - the exit code will be success (`0`) if the processing of _any_ repo has succeeded, rather than requiring that _all_ repos are successfully processed. This is useful when running Scala Steward with the Scala Steward GitHub Action - it means that the filesystem _will_ be persisted, along with the record of what PRs have been raised, which is what you _want_ to happen, even if some repos have failed. As Alejandro mentioned: scala-steward-org#3369 (comment) ...this behaviour may not always be desired, so we're disabling it by default.
The new `--exit-code-success-if-any-repo-succeeds` CLI flag alters the default behaviour of the exit-code of the Scala Steward process - the exit code will be success (`0`) if the processing of _any_ repo has succeeded, rather than requiring that _all_ repos are successfully processed. This is useful when running Scala Steward with the Scala Steward GitHub Action - it means that the filesystem _will_ be persisted, along with the record of what PRs have been raised, which is what you _want_ to happen, even if some repos have failed. As Alejandro mentioned: scala-steward-org#3369 (comment) ...this behaviour may not always be desired, so we're disabling it by default.
49a28b2
to
e8f6b9b
Compare
The new `--exit-code-success-if-any-repo-succeeds` CLI flag alters the default behaviour of the exit-code of the Scala Steward process - the exit code will be success (`0`) if the processing of _any_ repo has succeeded, rather than requiring that _all_ repos are successfully processed. This is useful when running Scala Steward with the Scala Steward GitHub Action - it means that the filesystem _will_ be persisted, along with the record of what PRs have been raised, which is what you _want_ to happen, even if some repos have failed. As Alejandro mentioned: scala-steward-org#3369 (comment) ...this behaviour may not always be desired, so we're disabling it by default.
e8f6b9b
to
8286c0f
Compare
The new `--exit-code-success-if-any-repo-succeeds` CLI flag alters the default behaviour of the exit-code of the Scala Steward process - the exit code will be success (`0`) if the processing of _any_ repo has succeeded, rather than requiring that _all_ repos are successfully processed. This is useful when running Scala Steward with the Scala Steward GitHub Action - it means that the filesystem _will_ be persisted, along with the record of what PRs have been raised, which is what you _want_ to happen, even if some repos have failed. As Alejandro mentioned: scala-steward-org#3369 (comment) ...this behaviour may not always be desired, so we're disabling it by default.
8286c0f
to
0607cfc
Compare
Thanks @alejandrohdezma - I've added a flag with 0607cfc, does that look ok? |
Great work! Thanks! ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being absent, looks good 👍
When even one repository fails in a scala steward run the workspace is not persisted by GitHub Actions because GH Actions won't persist the workspace of a failing job. Persisting workspace is crucial for respecting
pullRequests.frequency
configuration because the workspace is how scala steward records that it has opened a pull request. This means that one failing repository can cause a lot of user annoyance because their configuration is no longer respected and they get too many PRs opened. This change aims to fix that by only returning a failure code if all repos have failed. So long as at least one repository succeeded the exit code will be success and the workspace will persist. If administrators need to know what repos are failing they can use the jobs summary introduced by: #3071See more here: guardian/scala-steward-public-repos#60
cc @alejandrohdezma