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

On first index after upgrade to 2.0.0 all open PRs are rebuilt

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      See https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/470cd820d33002661370f34e4b6b739560ad9c7c/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/SCMHeadWithOwnerAndRepo.java#L65-L67

      Now that there is the SCMHeadMigration API we can attempt to fix the issue during item loading by querying bitbucket to get the list of targets for each PR (which was not possible from readResolve() as the head does not contain details of the target repository so we cannot look up the target branch in the target repository! (However once we have the SCMSource we can ask the target repository for the target branch of the PR with id = XYZ and all is right in the world again)

      NOTE If the connection to BitBucket fails while Jenkins is loading all the jobs, a rebuild will be triggered on the next index as failing to load the job (the only alternative) would not only trigger a rebuild anyway, but would also overwrite old builds... hence it is the lesser of two evils.

        Attachments

          Issue Links

            Activity

            Show
            amuniz Antonio Muñiz added a comment - https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/33
            Hide
            stephenconnolly Stephen Connolly added a comment -

            scm-api-2.0.2
            git-2.6.4 or git-3.0.4
            branch-api-2.0.2
            bitbucket-branch-source-2.0.2
            github-branch-source-2.0.1
            cloudbees-folder-5.17
            workflow-multibranch-2.11

            Show
            stephenconnolly Stephen Connolly added a comment - scm-api-2.0.2 git-2.6.4 or git-3.0.4 branch-api-2.0.2 bitbucket-branch-source-2.0.2 github-branch-source-2.0.1 cloudbees-folder-5.17 workflow-multibranch-2.11

              People

              • Assignee:
                stephenconnolly Stephen Connolly
                Reporter:
                stephenconnolly Stephen Connolly
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: