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

Branches saved off of non-master cause false "duplicate name" error, don't save content

    XMLWordPrintable

    Details

    • Sprint:
      Blue Ocean 1.0-rc3
    • Similar Issues:

      Description

      It looks like github is treating the default branch (nominally master) specially - and this is causing the "save as branch" to only work  properly off the master branch. 

       

      If you try to save from a non default branch, it will just save the content from the master branch to the new branch, and incorreclty report it as a duplicate when trying to save the changed content. 

       

      Write up: 
      When editing a Declarative Pipeline Jenkinsfile on the master branch, and adding it to a new branch from the editor, everything works great. But if you edit the Jenkinsfile in the branch created in the editor, and try to create a new branch from there, the branch gets created before the changes to the Jenkinsfile are saved.

      Steps to recreate:
      1. Make a change to your Jenkinsfile using the editor, and save it to a new branch. Here's a screenshot of this step already completed, where the branch I created is called "CreateANewBranchForNoReason"

      2. Provide a description of the change, and a new branch name.
      3. Click "Save & run." Notice that you get an error back, saying the branch already exists:

      4. Flip over to GitHub itself, and look at your repository. The branch has been created:

      5. The only way to dismiss the popup is to click Cancel.
      6. Also note that the "Updated" information shown in GitHub is way wrong, by 5 hours. It's reporting 5 hours ago, when I actually ran through these steps about 10 minutes ago:

        Attachments

          Activity

          Hide
          kshultz Karl Shultz added a comment -

          I mentioned this having something to do with not being on master when making the edit because, it's the only time I've ever seen this behavior. New branches created after editing "from master," so to speak, look like they're behaving just fine.

          Also worth mentioning: the new Jenkinsfile in the incorrectly-created branch does not have any of the changes I've made.

          Show
          kshultz Karl Shultz added a comment - I mentioned this having something to do with not being on master when making the edit because, it's the only time I've ever seen this behavior. New branches created after editing "from master," so to speak, look like they're behaving just fine. Also worth mentioning: the new Jenkinsfile in the incorrectly-created branch does not have any of the changes I've made.
          Hide
          jamesdumay James Dumay added a comment -

          Seems like a race condition and deserves an investigation

          Show
          jamesdumay James Dumay added a comment - Seems like a race condition and deserves an investigation
          Hide
          michaelneale Michael Neale added a comment - - edited

          Right yes I can see this, it is exclusively when not off master. I think there is some misunderstanding/misuse of the github api causing this confusion. Definitely a problem.

           I also tried this with a newer branch with some other improvements, still there. Should be solvable. 

          Show
          michaelneale Michael Neale added a comment - - edited Right yes I can see this, it is exclusively when not off master. I think there is some misunderstanding/misuse of the github api causing this confusion. Definitely a problem.  I also tried this with a newer branch with some other improvements, still there. Should be solvable. 
          Hide
          michaelneale Michael Neale added a comment -

          THis astually just saves content from master - which is wrong. 

          Show
          michaelneale Michael Neale added a comment - THis astually just saves content from master - which is wrong. 
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Keith Zantow
          Path:
          src/main/js/EditorPage.jsx
          src/main/js/SaveApi.js
          http://jenkins-ci.org/commit/blueocean-pipeline-editor-plugin/d2e6795aa60bbcd62d11c38df30939d65d07fd69
          Log:
          JENKINS-43014 save to/from branches properly, use optimized indexing (#35)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Keith Zantow Path: src/main/js/EditorPage.jsx src/main/js/SaveApi.js http://jenkins-ci.org/commit/blueocean-pipeline-editor-plugin/d2e6795aa60bbcd62d11c38df30939d65d07fd69 Log: JENKINS-43014 save to/from branches properly, use optimized indexing (#35)

            People

            • Assignee:
              kzantow Keith Zantow
              Reporter:
              kshultz Karl Shultz
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: