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

doCheckProjects can get confused with Cloudbees Template plugin

XMLWordPrintable

      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.

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

              Created:
              Updated:
              Resolved: