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

Scanning branches for freestyle project deletes all build history

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical

      A section "com.github.mjdetullio.jenkins.plugins.multibranch.BranchProjectProperty" can appear in the template config.xml file after certain configuration operations. When this section is present, running branch indexing will delete the job execution history under all branches.

      This section doesn't always exist. One way to create it is to enable "Ant/ivy Artifactory integration", which will create the section. Disabling the "Ant/ivy Artifactory integration" doesn't help - the section will still be present and will still cause the error.

      This wast not happening with Multibranch 0.5.2, BranchApi 1.11.1, and SCM 1.3. After upgrading, existing jobs had their jobs deleted when reindexed. I was able to come up with a repro case with a new project:

      Repro steps:

      • Create a new freestyle multibranch project
      • Add a GitHub source and save (my source had 2 branches in it, doesn't really matter)
      • Branches will build successfully (there are no build steps)
      • Scan Project / Run Now - No change to the history
      • Here's where the problems start
      • Configure the project
      • Check the box for "Ant/Ivy-Artifactory Integration"
      • Click Apply
      • Uncheck the box for "Ant/Ivy-Artifactory Integration"
      • Click Save
      • Build history and last success are gone
      • Run some builds. History and success/fail are back.
      • Scan Project / Run now
      • Build history and last success are gone again
      • Edit the "template/config.xml" file for this job
      • A new section has appeared:
        <com.github.mjdetullio.jenkins.plugins.multibranch.BranchProjectProperty plugin="multi-branch-project-plugin@0.6">
          <branch plugin="branch-api@2.0.7">
            <sourceId>unknown</sourceId>
            <head plugin="scm-api@2.0.7">
              <name>template</name>
            </head>
            <scm class="hudson.scm.NullSCM"/>
            <properties/>
            <actions/>
          </branch>
        </com.github.mjdetullio.jenkins.plugins.multibranch.BranchProjectProperty>
        
      • To fix the problem
      • Delete this section.
      • Reload configuration from disk
      • Job history has returned, but the last success is still missing.
      • Build the jobs to get another success
      • Scan project / Run now
      • Job history and last success are present

            mjdetullio Matthew DeTullio
            fwr Frank Racis
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: