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

ParametersAction uses wrong environment filter for finished Runs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • None
    • Jenkins version 2.473

      We receive warnings about skipped parameters like this:

      {{WARNING hudson.model.ParametersAction#filter: Skipped parameter `DESCRIPTION_SETTER_DESCRIPTION` as it is undefined on `test-param-filter` (#7). Set `-Dhudson.model.ParametersAction.keepUndefinedParameters=true` to allow undefined parameters to be injected as environment variables or `-Dhudson.model.ParametersAction.safeParameters=[comma-separated list]` to whitelist specific parameter names, even though it represents a security breach or `-Dhudson.model.ParametersAction.keepUndefinedParameters=false` to no longer show this message.}}

      when the job is polling for SCM changes.

      Based on my investigation, it looks that the problem is as follows:

      1. when the polling happens, the scheduler will fetch environment for the previous completed run in order to check for the SCM delta
      2. when getting the environment (Run.getEnvironment(TaskListener)) for the already completed run, parameter are filtered by ParametersAction.filter(List)
      3. the filtering uses the parameterDefinitionNames that are based on the Runs parent
      4. if the parent has parameter definition, that is not valid for the already completed run, then the warning gets issued even when it makes no sense in this context

      One possible way to reproduce this bug:

      1. create a job that uses scm polling and enable polling every minute. trigger at least one run
      2. install description-setter plugin
      3. configure job to use description-setter
      4. now when the polling runs, we can see the warning in the log

            Unassigned Unassigned
            jlehtnie Jukka Lehtniemi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: