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

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

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            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

            mottaviani 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
            maximkulkin 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.

            maximkulkin 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.
            mottaviani 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
             }
            
            mottaviani 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 }

            recena why did you close this?

            amuniz Antonio Muñiz added a comment - recena why did you close this?

            amuniz It is duplicated.

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

            No.

            amuniz Antonio Muñiz added a comment - No.

            amuniz I'm sorry, I did not see that this issue is the same than JENKINS-33161 but for Bitbucket.

            recena Manuel Recena Soto added a comment - amuniz I'm sorry, I did not see that this issue is the same than JENKINS-33161 but for Bitbucket.

            This issue will be likely covered by JENKINS-36283

            amuniz Antonio Muñiz added a comment - This issue will be likely covered by JENKINS-36283
            jamesdumay James Dumay added a comment -

            I believe JENKINS-43507 contains this functionality and is due to be released in a few weeks.

            jamesdumay James Dumay added a comment - I believe JENKINS-43507 contains this functionality and is due to be released in a few weeks.

            People

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

              Dates

                Created:
                Updated:
                Resolved: