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

      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.

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

              Created:
              Updated:
              Resolved: