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

CustomOrganizationFolderDescriptor does not work after a dynamic installation

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Currently CustomOrganizationFolderDescriptor only works if the plugins offering SCMNavigatorDescriptor (like github-branch-source) and MultiBranchProjectFactoryDescriptor (like workflow-multibranch), as well as branch-api itself, are already loaded during Jenkins startup.

      Basically this code would need to also be run in response to an ExtensionListListener, though that requires a 1.625+ dep.

      Alternately, we could fix the problem the right way in DescriptorVisibilityFilter, using a new core API dependency.

      Whether it is fixable using the current 1.609.x core dependency, I am not sure. HideGeneric.filter is called every time the New Item page is displayed, but it is probably too late to add a descriptor to the list while that list is being filtered.

        Attachments

          Issue Links

            Activity

            Hide
            recena Manuel Recena Soto added a comment - - edited

            Stephen Connolly Any problem if I work on this issue? /cc Jesse Glick

            Show
            recena Manuel Recena Soto added a comment - - edited Stephen Connolly Any problem if I work on this issue? /cc Jesse Glick
            Hide
            jglick Jesse Glick added a comment -

            By “the right way” I mean for DescriptorVisibilityFilter to retain its current filter method as an option for the simpler cases, but to add a more general API along the lines of what ViewJobFilter does: a filter would get the chance to not just delete a single item, but to be given the entire list of proposed descriptors (along with their supertype) and make arbitrary modifications to it, including adding descriptors which are not declaratively registered as extensions.

            Show
            jglick Jesse Glick added a comment - By “the right way” I mean for DescriptorVisibilityFilter to retain its current filter method as an option for the simpler cases, but to add a more general API along the lines of what ViewJobFilter does: a filter would get the chance to not just delete a single item, but to be given the entire list of proposed descriptors (along with their supertype) and make arbitrary modifications to it, including adding descriptors which are not declaratively registered as extensions.
            Hide
            jglick Jesse Glick added a comment -

            Using ExtensionListListener might be a little tricky, since this is designed to be a read-only callback, whereas for this use case we want to modify the extension list of one type (TopLevelItemDescriptor) in response to changes in the extension lists of other types (SCMNavigatorDescriptor, MultiBranchProjectFactoryDescriptor), so extra care needs to be taken that this does not result in some kind of concurrent modification error, or loop, etc.

            Show
            jglick Jesse Glick added a comment - Using ExtensionListListener might be a little tricky, since this is designed to be a read-only callback, whereas for this use case we want to modify the extension list of one type ( TopLevelItemDescriptor ) in response to changes in the extension lists of other types ( SCMNavigatorDescriptor , MultiBranchProjectFactoryDescriptor ), so extra care needs to be taken that this does not result in some kind of concurrent modification error, or loop, etc.
            Hide
            jglick Jesse Glick added a comment -

            Interactive test case:

            mvn -DskipTests clean install && rm -rf /tmp/test-JENKINS-33106 && (JENKINS_HOME=/tmp/test-JENKINS-33106 java -jar ~/.m2/repository/org/jenkins-ci/main/jenkins-war/1.625.1/jenkins-war-1.625.1.war &) && sleep 20 && java -jar /tmp/jenkins-cli.jar -s http://localhost:8080/ install-plugin -deploy cloudbees-folder scm-api $(pwd)/target/branch-api.hpi github-organization-folder
            

            and browse New Item.

            Show
            jglick Jesse Glick added a comment - Interactive test case: mvn -DskipTests clean install && rm -rf /tmp/test-JENKINS-33106 && (JENKINS_HOME=/tmp/test-JENKINS-33106 java -jar ~/.m2/repository/org/jenkins-ci/main/jenkins-war/1.625.1/jenkins-war-1.625.1.war &) && sleep 20 && java -jar /tmp/jenkins-cli.jar -s http://localhost:8080/ install-plugin -deploy cloudbees-folder scm-api $(pwd)/target/branch-api.hpi github-organization-folder and browse New Item .
            Hide
            recena Manuel Recena Soto added a comment -

            Jesse Glick Kudos!!!

            Show
            recena Manuel Recena Soto added a comment - Jesse Glick Kudos!!!
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/jenkins/branch/CustomOrganizationFolderDescriptor.java
            src/test/java/jenkins/branch/CustomOrganizationFolderDescriptorTest.java
            http://jenkins-ci.org/commit/branch-api-plugin/be0c95006f397d75c53628bb03c22aeefe05260f
            Log:
            [FIXED JENKINS-33106] Register CustomOrganizationFolderDescriptor’s in response to dynamic plugin loads.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/jenkins/branch/CustomOrganizationFolderDescriptor.java src/test/java/jenkins/branch/CustomOrganizationFolderDescriptorTest.java http://jenkins-ci.org/commit/branch-api-plugin/be0c95006f397d75c53628bb03c22aeefe05260f Log: [FIXED JENKINS-33106] Register CustomOrganizationFolderDescriptor’s in response to dynamic plugin loads.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/jenkins/branch/CustomOrganizationFolderDescriptor.java
            src/main/java/jenkins/branch/MultiBranchProject.java
            src/test/java/jenkins/branch/CustomOrganizationFolderDescriptorTest.java
            http://jenkins-ci.org/commit/branch-api-plugin/61ec9d9144df9b4bd99641bc0cb0c5e9319324f3
            Log:
            Merge pull request #30 from jglick/dynamic-load-JENKINS-33106

            JENKINS-33106 Dynamic CustomOrganizationFolderDescriptor registration

            Compare: https://github.com/jenkinsci/branch-api-plugin/compare/2c30f50f0245...61ec9d9144df

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/jenkins/branch/CustomOrganizationFolderDescriptor.java src/main/java/jenkins/branch/MultiBranchProject.java src/test/java/jenkins/branch/CustomOrganizationFolderDescriptorTest.java http://jenkins-ci.org/commit/branch-api-plugin/61ec9d9144df9b4bd99641bc0cb0c5e9319324f3 Log: Merge pull request #30 from jglick/dynamic-load- JENKINS-33106 JENKINS-33106 Dynamic CustomOrganizationFolderDescriptor registration Compare: https://github.com/jenkinsci/branch-api-plugin/compare/2c30f50f0245...61ec9d9144df

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: