• 18
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      It would be nice to have the stash/bamboo integration (and more generally any CI server) automatically build/CI pull requests.

      This is similar to STASH-3196, but once stash/bamboo is linked its not possible to watch refs/pull-requests/*/merge.

      As a workaround we may end up writing a pullrequestopened/rescoped/closed hook that creates/modifies/deletes a 'real' branch for bamboo to pick up, but it would be good to support this out of the box.

      Raised this against Stash rather than Bamboo because I suspect that Stash would have to do the triggering?

            [BSERV-5112] Ability to have CI automatically build pull-requests

            Jan Nylund added a comment -

            Thanks Krystian!

            Jan Nylund added a comment - Thanks Krystian!

            jan1265707373 I've created https://jira.atlassian.com/browse/BAM-18459 to track your request. If you have any more comments please post it there.

            Krystian Brazulewicz added a comment - jan1265707373 I've created https://jira.atlassian.com/browse/BAM-18459  to track your request. If you have any more comments please post it there.

            Jan Nylund added a comment -

            Alexey: Nope, I got one branch where the last command does different things depending on:

            • if branch == master run static analysis and store to server for historic followup
            • if branch != master and PR exists run diff analysis and comment on code
            • if branch != master and nor PR exist skip analysis

            I've considered two plans, but that means that either:

            • Plan A is a subset of plan B. (which is kinda useless, especially from a maintenance point of view), or:
            • Plan B relies on artifacts from plan A (test-results, binaries, etc). Which can cause an synchronisation error if PR is created ruing build of plan A.

            Jan Nylund added a comment - Alexey: Nope, I got one branch where the last command does different things depending on: if branch == master run static analysis and store to server for historic followup if branch != master and PR exists run diff analysis and comment on code if branch != master and nor PR exist skip analysis I've considered two plans, but that means that either: Plan A is a subset of plan B. (which is kinda useless, especially from a maintenance point of view), or: Plan B relies on artifacts from plan A (test-results, binaries, etc). Which can cause an synchronisation error if PR is created ruing build of plan A.

            jan1265707373, correct me if I'm wrong

            You have repository and two different plans:

            • plan A with automatic branch detection with tests etc, it should be green even before PR is created
            • plan B with automatic branch detection with some static analysis tasks. It detects if there's PR for that branch and leaves comment on it. 

            Right now plan B should to be started by developers manually when they create PR, plan detects there's PR and leaves comment with build results. 

            If it's correct config then why don't use pull request branch detection for plan B? Unless your developers look at plan B results before they create PR

            Alexey Chystoprudov added a comment - jan1265707373 , correct me if I'm wrong You have repository and two different plans: plan A with automatic branch detection with tests etc, it should be green even before PR is created plan B with automatic branch detection with some static analysis tasks. It detects if there's PR for that branch and leaves comment on it.  Right now plan B should to be started by developers manually when they create PR, plan detects there's PR and leaves comment with build results.  If it's correct config then why don't use pull request branch detection for plan B? Unless your developers look at plan B results before they create PR

            Jan Nylund added a comment -

            Alexey: I have a workflow that includes doing static analysis on the master, and differential static analysis on PR's, where the result of the analysis is automatically added into Bitbucket PR as code comments. 

            Typically developers create branches from within JIRA and start working on them. Each time they commit we build to ensure that tests are passing, etc. but at this stage no analysis is run. When the developer thinks code is ready to merge, he/she creates a PR and then need to manually trigger the feature plan branch to run again, so we can get differential analysis run and code comments into code review.

             

            Using Bamboo 6.0.x this could work if I skipped the idea of building my branches before making a PR, but that is not something that we are currently ready to do.

            Jan Nylund added a comment - Alexey: I have a workflow that includes doing static analysis on the master, and differential static analysis on PR's, where the result of the analysis is automatically added into Bitbucket PR as code comments.  Typically developers create branches from within JIRA and start working on them. Each time they commit we build to ensure that tests are passing, etc. but at this stage no analysis is run. When the developer thinks code is ready to merge, he/she creates a PR and then need to manually trigger the feature plan branch to run again, so we can get differential analysis run and code comments into code review.   Using Bamboo 6.0.x this could work if I skipped the idea of building my branches before making a PR, but that is not something that we are currently ready to do.

            jan1265707373, can you please describe use case when build should be retriggered when PR is created? The only scenario I see is about plan with no triggers and user wants branch build to be triggered when PR is opened for that branch.

            Info about PR in build variables is part of another request BAM-18350.

            Alexey Chystoprudov added a comment - jan1265707373 , can you please describe use case when build should be retriggered when PR is created? The only scenario I see is about plan with no triggers and user wants branch build to be triggered when PR is opened for that branch. Info about PR in build variables is part of another request  BAM-18350 .

            Jan Nylund added a comment -

            Alexey: This is a nice added feature, but it lacks the possibility to retrigger a build once PR is created. And there are no variables available in Bamboo for PR information (as far as I saw?). 

             

            Jan Nylund added a comment - Alexey: This is a nice added feature, but it lacks the possibility to retrigger a build once PR is created. And there are no variables available in Bamboo for PR information (as far as I saw?).   

            Alexey Chystoprudov added a comment - - edited

            Bamboo 6.0 can detect pull requests from Bitbucket Server and create plan branch when PR created. Plan branch will be disabled when PR merged/declined.
            Check Release Notes and Bamboo integration documentation for more details.

            Alexey Chystoprudov added a comment - - edited Bamboo 6.0 can detect pull requests from Bitbucket Server and create plan branch when PR created. Plan branch will be disabled when PR merged/declined. Check Release Notes and Bamboo integration documentation for more details.

            We would like support for this in our Bitbucket server/Bamboo pipeline as well.  It has the potential to reduce the load on our Bamboo agents which would be great.

            Terry Phillips added a comment - We would like support for this in our Bitbucket server/Bamboo pipeline as well.  It has the potential to reduce the load on our Bamboo agents which would be great.

            gsep-support, we're working on a range of improvements to the integrations between Bamboo and Bitbucket Server. This suggestion falls within the set of possible improvements, but we don't have more details to share at this time.

            Roger Barnes (Inactive) added a comment - gsep-support , we're working on a range of improvements to the integrations between Bamboo and Bitbucket Server. This suggestion falls within the set of possible improvements, but we don't have more details to share at this time.

              Unassigned Unassigned
              06fbb7509c24 Bradley Baetz
              Votes:
              53 Vote for this issue
              Watchers:
              30 Start watching this issue

                Created:
                Updated: