Use Bitbucket Pipeline to test against next version of language to not fail but alert

Eric Poe
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 10, 2025

We currently have our pipeline run against one version of our programming language using our own Docker image. I would like, also, to test against the next version of the language so that we are alerted to BC breaks for potential fixing in the same PR or in a subsequent PR.

Is there a way to have one pipeline step stop on failure and another continue, perhaps with a warning, on failure?

2 answers

2 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 14, 2025

Hi Eric and welcome to the community!

We will be releasing a feature soon that will allow a pipeline to continue when a step fails. This is not available yet and there is no continue-on-error flag.

When this is released we will post an update in this feature request:

You can add yourself as a watcher (by selecting the link Start watching this issue in the feature request) if you'd like to get notified via email on any updates. We will most probably release a blog post about this as well, in https://www.atlassian.com/blog/bitbucket.

This is the latest update on the feature request from one of our product managers about what we are planning:

When this feature becomes available, I don't believe that we will be sending a notification for these failed steps. However you could make use of an after-script on that step that checks the step's exit code using the default variable $BITBUCKET_EXIT_CODE.

In the after-script, you could use a command like the following so that the after-script exits if the step is successful:

- if [ "$BITBUCKET_EXIT_CODE" == "0" ]; then exit 0 ; fi;

If the step fails, the after-script will continue. You could then use one of the available pipes to send e.g. an email notification or a Slack notification about the failure:

Again, all this info I shared is for when this feature becomes available.


Until this feature is released, the only way for the pipeline to continue with a failed step is by adding the command set +e in the beginning of a pipelines step in your yml file. Please keep in mind that if you do this the step will show as successful even on failure, and the only way of figuring out if a command failed would be by examining the output of each command in the build log.


Please feel free to let me know if you have any questions!


Kind regards,
Theodora

1 vote
Sahir Maharaj
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 11, 2025

Hello @Eric Poe

Based on my knowledge of Bitbucket Pipelines, you can achieve this by setting up a separate pipeline step that runs tests against the newer language version.

To ensure it alerts without failing the entire pipeline, you can add the continue-on-error flag in your pipeline YAML configuration for that specific step.

This way, the pipeline will continue even if the step fails, while you still receive alerts or logs indicating the issue.

 

Eric Poe
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 13, 2025

Thank you Sahir! Where can I find out more information on this and related flags? I'm unable to find this flag in the documentation: https://support.atlassian.com/search-results/?searchTerm=%22continue-on-error%22&deployment=cloud&product=bitbucket

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events