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

Remove bare parameters from pipeline binding context

      Bare access of parameters fails the first time a job with parameters is run.  It also fails when parameter names change.  This produces inconsistent pipeline results depending on when the pipeline is run (first run or not).  

      A recent PR ( https://github.com/jenkins-infra/jenkins.io/pull/746 ) was filed to change the documentation to say code should use params.NAME instead of bare NAME.  There have also been multiple bugs filed by users getting bit by this: 

      See https://issues.jenkins-ci.org/browse/JENKINS-40631 among many others.

      Given the confusion and error prone nature of bare access, we should make bare access obsolete and move toward removing it - all parameter access should be via "params.ParameterName" path. 

       

       

       

          [JENKINS-42729] Remove bare parameters from pipeline binding context

          Andrew Bayer added a comment -

          This is entirely out of the scope of what I can do in Declarative, so removing that component and assigning to jglick

          Andrew Bayer added a comment - This is entirely out of the scope of what I can do in Declarative, so removing that component and assigning to jglick

          Liam Newman added a comment -

          abayer - Cool, thanks. 

          Liam Newman added a comment - abayer - Cool, thanks. 

          Jesse Glick added a comment -

          we should make bare access obsolete and move toward removing it

          Other than updating documentation, which we are already doing, I suppose CpsScript.getProperty could print a warning to the log before returning a value from EnvActionImpl, if it can determine that this property came from a build parameter.

          Jesse Glick added a comment - we should make bare access obsolete and move toward removing it Other than updating documentation, which we are already doing, I suppose CpsScript.getProperty could print a warning to the log before returning a value from EnvActionImpl , if it can determine that this property came from a build parameter.

            jglick Jesse Glick
            bitwiseman Liam Newman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: