Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-19410

Resume button will stay greyed out if branch restrictions are enabled for builds that deploy to the same environment

      Currently, it's not possible to perform two deployment builds to the same environment at the same time.
      When you try this, the following message will show up:
      This pipeline was paused because another pipeline was deploying to Test.

      The build will stay paused in this state, and a "resume" button will show up.
      If there are deployment branch restrictions active, the resume button will stay grayed out, and will not allow you to proceed with the deployment.

      Steps to reproduce:

      1. Add the following configuration on your yml:
      pipelines:
        default:
           - step:
              script:
               - echo a
           - step:
              deployment: test
              script: 
                - echo a
        pull-requests:
           '**':
           - step:
                   script:
                    - echo a
           - step:
                   deployment: test
                   script: 
                     - echo a
      

      2 . Go to your repo settings > Deployments > This happens for any environment, but in this case, for testing purposes, select the "test" environment >Add any branch to the "Branches allowed to deploy to Test:" textbox

      3 . Create a new branch, and add a commit to it. This commit should trigger a build As soon as the commit is added, before the build that gets triggered by the commit ends, go to the pull requests page and create a new PR for the created branch

      4 . This will trigger two builds. The build that finishes first will be able to deploy to the environment whereas the other build will get blocked with the following error:
      This pipeline was paused because another pipeline was deploying to <environment>.

      This is expected. However, even after the deployment ends, the "Resume" button will never allow you to deploy to the Test environment, and this is the issue here.

      A workaround for this is to remove any deployment branch restrictions you may have on your repo. The "Resume" button will not be greyed out anymore.

          Form Name

            [BCLOUD-19410] Resume button will stay greyed out if branch restrictions are enabled for builds that deploy to the same environment

            Thanks for bringing this to our attention, we’ve identified the issue with pull request pipelines not having branch name set properly and rolled out a fix for it.

            Thanks,
            Peter

            Peter Plewa (Inactive) added a comment - Thanks for bringing this to our attention, we’ve identified the issue with pull request pipelines not having branch name set properly and rolled out a fix for it. Thanks, Peter

            Aneita added a comment -

            Thanks for the context and explanation de52421bead8 . Just want to check, is this the same issue that’s being reported as part of issue BCLOUD-19395?

            Aneita added a comment - Thanks for the context and explanation de52421bead8 . Just want to check, is this the same issue that’s being reported as part of issue BCLOUD-19395 ?

            I don’t understand how this relates to the issue I was reporting. First of all, this is branch pipelines, not branch restrictions. I understand the limitation of one deployment at a time per environment. The issue I have is that I cannot resume the paused builds because the resume logic for branch restrictions does not match the overall build deployment logic. Builds for pull requests do not cause a deployment permissions error unless the build was paused due to an ongoing deployment. Bitbucket Pipeline is fully capable of deploying my pull requests to my deployment environment without errors of there is no ongoing build. The issue, as I have stated multiple times, is that the resume button on the paused build is checking against the name of the pull request, instead of the actual branch of the pull request. Obviously the pipeline can actually deploy to the environment because it works 99.9% of the time.

            Daniel Petty added a comment - I don’t understand how this relates to the issue I was reporting. First of all, this is branch pipelines, not branch restrictions. I understand the limitation of one deployment at a time per environment. The issue I have is that I cannot resume the paused builds because the resume logic for branch restrictions does not match the overall build deployment logic. Builds for pull requests do not cause a deployment permissions error unless the build was paused due to an ongoing deployment. Bitbucket Pipeline is fully capable of deploying my pull requests to my deployment environment without errors of there is no ongoing build. The issue, as I have stated multiple times, is that the resume button on the paused build is checking against the name of the pull request, instead of the actual branch of the pull request. Obviously the pipeline can actually deploy to the environment because it works 99.9% of the time.

            Aneita added a comment -

            Hi,

            I wasn’t able to reproduce this issue. Do you have an example of this issue so that we can look into it in more details?

            Thanks,

            Aneita

            Aneita added a comment - Hi, I wasn’t able to reproduce this issue. Do you have an example of this issue so that we can look into it in more details? Thanks, Aneita

              ayang@atlassian.com Aneita
              lmontiel@atlassian.com Leonardo M
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: