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

Unable to select a branch source when creating new multi-branch item.

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      branch-api 2.6.3, cloudbees-folder 6.15

      Description

      Clicking on a source type on a new item doesn't display the SCM form.

      After clicking the GitHub (or other source types) the dropdown menu closes and the form is not displayed.

      Expected: Click on GitHub in the Branch Sources dropdown menu and the GitHub form pops up.

       

      See attachment.

        Attachments

        1. image-2020-10-30-07-02-43-834.png
          image-2020-10-30-07-02-43-834.png
          48 kB
        2. Jenkins-Ticket.gif
          Jenkins-Ticket.gif
          309 kB
        3. screenshot-1.png
          screenshot-1.png
          58 kB
        4. screenshot-2.png
          screenshot-2.png
          4 kB
        5. selectSource.png
          selectSource.png
          14 kB

          Issue Links

            Activity

            wgillaspy William Gillaspy created issue -
            timja Tim Jacomb made changes -
            Field Original Value New Value
            Assignee Tim Jacomb [ timja ]
            timja Tim Jacomb made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            timja Tim Jacomb made changes -
            Component/s branch-api-plugin [ 18621 ]
            Hide
            timja Tim Jacomb added a comment -

            this (https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/resources/lib/branch-api/branchSourceSelector.jelly) seems to be a customised version of hetero-list, and some change probably needs to be ported from core. Here's my branch with where I got to but it didn't seem to help: https://github.com/jenkinsci/branch-api-plugin/compare/master...timja:JENKINS-64069-tables-to-divs?expand=1

            help wanted , I'll try look again tomorrow or later on.

            Show
            timja Tim Jacomb added a comment - this ( https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/resources/lib/branch-api/branchSourceSelector.jelly ) seems to be a customised version of hetero-list, and some change probably needs to be ported from core. Here's my branch with where I got to but it didn't seem to help:  https://github.com/jenkinsci/branch-api-plugin/compare/master...timja:JENKINS-64069-tables-to-divs?expand=1 help wanted , I'll try look again tomorrow or later on.
            Hide
            fqueiruga Félix Queiruga Balado added a comment -
            Show
            fqueiruga Félix Queiruga Balado added a comment - This may be related to  https://issues.jenkins-ci.org/browse/JENKINS-62825
            timja Tim Jacomb made changes -
            Link This issue is related to JENKINS-62825 [ JENKINS-62825 ]
            timja Tim Jacomb made changes -
            Status In Progress [ 3 ] Open [ 1 ]
            Hide
            oleg_nenashev Oleg Nenashev added a comment -
            Show
            oleg_nenashev Oleg Nenashev added a comment - Looks so Félix Queiruga Balado
            timja Tim Jacomb made changes -
            Link This issue is related to JENKINS-64072 [ JENKINS-64072 ]
            timja Tim Jacomb made changes -
            Labels tables-to-divs-regression
            reinholdfuereder Reinhold Füreder made changes -
            Attachment image-2020-10-30-07-02-43-834.png [ 53106 ]
            Hide
            reinholdfuereder Reinhold Füreder added a comment -

            Tim Jacomb Sorry, is this by accident another failure symptom of this issue, or should I file a dedicated new one?

            • configuration > global pipeline libraries: configured is one from SVN, but some GitHub related elements are overlay-ing it
              • (Much further down are also buttons "Add repository" and "Add branch")

             

             

            Show
            reinholdfuereder Reinhold Füreder added a comment - Tim Jacomb Sorry, is this by accident another failure symptom of this issue, or should I file a dedicated new one? configuration > global pipeline libraries: configured is one from SVN, but some GitHub related elements are overlay-ing it (Much further down are also buttons "Add repository" and "Add branch")    
            timja Tim Jacomb made changes -
            Assignee Tim Jacomb [ timja ]
            timja Tim Jacomb made changes -
            Assignee Tim Jacomb [ timja ]
            timja Tim Jacomb made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            timja Tim Jacomb made changes -
            Remote Link This issue links to "cloudbees-folder-plugin/pull/165 (Web Link)" [ 26203 ]
            timja Tim Jacomb made changes -
            Remote Link This issue links to "branch-api-plugin/pull/226 (Web Link)" [ 26204 ]
            Hide
            timja Tim Jacomb added a comment -

            Reinhold Füreder that should be a different issue, this issue is about it being completely broken and doing nothing when you click Add source.

            I've reproduced your issue and can take a look at it later on, note it's not fixed by the changes I've done to fix this issue.

            Show
            timja Tim Jacomb added a comment - Reinhold Füreder that should be a different issue, this issue is about it being completely broken and doing nothing when you click Add source. I've reproduced your issue and can take a look at it later on, note it's not fixed by the changes I've done to fix this issue.
            Hide
            timja Tim Jacomb added a comment -

            Partially resolved this issue in branch-api 2.6.1, https://github.com/jenkinsci/branch-api-plugin/releases/tag/branch-api-2.6.1.

            More fixes needed in other plugins. Needs at least https://github.com/jenkinsci/cloudbees-folder-plugin/pull/165 and probably more

            Show
            timja Tim Jacomb added a comment - Partially resolved this issue in branch-api 2.6.1, https://github.com/jenkinsci/branch-api-plugin/releases/tag/branch-api-2.6.1 . More fixes needed in other plugins. Needs at least https://github.com/jenkinsci/cloudbees-folder-plugin/pull/165 and probably more
            Show
            timja Tim Jacomb added a comment - Reinhold Füreder I created https://issues.jenkins-ci.org/browse/JENKINS-64136
            timja Tim Jacomb made changes -
            Attachment screenshot-1.png [ 53239 ]
            Hide
            timja Tim Jacomb added a comment - - edited

            The next issue occurring when saving:

            Seems to occur because of different json being submitted. note the missing source wrapper

            working:

            {
              "displayNameOrNull": "",
              "description": "",
              "disable": false,
              "sources": {
                "source": {
                  "stapler-class": "jenkins.scm.impl.SingleSCMSource",
                  "id": "9cca4d61-4e24-475e-bb31-7278e355e6f5",
                  "name": "multibranch",
                  "": "0",
                  "scm": {
                    "userRemoteConfigs": {
                      "url": "https://github.com/timja-org/junit-attachments-test/",
                      "includeUser": "false",
                      "credentialsId": "",
                      "name": "",
                      "refspec": ""
                    },
                    "branches": {
                      "name": "*/master"
                    },
                    "": "auto",
                    "stapler-class": "hudson.plugins.git.GitSCM",
                    "$class": "hudson.plugins.git.GitSCM"
                  }
                },
                "": "0",
                "strategy": {
                  "stapler-class": "jenkins.branch.DefaultBranchPropertyStrategy",
                  "$class": "jenkins.branch.DefaultBranchPropertyStrategy"
                },
                "stapler-class": "jenkins.branch.BranchSource",
                "kind": "jenkins.branch.BranchSource"
              },
              "": [
                "0",
                "1"
              ],
              "projectFactory": {
                "scriptPath": "Jenkinsfile",
                "stapler-class": "org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory",
                "$class": "org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory"
              },
              "orphanedItemStrategy": {
                "stapler-class": "com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy",
                "$class": "com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy",
                "pruneDeadBranches": true,
                "daysToKeepStr": "",
                "numToKeepStr": ""
              },
              "icon": {
                "stapler-class": "jenkins.branch.MetadataActionFolderIcon",
                "$class": "jenkins.branch.MetadataActionFolderIcon"
              },
              "core:apply": "",
              "Jenkins-Crumb": "52ae8303c473373a97598b65ba5b7b453cf6b0e2f5601c362001de51dbcd4d95"
            }
            

            broken:

            {
              "displayNameOrNull": "",
              "description": "",
              "disable": false,
              "sources": {
                "stapler-class": [
                  "jenkins.scm.impl.SingleSCMSource",
                  "jenkins.branch.BranchSource"
                ],
                "id": "d25aeca3-e276-486c-b9b4-463642963444",
                "name": "something-cool",
                "": [
                  "0",
                  "0"
                ],
                "scm": {
                  "userRemoteConfigs": {
                    "url": "https://github.com/timja-org/junit-attachments-test",
                    "includeUser": "false",
                    "credentialsId": "",
                    "name": "",
                    "refspec": ""
                  },
                  "branches": {
                    "name": "*/master"
                  },
                  "": "auto",
                  "stapler-class": "hudson.plugins.git.GitSCM",
                  "$class": "hudson.plugins.git.GitSCM"
                },
                "strategy": {
                  "stapler-class": "jenkins.branch.DefaultBranchPropertyStrategy",
                  "$class": "jenkins.branch.DefaultBranchPropertyStrategy"
                },
                "kind": "jenkins.branch.BranchSource"
              },
              "": [
                "0",
                "1"
              ],
              "projectFactory": {
                "scriptPath": "Jenkinsfile",
                "stapler-class": "org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory",
                "$class": "org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory"
              },
              "orphanedItemStrategy": {
                "stapler-class": "com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy",
                "$class": "com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy",
                "pruneDeadBranches": true,
                "daysToKeepStr": "",
                "numToKeepStr": ""
              },
              "icon": {
                "stapler-class": "jenkins.branch.MetadataActionFolderIcon",
                "$class": "jenkins.branch.MetadataActionFolderIcon"
              },
              "healthMetrics": {
                "recursive": true,
                "stapler-class": "com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric",
                "$class": "com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric"
              },
              "core:apply": "",
              "Jenkins-Crumb": "7f9c1ca3889be930ae668727e6e8ba1ad7b74e4d83edc9604ff038312799b5cc"
            }
            
            Show
            timja Tim Jacomb added a comment - - edited The next issue occurring when saving: Seems to occur because of different json being submitted. note the missing source wrapper working: { "displayNameOrNull" : "", "description" : "", "disable" : false , "sources" : { "source" : { "stapler-class" : "jenkins.scm.impl.SingleSCMSource" , "id" : "9cca4d61-4e24-475e-bb31-7278e355e6f5" , "name" : "multibranch" , "": " 0", "scm" : { "userRemoteConfigs" : { "url" : "https: //github.com/timja-org/junit-attachments-test/" , "includeUser" : " false " , "credentialsId" : "", "name" : "", "refspec" : "" }, "branches" : { "name" : "*/master" }, "": " auto", "stapler-class" : "hudson.plugins.git.GitSCM" , "$class" : "hudson.plugins.git.GitSCM" } }, "": " 0", "strategy" : { "stapler-class" : "jenkins.branch.DefaultBranchPropertyStrategy" , "$class" : "jenkins.branch.DefaultBranchPropertyStrategy" }, "stapler-class" : "jenkins.branch.BranchSource" , "kind" : "jenkins.branch.BranchSource" }, "": [ "0" , "1" ], "projectFactory" : { "scriptPath" : "Jenkinsfile" , "stapler-class" : "org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory" , "$class" : "org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory" }, "orphanedItemStrategy" : { "stapler-class" : "com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" , "$class" : "com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" , "pruneDeadBranches" : true , "daysToKeepStr" : "", "numToKeepStr" : "" }, "icon" : { "stapler-class" : "jenkins.branch.MetadataActionFolderIcon" , "$class" : "jenkins.branch.MetadataActionFolderIcon" }, "core:apply" : "", "Jenkins-Crumb" : "52ae8303c473373a97598b65ba5b7b453cf6b0e2f5601c362001de51dbcd4d95" } broken: { "displayNameOrNull" : "", "description" : "", "disable" : false , "sources" : { "stapler-class" : [ "jenkins.scm.impl.SingleSCMSource" , "jenkins.branch.BranchSource" ], "id" : "d25aeca3-e276-486c-b9b4-463642963444" , "name" : "something-cool" , "": [ "0" , "0" ], "scm" : { "userRemoteConfigs" : { "url" : "https: //github.com/timja-org/junit-attachments-test" , "includeUser" : " false " , "credentialsId" : "", "name" : "", "refspec" : "" }, "branches" : { "name" : "*/master" }, "": " auto", "stapler-class" : "hudson.plugins.git.GitSCM" , "$class" : "hudson.plugins.git.GitSCM" }, "strategy" : { "stapler-class" : "jenkins.branch.DefaultBranchPropertyStrategy" , "$class" : "jenkins.branch.DefaultBranchPropertyStrategy" }, "kind" : "jenkins.branch.BranchSource" }, "": [ "0" , "1" ], "projectFactory" : { "scriptPath" : "Jenkinsfile" , "stapler-class" : "org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory" , "$class" : "org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory" }, "orphanedItemStrategy" : { "stapler-class" : "com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" , "$class" : "com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" , "pruneDeadBranches" : true , "daysToKeepStr" : "", "numToKeepStr" : "" }, "icon" : { "stapler-class" : "jenkins.branch.MetadataActionFolderIcon" , "$class" : "jenkins.branch.MetadataActionFolderIcon" }, "healthMetrics" : { "recursive" : true , "stapler-class" : "com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric" , "$class" : "com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric" }, "core:apply" : "", "Jenkins-Crumb" : "7f9c1ca3889be930ae668727e6e8ba1ad7b74e4d83edc9604ff038312799b5cc" }
            Hide
            fqueiruga Félix Queiruga Balado added a comment - - edited

            I have seen these sort of problem before in this tables-to-divs work. It was related to the ability of hudson-behaviour to build a proper tree. Maybe we need to look into it.

            Show
            fqueiruga Félix Queiruga Balado added a comment - - edited I have seen these sort of problem before in this tables-to-divs work. It was related to the ability of hudson-behaviour to build a proper tree. Maybe we need to look into it.
            jglick Jesse Glick made changes -
            Component/s cloudbees-folder-plugin [ 18137 ]
            timja Tim Jacomb made changes -
            Attachment screenshot-2.png [ 53244 ]
            Hide
            timja Tim Jacomb added a comment -

            seems to be because the div name="source is missing.

            it's here:
            https://github.com/jenkinsci/branch-api-plugin/blob/e69c48a1a01c210a4703fed975ca234d85743cdb/src/main/resources/jenkins/branch/BranchSource/config.jelly#L26

            and when run from hpi:run in branch-api it works but not elsewhere

            Show
            timja Tim Jacomb added a comment - seems to be because the div name="source is missing. it's here: https://github.com/jenkinsci/branch-api-plugin/blob/e69c48a1a01c210a4703fed975ca234d85743cdb/src/main/resources/jenkins/branch/BranchSource/config.jelly#L26 and when run from hpi:run in branch-api it works but not elsewhere
            Hide
            timja Tim Jacomb added a comment -

            this fixes it but breaks compat with old core. Will experiment a bit more but maybe we just raise the baseline.

            $ git diff
            diff --git a/src/main/resources/jenkins/branch/BranchSource/config.jelly b/src/main/resources/jenkins/branch/BranchSource/config.jelly
            index c736737..c8f2850 100644
            --- a/src/main/resources/jenkins/branch/BranchSource/config.jelly
            +++ b/src/main/resources/jenkins/branch/BranchSource/config.jelly
            @@ -23,7 +23,7 @@
              -->
             <?jelly escape-by-default='true'?>
             <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:branch="/lib/branch-api">
            -  <branch:rowWrapper name="source">
            +  <div class="tr" name="source" data-hack="true">
                 <branch:entryWrapper>
                   <input type="hidden" name="stapler-class" value="${sourceDescriptor.clazz.name}"/>
                   <branch:blockWrapper>
            @@ -34,7 +34,7 @@
                     </j:scope>
                   </branch:blockWrapper>
                 </branch:entryWrapper>
            -  </branch:rowWrapper>
            +  </div>
               <j:set var="descriptors" value="${descriptor.propertyStrategyDescriptors(it,sourceDescriptor)}"/>
               <j:if test="${!descriptors.isEmpty()}">
                 <f:block>
            
            Show
            timja Tim Jacomb added a comment - this fixes it but breaks compat with old core. Will experiment a bit more but maybe we just raise the baseline. $ git diff diff --git a/src/main/resources/jenkins/branch/BranchSource/config.jelly b/src/main/resources/jenkins/branch/BranchSource/config.jelly index c736737..c8f2850 100644 --- a/src/main/resources/jenkins/branch/BranchSource/config.jelly +++ b/src/main/resources/jenkins/branch/BranchSource/config.jelly @@ -23,7 +23,7 @@ --> <?jelly escape-by- default = ' true ' ?> <j:jelly xmlns:j= "jelly:core" xmlns:st= "jelly:stapler" xmlns:d= "jelly:define" xmlns:l= "/lib/layout" xmlns:t= "/lib/hudson" xmlns:f= "/lib/form" xmlns:branch= "/lib/branch-api" > - <branch:rowWrapper name= "source" > + <div class= "tr" name= "source" data-hack= " true " > <branch:entryWrapper> <input type= "hidden" name= "stapler-class" value= "${sourceDescriptor.clazz.name}" /> <branch:blockWrapper> @@ -34,7 +34,7 @@ </j:scope> </branch:blockWrapper> </branch:entryWrapper> - </branch:rowWrapper> + </div> <j:set var = "descriptors" value= "${descriptor.propertyStrategyDescriptors(it,sourceDescriptor)}" /> <j: if test= "${!descriptors.isEmpty()}" > <f:block>
            Hide
            fqueiruga Félix Queiruga Balado added a comment -

            If raising the baseline is acceptable I'd say go for it. What's the data-hack for, btw?

            Show
            fqueiruga Félix Queiruga Balado added a comment - If raising the baseline is acceptable I'd say go for it. What's the data-hack for, btw?
            Hide
            timja Tim Jacomb added a comment -

            Just adding an attribute, making sure the jelly was getting reloaded

            Show
            timja Tim Jacomb added a comment - Just adding an attribute, making sure the jelly was getting reloaded
            timja Tim Jacomb made changes -
            Link This issue causes JENKINS-64164 [ JENKINS-64164 ]
            timja Tim Jacomb made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            timja Tim Jacomb made changes -
            Remote Link This issue links to "branch-api-plugin/pull/228 (Web Link)" [ 26300 ]
            Hide
            fqueiruga Félix Queiruga Balado added a comment -

            Ok,makes sense

            Show
            fqueiruga Félix Queiruga Balado added a comment - Ok,makes sense
            dnusbaum Devin Nusbaum made changes -
            Released As branch-api 2.6.3, cloudbees-folder 6.15
            Hide
            dnusbaum Devin Nusbaum added a comment -

            Fixes for this issue have been released in Branch API plugin 2.6.3 and CloudBees Folder plugin 6.15.

            Show
            dnusbaum Devin Nusbaum added a comment - Fixes for this issue have been released in Branch API plugin 2.6.3 and CloudBees Folder plugin 6.15.
            dnusbaum Devin Nusbaum made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]

              People

              Assignee:
              timja Tim Jacomb
              Reporter:
              wgillaspy William Gillaspy
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: