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

Integrity SCM failed on cloudbees.Folders during "Delete Non Members"

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • integrity-plugin
    • Jenkins 1.611, PTC Integrity CM - Jenkins Plugin 1.33, CloudBees Folders Plugin 4.8, MS Server 2012, java.runtime.version 1.8.0_45-b15

      Hi,

      if I use the PTC as SCM and have the option "Delete Non Members" checked, the job failed in subfolders with following trace:

      Preparing to execute si projectinfo for #m:/MKS/Service Station#FDC#CORE
      Preparing to execute si viewproject for #m:/MKS/Service Station#FDC/CORE
      Checkout directory is C:\Program Files (x86)\Jenkins\FDC\MAIN\CORE
      A clean copy is requested; deleting contents of C:\Program Files (x86)\Jenkins\FDC\MAIN\CORE
      Populating clean workspace...
      Successfully checked out 1292 files!
      Saving current Integrity Project configuration...
      Writing build change log...
      Change log successfully generated: C:\Program Files (x86)\Jenkins\jobs\FDC\jobs\FDC - MAIN - Get sources for CORE\builds\12\changelog.xml
      FATAL: com.cloudbees.hudson.plugins.folder.Folder cannot be cast to hudson.model.AbstractProject
      java.lang.ClassCastException: com.cloudbees.hudson.plugins.folder.Folder cannot be cast to hudson.model.AbstractProject
      at hudson.scm.IntegrityDeleteNonMembersTask.getRootProject(IntegrityDeleteNonMembersTask.java:74)
      at hudson.scm.IntegrityDeleteNonMembersTask.invoke(IntegrityDeleteNonMembersTask.java:39)
      at hudson.scm.IntegrityDeleteNonMembersTask.invoke(IntegrityDeleteNonMembersTask.java:20)
      at hudson.FilePath.act(FilePath.java:991)
      at hudson.FilePath.act(FilePath.java:969)
      at hudson.scm.IntegritySCM.checkout(IntegritySCM.java:822)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1276)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
      at hudson.model.Run.execute(Run.java:1744)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:374)
      Warning: this build has no associated authentication, so build permissions may be lacking, and downstream projects which cannot even be seen by an anonymous user will be silently skipped
      Finished: FAILURE

      In "root" folder or if the option "Delete Non Members" is unchecked, everything works fine.

      it would be nice if the PTC plugin can support this option on cloudbees.Folders as well.

      Regards, Bernd Spickers

          [JENKINS-28469] Integrity SCM failed on cloudbees.Folders during "Delete Non Members"

          Jesse Glick added a comment -

          The blind cast from ItemGroup to AbstractProject is clearly a bug.

          The code here seems pointless anyway. All you need is AbstractProject.getRootProject.

          Jesse Glick added a comment - The blind cast from ItemGroup to AbstractProject is clearly a bug. The code here seems pointless anyway. All you need is AbstractProject.getRootProject .

          That code actually came from some early examples (perhaps copied from another SCM plugin) of how to write a SCM plugin. Didn't really pay too much attention to it as it was working until the combination of the folders plugin. Will clean up and simplify. Thanks for the help!

          Cletus D'Souza added a comment - That code actually came from some early examples (perhaps copied from another SCM plugin) of how to write a SCM plugin. Didn't really pay too much attention to it as it was working until the combination of the folders plugin. Will clean up and simplify. Thanks for the help!

          Code changed in jenkins
          User: Cletus D'Souza
          Path:
          src/main/java/hudson/scm/IntegrityDeleteNonMembersAction.java
          src/main/java/hudson/scm/IntegrityDeleteNonMembersTask.java
          http://jenkins-ci.org/commit/integrity-plugin/9c42a1f56fcd63784e826e1f3fe7f1b632ba715e
          Log:
          [FIXED JENKINS-28469] Resolved blind cast issue from ItemGroup to
          AbstractProject

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Cletus D'Souza Path: src/main/java/hudson/scm/IntegrityDeleteNonMembersAction.java src/main/java/hudson/scm/IntegrityDeleteNonMembersTask.java http://jenkins-ci.org/commit/integrity-plugin/9c42a1f56fcd63784e826e1f3fe7f1b632ba715e Log: [FIXED JENKINS-28469] Resolved blind cast issue from ItemGroup to AbstractProject

            cdsouza Cletus D'Souza
            bspickers Bernd Spickers
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: