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

Folders do not always persist assigned folder properties

      Found it during manual testing of JENKINS-28881

      Analysis results:

      • AbstractFolder#properties is a persisted list
      • Persisted list is being automatically saved on modification
      • Persisted list requires the correct specification of owner to be saved. Owner info is not persisted on its own
      • When the plugin loads properties from the disk, it does not assign properties owner if the list exists
      • Persisted list uses the default owner (Saveable.NOOP)
      • When Persisted list is being saved by AbstractFolder#addProperty(), the plugin actually saves NOOP instead of folder

      The original code:

      if (properties == null) {
                  properties = new DescribableList<AbstractFolderProperty<?>,AbstractFolderPropertyDescriptor>(this);
              } 
              for (AbstractFolderProperty p : properties) {
                  p.setOwner(this);
              }
      ...
      

          [JENKINS-32359] Folders do not always persist assigned folder properties

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - Reproduced the issue here: https://github.com/oleg-nenashev/ownership-plugin/commit/b42f2937c1f91bfd521e00650cbee38cd565c6ba Working on the fix

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/test/java/org/jenkinsci/plugins/ownership/model/folders/FolderOwnershipTest.java
          http://jenkins-ci.org/commit/ownership-plugin/b42f2937c1f91bfd521e00650cbee38cd565c6ba
          Log:
          JENKINS-28881 - Direct unit test for the issue discovered with folders (JENKINS-32359)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/test/java/org/jenkinsci/plugins/ownership/model/folders/FolderOwnershipTest.java http://jenkins-ci.org/commit/ownership-plugin/b42f2937c1f91bfd521e00650cbee38cd565c6ba Log: JENKINS-28881 - Direct unit test for the issue discovered with folders ( JENKINS-32359 )

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/test/java/org/jenkinsci/plugins/ownership/model/folders/FolderOwnershipTest.java
          http://jenkins-ci.org/commit/ownership-plugin/a188d3e4e76465b01eeac99deae2188ca470853b
          Log:
          JENKINS-28881 - Disable the JENKINS-32359 unit test till the CloudBees Folders Plugin gets released

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/test/java/org/jenkinsci/plugins/ownership/model/folders/FolderOwnershipTest.java http://jenkins-ci.org/commit/ownership-plugin/a188d3e4e76465b01eeac99deae2188ca470853b Log: JENKINS-28881 - Disable the JENKINS-32359 unit test till the CloudBees Folders Plugin gets released

          M Chon added a comment -

          I never installed the 'cloudbees-folder-plugin' on my machine, but when I reboot, I get these warnings.
          How can I get rid of the warnings?

          WARNING: Failed to load com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty$DescriptorImpl
          java.lang.InstantiationException: java.lang.NoClassDefFoundError: com/cloudbees/hudson/plugins/folder/AbstractFolderPropertyDescriptor
          at net.java.sezpoz.IndexItem.element(IndexItem.java:146)
          at hudson.ExtensionFinder$Sezpoz._find(ExtensionFinder.java:628)
          at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:617)
          at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:388)

          M Chon added a comment - I never installed the 'cloudbees-folder-plugin' on my machine, but when I reboot, I get these warnings. How can I get rid of the warnings? WARNING: Failed to load com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty$DescriptorImpl java.lang.InstantiationException: java.lang.NoClassDefFoundError: com/cloudbees/hudson/plugins/folder/AbstractFolderPropertyDescriptor at net.java.sezpoz.IndexItem.element(IndexItem.java:146) at hudson.ExtensionFinder$Sezpoz._find(ExtensionFinder.java:628) at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:617) at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:388)

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          pom.xml
          src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java
          src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolderProperty.java
          src/test/java/com/cloudbees/hudson/plugins/folder/FolderTest.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/bd3792648a12bcdb9b8616e8a793e73e8c457773
          Log:
          [FIXED JENKINS-32359] - Properly assign persisted list owners when loading folders from disk (#32)

          • [FIXED JENKINS-32359] - Assign persisted list owners when reloading the folder with properties

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: pom.xml src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolderProperty.java src/test/java/com/cloudbees/hudson/plugins/folder/FolderTest.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/bd3792648a12bcdb9b8616e8a793e73e8c457773 Log: [FIXED JENKINS-32359] - Properly assign persisted list owners when loading folders from disk (#32) JENKINS-32359 - Direct Unit test for the issue [FIXED JENKINS-32359] - Assign persisted list owners when reloading the folder with properties JENKINS-32487 - Expose AbstractPropertyFolder's owner via API JENKINS-32487 - Test suite refactoring JENKINS-32359 - Address comments from @jglick JENKINS-32359 - Add test dependency on matrix-auth plugin JENKINS-32359 - Restrict AbstractFolderProperty#getOwner()

          Oleg Nenashev added a comment -

          Released in cloudbees-folder-5.12

          Oleg Nenashev added a comment - Released in cloudbees-folder-5.12

            oleg_nenashev Oleg Nenashev
            oleg_nenashev Oleg Nenashev
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: