Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-33739

BitBucket: Add and option to enable/disable pull requests from origin repository

      If a developer creates a feature branch and a corresponding Pull-Request, we wind up with two jobs doing basically the same thing. Once for the branch itself, and one labeled with the Pull Request Number.

      Scenario: Create a feature/whatever and open a PR to merge to master:

      • When a feature/whatever branch is created a build is trigger.
      • When a PR is open to merge feature/whatever to development, the PR project is created in Jenkins, triggering the "same build" as above.

      It would be nice to have the option to disable this behavior.

          [JENKINS-33739] BitBucket: Add and option to enable/disable pull requests from origin repository

          Allan BURDAJEWICZ created issue -

          To capture some of jglick's notes on this:

          This is about avoiding creation of duplicate branch projects for “origin” PRs, which should be a explicit option, if not the default

          Mark Ottaviani added a comment - To capture some of jglick 's notes on this: This is about avoiding creation of duplicate branch projects for “origin” PRs, which should be a explicit option, if not the default

          Maxim Kulkin added a comment -

          Same here. Actually, for building PRs I plan to use a slightly different multibranch project (which merges PR into target branch and builds the result) or even use Bitbucket Pullrequest Builder plugin (which does that). So I would like to be able to include/exclude branches and/or PRs.

          Maxim Kulkin added a comment - Same here. Actually, for building PRs I plan to use a slightly different multibranch project (which merges PR into target branch and builds the result) or even use Bitbucket Pullrequest Builder plugin (which does that). So I would like to be able to include/exclude branches and/or PRs.

          Mark Ottaviani added a comment - - edited

          If it's helpful for anyone running into this issue, we're using this at the top of our Jenkinsfiles as a temporary workaround. These projects don't get Pull requests from outside of origin/ so if you do, then you'll probably want something a little different here.

          if ((env.BRANCH_NAME.substring(0,3)) == 'PR-') {
              manager.addInfoBadge("Duplicate Job, see the job with your branch name.")
              manager.buildSuccess()
              return
           }
          

          Mark Ottaviani added a comment - - edited If it's helpful for anyone running into this issue, we're using this at the top of our Jenkinsfiles as a temporary workaround. These projects don't get Pull requests from outside of origin/ so if you do, then you'll probably want something a little different here. if ((env.BRANCH_NAME.substring(0,3)) == 'PR-' ) { manager.addInfoBadge( "Duplicate Job, see the job with your branch name." ) manager.buildSuccess() return }
          Manuel Recena Soto made changes -
          Link New: This issue is duplicated by JENKINS-33161 [ JENKINS-33161 ]
          Manuel Recena Soto made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          recena why did you close this?

          Antonio Muñiz added a comment - recena why did you close this?
          Antonio Muñiz made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Antonio Muñiz made changes -
          Link Original: This issue is duplicated by JENKINS-33161 [ JENKINS-33161 ]

          amuniz It is duplicated.

          Manuel Recena Soto added a comment - amuniz It is duplicated.

            amuniz Antonio Muñiz
            allan_burdajewicz Allan BURDAJEWICZ
            Votes:
            7 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: