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

EnvInjectJobProperty inappropriately offered in PipelineJob

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      If you install both EnvInject and the Workflow plugins, then create a workflow job, EnvInjectJobProperty is offered as an option in the configuration screen. It adds nothing of use for workflows, which can already read and write environment variables at arbitrary points, run Groovy logic, and so on, so it is just a source of confusion.

      EnvInjectJobProperty.DescriptorImpl.isApplicable returns true unconditionally. It does not in fact make any reference to AbstractProject/AbstractBuild. Yet so far as I can tell, all of the other classes which check for the existence of a configured EnvInjectJobProperty are in fact assuming AbstractProject/AbstractBuild and probably could not work otherwise.

      If I am right, then isApplicable should return AbstractProject.class.isAssignableFrom(jobType), and the class declaration should be public class EnvInjectJobProperty extends JobProperty<AbstractProject>. (It is unclear to me why you are currently making this class generic, since it concrete and has no subclasses, meaning it is just an ill-typed synonym of public class EnvInjectJobProperty extends JobProperty<Job>.)

      Probably hudson.model.ExternalJob shows the same issue.

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment - - edited

            Closing as "Won't Do" since EnvInject partially supports Pipeline. The supported use-cases have been documented in JENKINS-42876 + there are some incoming improvements (JENKINS-42614)

            Show
            oleg_nenashev Oleg Nenashev added a comment - - edited Closing as "Won't Do" since EnvInject partially supports Pipeline. The supported use-cases have been documented in  JENKINS-42876  + there are some incoming improvements ( JENKINS-42614 )

              People

              Assignee:
              gbois Gregory Boissinot
              Reporter:
              jglick Jesse Glick
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: