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

Origin branches disappear when there is a fork with the same branch name

XMLWordPrintable

      Steps to recreate:

      1. Create a fork of a GitHub repo (in this example, originalRepo). Do not create a GitHub Branch Source multibranch project for this yet.
      2. In this new fork, make changes in your master branch. (Actually, any branch will probably do, I just picked master)
      3. Push the change to your newly-created fork.
      4. Create a PR from your fork/master, to the original repo/master.

      5. Now, create your multibranch project for originalRepo. Make sure that the Discover Branches strategy is set to the default of Only branches that are not also filed as PRs.

      6. Examine the Scan Repository log. You'll see something like this:

      Examining cloudbees/quality-assurance
        Checking branches...
        Getting remote branches...
          Checking branch master
        Getting remote pull requests...
      

      Notice that there's no Met Criteria or Does not Meet Criteria message. This is a tell.

      7. Go back to the top of your project for originalRepo. There's no master branch shown.

      8. In GitHub, merge (or merge/close) the PR.
      9. Rescan.
      10. The master branch will appear.

        1. screenshot-1.png
          screenshot-1.png
          515 kB
        2. screenshot-2.png
          screenshot-2.png
          546 kB
        3. screenshot-3.png
          screenshot-3.png
          653 kB
        4. screenshot-4.png
          screenshot-4.png
          653 kB
        5. screenshot-5.png
          screenshot-5.png
          525 kB
        6. screenshot-6.png
          screenshot-6.png
          555 kB

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

              Created:
              Updated:
              Resolved: