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

Add specific pipelines configuration for Pull Request events

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Pipelines are triggered by push. There is the possibility to configure a number of other webhooks, e.g. 'on pull request'. However it is not possible to connect them with a pipeline and disable or reconfigure the default 'Pipelines' webhook which triggers on push.

      If it were possible to have different webhooks as triggers and distinguish between them inside the pipeline it would enable:

      • to configure different pipelines for different events (webhooks), e.g.:
       - just unit tests with fast feedback loop for every change on feature branch,
      
       - heavy, time consuming quality assurance for pull request;
      
      • better integration with "Sonar for Bitbucket Cloud", especially with respect to the "Shows Sonar code issues in pull requests" feature

            [BCLOUD-13438] Add specific pipelines configuration for Pull Request events

            Mauricio Junior added a comment - - edited

            I simply cannot believe that such an obvious use case is not possible, which is to have the Pipeline be triggered when a Pull request is performed against a specific branch.

            Mauricio Junior added a comment - - edited I simply cannot believe that such an obvious use case is not possible, which is to have the Pipeline be triggered when a Pull request is performed against a specific branch.

            How should I do a pull request through multiple branches from different repositories? Do I need to do the fork for all of my repos and add them into a project, and see if it works or not?

            Alan Andres Haro added a comment - How should I do a pull request through multiple branches from different repositories? Do I need to do the fork for all of my repos and add them into a project, and see if it works or not?

            This feature seems to work very well within a repository, but not when you open a pull request from a fork back to the main repo. Does that count as a separate feature (see Aneita Yang’s sticky post re: ‘if this doesn’t do what you want, open an issue', or would it be a dupe of [pipelines for pull requests from forks|BCLOUD-13162%3F_ga%3D2.128772748.1000000455.1560536725-29546397.1531695922]?)

            maxgrenderjones added a comment - This feature seems to work very well within a repository, but not when you open a pull request from a fork back to the main repo. Does that count as a separate feature (see Aneita Yang’s sticky post re: ‘if this doesn’t do what you want, open an issue', or would it be a dupe of [pipelines for pull requests from forks|BCLOUD-13162%3F_ga%3D2.128772748.1000000455.1560536725-29546397.1531695922] ?)

            If you want to run regardless of destination I suppose the current setup is fine, but do you care about the source at all? I.e. would using a wildcard in a reverse setup work the same for your use case?

            Joakim Hedlund added a comment - If you want to run regardless of destination I suppose the current setup is fine, but do you care about the source at all? I.e. would using a wildcard in a reverse setup work the same for your use case?

            You could check destination in a script if that fits your use case, I guess. For our use case, we want PRs to run pipeline regardless of destination.

            Emil Johnsson added a comment - You could check destination in a script if that fits your use case, I guess. For our use case, we want PRs to run pipeline regardless of destination.

            to make sure merged PRs won't break.

            Sure, but even then I only care about merges to specific branches, so the way I see it triggering based on source is just a waste of build minutes.

            Joakim Hedlund added a comment - to make sure merged PRs won't break. Sure, but even then I only care about merges to specific branches, so the way I see it triggering based on source is just a waste of build minutes.

            I fail to see a usecase for the PR pipelines in their current form

            I think the biggest use case is to run tests to make sure merged PRs won't break. And that's a pretty big use case (hence the most voted issue on here).

            I can see your use case for destination based pipeline as well, for deployment purposes. Glad to see an issue created for that

            Emil Johnsson added a comment - I fail to see a usecase for the PR pipelines in their current form I think the biggest use case is to run tests to make sure merged PRs won't break. And that's a pretty big use case (hence the most voted issue on here). I can see your use case for destination based pipeline as well, for deployment purposes. Glad to see an issue created for that

            MWulff added a comment -

            @joakimhedlunddanielwellington

            I just saw your comment. I agree :100:%

            A few days before your comment I actually made an issue / feature request for having pull-request triggers for pipelines based on destination branch:

            BCLOUD-17859

            Please add your input there as well so we can get more people involved in making this reques a priority for
            Atlassian / @gcrain / @davinaaa

            MWulff added a comment - @joakimhedlunddanielwellington I just saw your comment. I agree :100:% A few days before your comment I actually made an issue / feature request for having pull-request triggers for pipelines based on destination branch: BCLOUD-17859 Please add your input there as well so we can get more people involved in making this reques a priority for Atlassian / @gcrain / @davinaaa

            Thanks for getting back to me @gcrain

            I would argue that the deployment strategy should be left to the user to decide on. However, I fail to see a usecase for the PR pipelines in their current form. Could you provide an example of how they're meant to be used?

            Joakim Hedlund added a comment - Thanks for getting back to me @gcrain I would argue that the deployment strategy should be left to the user to decide on. However, I fail to see a usecase for the PR pipelines in their current form. Could you provide an example of how they're meant to be used?

            Hi @joakimhedlunddanielwellington,

            the branch pattern under pull requests defines the source branch. This is so that you can run a different pipeline depending on the fix. For example you may have a different set of tests for feature branches vs hotfix branches. Note that this is only talking about the tests that run against the PR during development.

            In the case you describe, it sounds like you just want a branch build against master. Or rather, you don't want to deploy to staging from a PR / feature branch - this would break as soon as you have a second PR opened.

            Hope this helps

            Cheers,
            Geoff

            Geoff Crain (Inactive) added a comment - Hi @joakimhedlunddanielwellington, the branch pattern under pull requests defines the source branch. This is so that you can run a different pipeline depending on the fix. For example you may have a different set of tests for feature branches vs hotfix branches. Note that this is only talking about the tests that run against the PR during development. In the case you describe, it sounds like you just want a branch build against master. Or rather, you don't want to deploy to staging from a PR / feature branch - this would break as soon as you have a second PR opened. Hope this helps Cheers, Geoff

              Unassigned Unassigned
              b88d71034f35 Marian Jureczko
              Votes:
              142 Vote for this issue
              Watchers:
              124 Start watching this issue

                Created:
                Updated:
                Resolved: