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

doCheckProjects can get confused with Cloudbees Template plugin

    Details

    • Similar Issues:

      Description

      BuildTriggerConfig.DescriptorImpl.doCheckProjects receives Item object, which is expected to be the project being configured.

      public FormValidation doCheckProjects(@AncestorInPath Item project, @QueryParameter String value ) {
      

      Cloudbees Template plugin uses JobPropertyImpl.getJobOverrides, which overrides the stapler's object path:

      • Jenkins
      • The project being configured
      • ...
      • JobTemplate <- This is inserted by JobPropertyImpl.getJobOverrides.
      • ...

      This results doCheckProjects receive a JobTemplate object as project, and fail to check project names as the JobTemplate object is the templated project.
      Failures happen when the parent of the configuring project and the parent of the templated project differ (e.g. they are in different Cloudbee Folder).

      As JobTemplate is a subclass of AbstractItem, the type of project should be changed to Job or AbstractProject.

        Attachments

          Issue Links

            Activity

            Hide
            ikedam ikedam added a comment -

            Released in 2.25.

            Show
            ikedam ikedam added a comment - Released in 2.25.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/parameterizedtrigger/BuildTriggerConfig.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/ea8b3dfda8346437b04a12da1ac1e5d658a367d4
            Log:
            Merge pull request #68 from ikedam/feature/JENKINS-22856_AncestorForDoCheckProjects

            JENKINS-22856 Uses AbstractProject instead of Item in Descriptor.doCheckProjects

            Compare: https://github.com/jenkinsci/parameterized-trigger-plugin/compare/2109f295054a...ea8b3dfda834

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/parameterizedtrigger/BuildTriggerConfig.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/ea8b3dfda8346437b04a12da1ac1e5d658a367d4 Log: Merge pull request #68 from ikedam/feature/ JENKINS-22856 _AncestorForDoCheckProjects JENKINS-22856 Uses AbstractProject instead of Item in Descriptor.doCheckProjects Compare: https://github.com/jenkinsci/parameterized-trigger-plugin/compare/2109f295054a...ea8b3dfda834
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/parameterizedtrigger/BuildTriggerConfig.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/44f814fef97853ba6887132069a041b97a31274d
            Log:
            [FIXED JENKINS-22856] Uses AbstractProject instead of Item in Descriptor.doCheckProjects. It can be get confused with JobPropertyImpl.getJobOverrides or /lib/form/withCustomDescriptorByName.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/parameterizedtrigger/BuildTriggerConfig.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/44f814fef97853ba6887132069a041b97a31274d Log: [FIXED JENKINS-22856] Uses AbstractProject instead of Item in Descriptor.doCheckProjects. It can be get confused with JobPropertyImpl.getJobOverrides or /lib/form/withCustomDescriptorByName.
            Show
            ikedam ikedam added a comment - https://github.com/jenkinsci/parameterized-trigger-plugin/pull/68
            Hide
            ikedam ikedam added a comment -

            https://github.com/jenkinsci/copyartifact-plugin/pull/36#issuecomment-43407514

            `getJobOverrides` only inserts the `Configurator`, which is not an `Item`. The `JobTemplate`, along with the `Attribute` and `Control`, are inserted using `f:withCustomDescriptorByName` (from the `Configurator`’s configuration screen). While the page URL remains that of the templatized job, if you look at the “AJAX” URL being passed to the `doCheck*` method (or whatever), you will see something longer that matches the ancestor list mentioned earlier.

            Show
            ikedam ikedam added a comment - https://github.com/jenkinsci/copyartifact-plugin/pull/36#issuecomment-43407514 `getJobOverrides` only inserts the `Configurator`, which is not an `Item`. The `JobTemplate`, along with the `Attribute` and `Control`, are inserted using `f:withCustomDescriptorByName` (from the `Configurator`’s configuration screen). While the page URL remains that of the templatized job, if you look at the “AJAX” URL being passed to the `doCheck*` method (or whatever), you will see something longer that matches the ancestor list mentioned earlier.

              People

              • Assignee:
                ikedam ikedam
                Reporter:
                ikedam ikedam
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: