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

Allow takeover of sources

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      In multiple projects and for multiple branches we see output like  the below

      There are no changes on the branches.

      Takeover for service » master by source #1 from source that no longer exists
      Branch reopened: master (09621b0018d169b10ec7d35112ac37245c2289ac)
      Scheduled build for branch: master
      

       

        Attachments

          Activity

          Hide
          stephenconnolly Stephen Connolly added a comment -

          Marking as incomplete to flag that the issue creator needs to provide more details before re-opening. Specifically:

          • How is the multibranch project being created.
          • config.xml of the multibranch project on either side of a restart (to see if the ID is changing)
          • Are you using JobDSL
          Show
          stephenconnolly Stephen Connolly added a comment - Marking as incomplete to flag that the issue creator needs to provide more details before re-opening. Specifically: How is the multibranch project being created. config.xml of the multibranch project on either side of a restart (to see if the ID is changing) Are you using JobDSL
          Hide
          barrett_bossonova Barrett Strausser added a comment - - edited
          1. We have a template, that is populated by our config management tool. That template is checked into our src control and then populated as jobs are submitted to the config management source control.
          2. I believe you are correct about this portion. I can see that our template is missing a section like 
            <sources class="jenkins.branch.MultiBranchProject$BranchSourceList" plugin="branch-api@2.0.14">
            <data>
            <jenkins.branch.BranchSource>
            <source class="jenkins.plugins.git.GitSCMSource" plugin="git@3.6.0">
            <id>6ccb3a0a-79e3-4d5d-bb0b-28ce62e9cf98</id>
            <remote>git@github.com:BossaNova/service.git</remote>
            <credentialsId>jenkins_github</credentialsId>
            <traits>
            <jenkins.plugins.git.traits.BranchDiscoveryTrait/>
            </traits>
            </source>
            <strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
            <properties class="empty-list"/>
            </strategy>
            </jenkins.branch.BranchSource>
            </data>
            <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
            </sources>

          Is this a UUID that we can generate?

           

          3. We are not using the JobDSL

          Show
          barrett_bossonova Barrett Strausser added a comment - - edited We have a template, that is populated by our config management tool. That template is checked into our src control and then populated as jobs are submitted to the config management source control. I believe you are correct about this portion. I can see that our template is missing a section like  <sources class= "jenkins.branch.MultiBranchProject$BranchSourceList" plugin= "branch-api@2.0.14" > <data> <jenkins.branch.BranchSource> <source class= "jenkins.plugins.git.GitSCMSource" plugin= "git@3.6.0" > <id>6ccb3a0a-79e3-4d5d-bb0b-28ce62e9cf98</id> <remote>git@github.com:BossaNova/service.git</remote> <credentialsId>jenkins_github</credentialsId> <traits> <jenkins.plugins.git.traits.BranchDiscoveryTrait/> </traits> </source> <strategy class= "jenkins.branch.DefaultBranchPropertyStrategy" > <properties class= "empty-list" /> </strategy> </jenkins.branch.BranchSource> </data> <owner class= "org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference= "../.." /> </sources> Is this a UUID that we can generate?   3. We are not using the JobDSL
          Hide
          barrett_bossonova Barrett Strausser added a comment -

          Edit - Here is an exact copy of one of our sources

           

           

          <sources class="jenkins.branch.MultiBranchProject$BranchSourceList" plugin="branch-api@2.0.10">
          <data>
          <jenkins.branch.BranchSource>
          <source class="jenkins.plugins.git.GitSCMSource" plugin="git@3.3.1">
          <remote>git@github.com:BossaNova/scrubbed</remote>
          <credentialsId>scrubbed</credentialsId>
          <remoteName>origin</remoteName>
          <rawRefSpecs>+refs/heads/*:refs/remotes/origin/*</rawRefSpecs>
          <includes>*</includes>
          <excludes></excludes>
          <ignoreOnPushNotifications>false</ignoreOnPushNotifications>
          </source>
          <strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
          <properties class="empty-list"/>
          </strategy>
          </jenkins.branch.BranchSource>
          
          </data>
          <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
          </sources>
          
          

           

          Show
          barrett_bossonova Barrett Strausser added a comment - Edit - Here is an exact copy of one of our sources     <sources class= "jenkins.branch.MultiBranchProject$BranchSourceList" plugin= "branch-api@2.0.10" > <data> <jenkins.branch.BranchSource> <source class= "jenkins.plugins.git.GitSCMSource" plugin= "git@3.3.1" > <remote>git@github.com:BossaNova/scrubbed</remote> <credentialsId>scrubbed</credentialsId> <remoteName>origin</remoteName> <rawRefSpecs>+refs/heads/*:refs/remotes/origin/*</rawRefSpecs> <includes>*</includes> <excludes></excludes> <ignoreOnPushNotifications> false </ignoreOnPushNotifications> </source> <strategy class= "jenkins.branch.DefaultBranchPropertyStrategy" > <properties class= "empty-list" /> </strategy> </jenkins.branch.BranchSource> </data> <owner class= "org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference= "../.." /> </sources>  
          Hide
          stephenconnolly Stephen Connolly added a comment -

          You need to assign an id, or a uuid will be generated for you.

          The id just has to be unique among all the SCMSource in that multibranch project... I recommend the MD5 hash of the repository URL as you only have one source and you’d want a takeover if the url changes

          Show
          stephenconnolly Stephen Connolly added a comment - You need to assign an id, or a uuid will be generated for you. The id just has to be unique among all the SCMSource in that multibranch project ... I recommend the MD5 hash of the repository URL as you only have one source and you’d want a takeover if the url changes
          Hide
          stephenconnolly Stephen Connolly added a comment -

          Confirmed that this is a user using a template and the template is not configured to preserve the SCMSource ID, thus the behaviour is correct... i’d Call it “user error” except it’s not immediately obvious unless you read all of the user.adoc in the docs subfolder of branch-api and scm-api github repos

          Show
          stephenconnolly Stephen Connolly added a comment - Confirmed that this is a user using a template and the template is not configured to preserve the SCMSource ID, thus the behaviour is correct... i’d Call it “user error” except it’s not immediately obvious unless you read all of the user.adoc in the docs subfolder of branch-api and scm-api github repos

            People

            • Assignee:
              stephenconnolly Stephen Connolly
              Reporter:
              barrett_bossonova Barrett Strausser
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: