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

'Build Parameters' column displays uresolved environment variable

    Details

    • Similar Issues:

      Description

      We are using environment variables (Jenkins->configuration->Global properties-->Environment variables) as default values of build parameters to our Jenkins deploy application builds:
      APPLICATION_DEPLOY_VERSION=x.y.z

      Somehow there is a requirement to indicate the latest deployed application version, per application deploy job. Introducing a 'Build parameters' column in the Jenkins view seems to fulfill this requirement. This works fine if the user overrides the default value of the version build parameter (${APPLICATION_DEPLOY_VERSION}).

      But if the user accepts the default value (${APPLICATION_DEPLOY_VERSION}), the 'Build parameters' column indicates that the latest build was invoked with the parameter value '${APPLICATION_DEPLOY_VERSION}'.

      I think the 'Build parameters' column should show the resolved build parameter value, if based on an environment variable, or any other parameter substitution mechanism.

        Attachments

          Activity

          Hide
          fredg Fred G added a comment -

          Sorry for the late reply (almost 4 years later *cough*). I agree, that it would be nice to see the "resolved build parameter value"in  the "Build parameters" column.

          As you can see here: https://github.com/jenkinsci/extra-columns-plugin/blob/master/src/main/java/jenkins/plugins/extracolumns/BuildParametersColumn.java#L62-L79 the implementation reads the Parameters from the ParameterAction(s). So the "Build parameters" column shows exactly what you see on the Parameters page of a build, e.g. http://<jenkinsURL>/job/<jobname>/<buildnumber>/parameters/. In your case, the build's parameter page also shows "${APPLICATION_DEPLOY_VERSION}", since the expansion happens during the build.

          Currently, I don't see a simple way to get the expanded parameter during the build and cache it. If you or someone else wants to take a stab at it, I'd happily review a pull-request, though.

          In the meantime, I will close this issue with WON'T FIX.

          Show
          fredg Fred G added a comment - Sorry for the late reply (almost 4 years later * cough *). I agree, that it would be nice to see the "resolved build parameter value"in  the "Build parameters" column. As you can see here: https://github.com/jenkinsci/extra-columns-plugin/blob/master/src/main/java/jenkins/plugins/extracolumns/BuildParametersColumn.java#L62-L79 the implementation reads the Parameters from the ParameterAction(s). So the "Build parameters" column shows exactly what you see on the Parameters page of a build, e.g. http://<jenkinsURL>/job/<jobname>/<buildnumber>/parameters/. In your case, the build's parameter page also shows "${APPLICATION_DEPLOY_VERSION}", since the expansion happens during the build. Currently, I don't see a simple way to get the expanded parameter during the build and cache it. If you or someone else wants to take a stab at it, I'd happily review a pull-request, though. In the meantime, I will close this issue with WON'T FIX.

            People

            • Assignee:
              fredg Fred G
              Reporter:
              erikgb Erik Godding Boye
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: