Is there a way to define a step that is allowed to fail? It would come in handy to run certain sanity checks, like linting or static code analysis.
It’s important to create visibility on these steps, but they are not necessarily blocking.
I know there is the continue_on_failure on wait steps, but it will not work for this use case for example:
Hey there @JoniV — thanks very much for posting and welcome to the forum
Good news on that front, we totally agree and I’ve actually nearly finished adding support for this. There will be a changelog up about it pretty soon, but essentially you will be able to allow steps to “soft-fail”. Soft failed steps are still failures, they just don’t cause the whole pipeline to fail too, and are opted into via listing allowed exit statuses.
Of course that will then make it appear as if the step isn’t failing, but maybe it would be acceptable. If you wanted to surface lint errors more, you could also use buildkite-agent annotate to make note of the hidden failure.
Just a quick update here so you don’t think I’ve forgotten — this is still coming, just got delayed a little last week. If the stars align I’ll hopefully get this out the door this week.
Fantastic to hear you’re working on a soft fail like feature. We’re very keen for this functionality - the workarounds listed aren’t ideal. Our scenario is something like this:
- command: "bash frontend-ui-tests.sh" # will sometimes fail
- wait
- block: "deploy to staging" # allow us to unblock manually even if last failed step
Hey everyone apologies for the radio silence on this one, it unfortunately slipped through somehow and I forgot to get back here to let everyone know that we actually shipped this feature a little while ago!
Hello! I am revisiting this topic because my team needs the ability to ignore a failing step in their build. The soft_fail feature works in buildkite exactly how I would like it to; however, the reporting of the results does not translate to the GitHub checks UI to report the failure as we would like. The check says “soft fail” but shows as passing the check.
I have posted about this previously here Soft fail status in github checks but would appreciate another perspective on the desired behavior for the step-level checks status shown in GitHub for soft failures. My dev team would like to see the failure in GitHub because otherwise they do not go out to the Buildkite UI. Specifically, they want the step-level check in GitHub to fail.
By design, sof_fail is translated as passed in Github commit status.
The purpose of “soft fail” is that “we don’t really care about the outcome, and if it fails, just let me know, but don’t let it get in the way” and the way that translates in GitHub land is with “success”. So we decided to translate it as passed but adding a note that it was soft_fail.
Thanks for the quick reply Paula! I see you’re saying that this is the intended behavior. In my case, the github check succeeding with the “soft fail” commit status is not enough to let the developers know that something has failed. So the end result of the current behavior is that they don’t know about the failure.
I see this as not meeting the goals of the soft fail behavior as you stated: “we don’t really care about the outcome, and if it fails, just let me know, but don’t let it get in the way”
The failed check in github would not get in their way because they can configure which checks are necessary in order to merge.
Thanks for the extra detail! Unfortunately, this is a complex case where it’s difficult to translate a “Buildkite concept” to a “GitHub commit status concept”, and our built-in behavior is our gold standard (i.e. most widely used) and we leaned in that direction.