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

Configuration is not saven when two git repositories are added

    XMLWordPrintable

Details

    Description

      The plug-in does not store the configuration when two git repositories are used.

      Steps to reproduce:

      • New Project
      • Select Multi-SCM
      • Add git
      • Enter valid values for the URL and branches
      • Add another git
      • Enter valid values for the URL and branches
      • Save
      • Configure

      => The values for the git repository are empty

      Attachments

        Issue Links

          Activity

            Same issue for even a single Git SCM entry. The high-level config.xml nodes for the Git SCM plug-in are created, though they don't actually take data from the web UI – so they're all just defaults/blank, and the actual XML node that would contain the repo list is missing altogether. I suspect the Multiple SCM plug-in is not handling the repeatable sections properly, or the actual web UI is broken. This in turn could be due to an issue with the git plug-in rather than Multiple SCM. See my previous comment regarding this.

            You can at least hack the config for a Job, in order to get it to work with Git SCM entries. This doesn't solve the problem of viewing/editing the config, but it does allow builds with multiple git repos, which proves that in theory this could work.

            I started with one GitHub SCM entry, created with Multiple SCM's UI. I left it blank when saving, because it won't do any good to fill in details anyway. I then edited ~/.jenkins/jobs/MyJob/config.xml as follows (i.e. specifying a dummy repo here called git@github.com:foo/bar with a working directory of test_1), and restarted Jenkins:

              <scm class="org.jenkinsci.plugins.multiplescms.MultiSCM">
                <scms>
                  <hudson.plugins.git.GitSCM>
                    <configVersion>1</configVersion>
            <!-- *** Added stuff begins here *** -->
                    <remoteRepositories>
                      <org.spearce.jgit.transport.RemoteConfig>
                        <string>origin</string>
                        <int>5</int>
                        <string>fetch</string>
                        <string>+refs/heads/*:refs/remotes/origin/*</string>
                        <string>receivepack</string>
                        <string>git-upload-pack</string>
                        <string>uploadpack</string>
                        <string>git-upload-pack</string>
                        <string>url</string>
                        <string>git@github.com:foo/bar</string>
                        <string>tagopt</string>
                        <string></string>
                      </org.spearce.jgit.transport.RemoteConfig>
                    </remoteRepositories>
                    <branches>
                      <hudson.plugins.git.BranchSpec>
                        <name>**</name>
                      </hudson.plugins.git.BranchSpec>
                    </branches>
                    <mergeOptions/>
            <!-- *** Added stuff ends here *** -->
                    <recursiveSubmodules>false</recursiveSubmodules>
                    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
                    <authorOrCommitter>false</authorOrCommitter>
                    <clean>false</clean>
                    <wipeOutWorkspace>false</wipeOutWorkspace>
                    <pruneBranches>false</pruneBranches>
                    <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
                    <gitTool>Default</gitTool>
            <!-- *** Changed relativeTargetDir: *** -->
                    <relativeTargetDir>test_1</relativeTargetDir>
                    <excludedRegions></excludedRegions>
                    <excludedUsers></excludedUsers>
                    <gitConfigName></gitConfigName>
                    <gitConfigEmail></gitConfigEmail>
                    <skipTag>false</skipTag>
                  </hudson.plugins.git.GitSCM>
                </scms>
              </scm>
            

            Note that originally everything between the <configVersion> and <recursiveSubmodules> nodes was missing, and I copied the <remoteRepositories>, <branches>, and <mergeOptions> nodes from another Job that had a single Git SCM (without Multiple SCM). Also, evidently the <relativeTargetDir> node wasn't being saved either (amongst possibly other options), so I put this in.

            After I verified that the build/clone worked, I then copied the whole <hudson.plugins.git.GitSCM> node as required for additional Git entries. Again, after a restart of Jenkins, I was able to run the build with multiple git clones.

            While this still doesn't seem to show the config when you're editing the Job, it does appear to do the git clone when you build the Job.

            clintel Clintel Systems added a comment - Same issue for even a single Git SCM entry. The high-level config.xml nodes for the Git SCM plug-in are created, though they don't actually take data from the web UI – so they're all just defaults/blank, and the actual XML node that would contain the repo list is missing altogether. I suspect the Multiple SCM plug-in is not handling the repeatable sections properly, or the actual web UI is broken. This in turn could be due to an issue with the git plug-in rather than Multiple SCM. See my previous comment regarding this. You can at least hack the config for a Job, in order to get it to work with Git SCM entries. This doesn't solve the problem of viewing/editing the config, but it does allow builds with multiple git repos, which proves that in theory this could work. I started with one GitHub SCM entry, created with Multiple SCM's UI. I left it blank when saving, because it won't do any good to fill in details anyway. I then edited ~/.jenkins/jobs/MyJob/config.xml as follows (i.e. specifying a dummy repo here called git@github.com:foo/bar with a working directory of test_1 ), and restarted Jenkins: <scm class= "org.jenkinsci.plugins.multiplescms.MultiSCM" > <scms> <hudson.plugins.git.GitSCM> <configVersion> 1 </configVersion> <!-- *** Added stuff begins here *** --> <remoteRepositories> <org.spearce.jgit.transport.RemoteConfig> <string> origin </string> <int> 5 </int> <string> fetch </string> <string> +refs/heads/*:refs/remotes/origin/* </string> <string> receivepack </string> <string> git-upload-pack </string> <string> uploadpack </string> <string> git-upload-pack </string> <string> url </string> <string> git@github.com:foo/bar </string> <string> tagopt </string> <string> </string> </org.spearce.jgit.transport.RemoteConfig> </remoteRepositories> <branches> <hudson.plugins.git.BranchSpec> <name> ** </name> </hudson.plugins.git.BranchSpec> </branches> <mergeOptions/> <!-- *** Added stuff ends here *** --> <recursiveSubmodules> false </recursiveSubmodules> <doGenerateSubmoduleConfigurations> false </doGenerateSubmoduleConfigurations> <authorOrCommitter> false </authorOrCommitter> <clean> false </clean> <wipeOutWorkspace> false </wipeOutWorkspace> <pruneBranches> false </pruneBranches> <buildChooser class= "hudson.plugins.git.util.DefaultBuildChooser" /> <gitTool> Default </gitTool> <!-- *** Changed relativeTargetDir: *** --> <relativeTargetDir> test_1 </relativeTargetDir> <excludedRegions> </excludedRegions> <excludedUsers> </excludedUsers> <gitConfigName> </gitConfigName> <gitConfigEmail> </gitConfigEmail> <skipTag> false </skipTag> </hudson.plugins.git.GitSCM> </scms> </scm> Note that originally everything between the <configVersion> and <recursiveSubmodules> nodes was missing, and I copied the <remoteRepositories> , <branches> , and <mergeOptions> nodes from another Job that had a single Git SCM (without Multiple SCM). Also, evidently the <relativeTargetDir> node wasn't being saved either (amongst possibly other options), so I put this in. After I verified that the build/clone worked, I then copied the whole <hudson.plugins.git.GitSCM> node as required for additional Git entries. Again, after a restart of Jenkins, I was able to run the build with multiple git clones. While this still doesn't seem to show the config when you're editing the Job, it does appear to do the git clone when you build the Job.

            Seems fixed for 0.2.
            Configuration is properly saved (Jenkins 1.444 + Multiple SCMs plugin 0.2):

              <scm class="org.jenkinsci.plugins.multiplescms.MultiSCM">
                <scms>
                  <hudson.plugins.git.GitSCM>
                    <configVersion>2</configVersion>
                    <userRemoteConfigs>
                      <hudson.plugins.git.UserRemoteConfig>
                        <name></name>
                        <refspec></refspec>
                        <url>git://github.com/nuxeo/addons.git</url>
                      </hudson.plugins.git.UserRemoteConfig>
                    </userRemoteConfigs>
                    <branches>
                      <hudson.plugins.git.BranchSpec>
                        <name>master</name>
                      </hudson.plugins.git.BranchSpec>
                    </branches>
                    <disableSubmodules>false</disableSubmodules>
                    <recursiveSubmodules>false</recursiveSubmodules>
                    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
                    <authorOrCommitter>false</authorOrCommitter>
                    <clean>false</clean>
                    <wipeOutWorkspace>false</wipeOutWorkspace>
                    <pruneBranches>false</pruneBranches>
                    <remotePoll>false</remotePoll>
                    <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
                    <gitTool>Default</gitTool>
                    <submoduleCfg class="list"/>
                    <relativeTargetDir></relativeTargetDir>
                    <reference></reference>
                    <excludedRegions></excludedRegions>
                    <excludedUsers></excludedUsers>
                    <gitConfigName></gitConfigName>
                    <gitConfigEmail></gitConfigEmail>
                    <skipTag>false</skipTag>
                    <scmName></scmName>
                  </hudson.plugins.git.GitSCM>
                  <hudson.plugins.git.GitSCM>
                    <configVersion>2</configVersion>
                    <userRemoteConfigs>
                      <hudson.plugins.git.UserRemoteConfig>
                        <name></name>
                        <refspec></refspec>
                        <url>git://github.com/nuxeo/nuxeo-platform-lang-ext.git</url>
                      </hudson.plugins.git.UserRemoteConfig>
                    </userRemoteConfigs>
                    <branches>
                      <hudson.plugins.git.BranchSpec>
                        <name>master</name>
                      </hudson.plugins.git.BranchSpec>
                    </branches>
                    (...)
                  </hudson.plugins.git.GitSCM>
                 (...)
                </scms>
              </scm>
            
            jcarsique Julien Carsique added a comment - Seems fixed for 0.2. Configuration is properly saved (Jenkins 1.444 + Multiple SCMs plugin 0.2): <scm class= "org.jenkinsci.plugins.multiplescms.MultiSCM" > <scms> <hudson.plugins.git.GitSCM> <configVersion> 2 </configVersion> <userRemoteConfigs> <hudson.plugins.git.UserRemoteConfig> <name> </name> <refspec> </refspec> <url> git://github.com/nuxeo/addons.git </url> </hudson.plugins.git.UserRemoteConfig> </userRemoteConfigs> <branches> <hudson.plugins.git.BranchSpec> <name> master </name> </hudson.plugins.git.BranchSpec> </branches> <disableSubmodules> false </disableSubmodules> <recursiveSubmodules> false </recursiveSubmodules> <doGenerateSubmoduleConfigurations> false </doGenerateSubmoduleConfigurations> <authorOrCommitter> false </authorOrCommitter> <clean> false </clean> <wipeOutWorkspace> false </wipeOutWorkspace> <pruneBranches> false </pruneBranches> <remotePoll> false </remotePoll> <buildChooser class= "hudson.plugins.git.util.DefaultBuildChooser" /> <gitTool> Default </gitTool> <submoduleCfg class= "list" /> <relativeTargetDir> </relativeTargetDir> <reference> </reference> <excludedRegions> </excludedRegions> <excludedUsers> </excludedUsers> <gitConfigName> </gitConfigName> <gitConfigEmail> </gitConfigEmail> <skipTag> false </skipTag> <scmName> </scmName> </hudson.plugins.git.GitSCM> <hudson.plugins.git.GitSCM> <configVersion> 2 </configVersion> <userRemoteConfigs> <hudson.plugins.git.UserRemoteConfig> <name> </name> <refspec> </refspec> <url> git://github.com/nuxeo/nuxeo-platform-lang-ext.git </url> </hudson.plugins.git.UserRemoteConfig> </userRemoteConfigs> <branches> <hudson.plugins.git.BranchSpec> <name> master </name> </hudson.plugins.git.BranchSpec> </branches> (...) </hudson.plugins.git.GitSCM> (...) </scms> </scm>
            tyane tyler smith added a comment -

            The same happens for TFS. When I use the multiple scm plugin to configure 2 tfs pulls then save, it will build correctly, but when you open the config again the TFS information is gone.

            tyane tyler smith added a comment - The same happens for TFS. When I use the multiple scm plugin to configure 2 tfs pulls then save, it will build correctly, but when you open the config again the TFS information is gone.
            oleg_nenashev Oleg Nenashev added a comment - - edited

            Same issue with Perforce...
            In its case, issue has been caused by radioButtons, which cause conflicts between two instances of same SCM

            oleg_nenashev Oleg Nenashev added a comment - - edited Same issue with Perforce... In its case, issue has been caused by radioButtons, which cause conflicts between two instances of same SCM
            oleg_nenashev Oleg Nenashev added a comment -

            Seems that Git and TFS plugins rely on newInstance() overrides...

            oleg_nenashev Oleg Nenashev added a comment - Seems that Git and TFS plugins rely on newInstance() overrides...

            This issue is persisting from long time, it would be great if we can have resolution for this, it will be good for people who are using GIT and TFS. As we know TFS does not support external like Subversion, so this plugin becomes more and more important.

            jeebitesh Jeebitesh Kalantri added a comment - This issue is persisting from long time, it would be great if we can have resolution for this, it will be good for people who are using GIT and TFS. As we know TFS does not support external like Subversion, so this plugin becomes more and more important.
            hwprodigi Eric Beauchamp added a comment - - edited

            Same issue with RepoSCM. Would be great if this issue is resolved...it is very annoying when setting up a new project. I have opened a separated bug for it:
            https://issues.jenkins-ci.org/browse/JENKINS-26645

            Seems that Kevin Bell has been inactive for a while...can someone else look a this issue?

            Thank you

            hwprodigi Eric Beauchamp added a comment - - edited Same issue with RepoSCM. Would be great if this issue is resolved...it is very annoying when setting up a new project. I have opened a separated bug for it: https://issues.jenkins-ci.org/browse/JENKINS-26645 Seems that Kevin Bell has been inactive for a while...can someone else look a this issue? Thank you

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/org/jenkinsci/plugins/multiplescms/MultiSCM.java
            http://jenkins-ci.org/commit/multiple-scms-plugin/78c5c7d81c3a2c5410138137153838d46f28e0ce
            Log:
            Add support of newInstance() invocation

            Plugin invokes newInstance() instead of DataBoundConstructor.
            Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>

            [FIXED JENKINS-19818]
            [FIXED JENKINS-9287]

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/org/jenkinsci/plugins/multiplescms/MultiSCM.java http://jenkins-ci.org/commit/multiple-scms-plugin/78c5c7d81c3a2c5410138137153838d46f28e0ce Log: Add support of newInstance() invocation Plugin invokes newInstance() instead of DataBoundConstructor. Signed-off-by: Oleg Nenashev <nenashev@synopsys.com> [FIXED JENKINS-19818] [FIXED JENKINS-9287]

            Is this issue resolved? I am getting the same error with TFS multipple SCM option. The configurations are getting wiped out .

            My Jenkins version is 1.558 and multiple scm plugin version is : 0.3.. Please help me to resolve this issue.Thanks!!!

            nimnku Nimi Sukumaran added a comment - Is this issue resolved? I am getting the same error with TFS multipple SCM option. The configurations are getting wiped out . My Jenkins version is 1.558 and multiple scm plugin version is : 0.3.. Please help me to resolve this issue.Thanks!!!
            nir_a nir avnery added a comment - - edited

            This still happens with git + repo-scm version 0.5 and jenkins 1.617

            nir_a nir avnery added a comment - - edited This still happens with git + repo-scm version 0.5 and jenkins 1.617
            uscengineer USC Engineer added a comment -

            I am having a similar issue with git + aws codepipeline. Version 0.6 and jenkins 1.642. Git is saved correctly but aws codepipeline config is wiped out.

            uscengineer USC Engineer added a comment - I am having a similar issue with git + aws codepipeline. Version 0.6 and jenkins 1.642. Git is saved correctly but aws codepipeline config is wiped out.

            Suggest that you migrate to Pipeline plugin, which offers a supported way of checking out from multiple scms
            https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin

            rodrigc Craig Rodrigues added a comment - Suggest that you migrate to Pipeline plugin, which offers a supported way of checking out from multiple scms https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin

            People

              kbell Kevin Bell
              drulli Ulli Hafner
              Votes:
              6 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: