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

Global variables are overriding local variables

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Blocker
    • Resolution: Unresolved
    • Component/s: workflow-job-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.138.2 and 2.138.3
    • Similar Issues:

      Description

      We had this issue since 2.138.2, now we are on 2.138.3

      When running a build, its always ignoring the local parameters and its always taking into consideration only the global parameters. This makes it impossible for us to run builds with different parameters as they will always only follow the global parameters.

       

      The only way this could work is when there is no global parameters. If there is only Local parameters then they wont be overriden.

        Attachments

          Activity

          Hide
          wreggyl Jan Bottek added a comment -

          Hi, i tested it again with Jenkins 2.164.2 and the plugins

           

          PlugIn from
          Pipeline: Declarative 1.3.7
          Pipeline: Declarative Extension Points API 1.3.7
          Pipeline: Job  2.32

          We have a global environment variable in Jenkins and a Job with a parameter with the same name and we try to overwrite the resulting env variable in the job

           

          node()

          {     echo env.custom_env_var     echo params.custom_env_var }

          In FreeStyle Job this is still working, only in pipeline we get this error.

          Show
          wreggyl Jan Bottek added a comment - Hi, i tested it again with Jenkins 2.164.2 and the plugins   PlugIn from Pipeline: Declarative 1.3.7 Pipeline: Declarative Extension Points API 1.3.7 Pipeline: Job  2.32 We have a global environment variable in Jenkins and a Job with a parameter with the same name and we try to overwrite the resulting env variable in the job   node() {     echo env.custom_env_var     echo params.custom_env_var } In FreeStyle Job this is still working, only in pipeline we get this error.
          Hide
          wreggyl Jan Bottek added a comment - - edited

          fisnik hajredini thx for the fast replay. sorry for my question, but how can i see now in which version of the plugin this issue is solved? because issue is still open and on your mentioned CI i didn't see the code for the plugin itself, or what i overlook?

           

          => ahh, now i understood

          Show
          wreggyl Jan Bottek added a comment - - edited fisnik hajredini thx for the fast replay. sorry for my question, but how can i see now in which version of the plugin this issue is solved? because issue is still open and on your mentioned CI i didn't see the code for the plugin itself, or what i overlook?   => ahh, now i understood
          Hide
          fhajredini fisnik hajredini added a comment -

          We have added a helper function where we get the environment data. You can check our Jenkins CI/CD on https://github.com/pelagicore/pelux-manifests.git

          Show
          fhajredini fisnik hajredini added a comment - We have added a helper function where we get the environment data. You can check our Jenkins CI/CD on https://github.com/pelagicore/pelux-manifests.git
          Hide
          wreggyl Jan Bottek added a comment -

          is there any progress on this issue, or something which can be done from my site to help solving this issue?

          Show
          wreggyl Jan Bottek added a comment - is there any progress on this issue, or something which can be done from my site to help solving this issue?
          Hide
          fhajredini fisnik hajredini added a comment -

          Jan Bottek Thanks for you reply. We are currently following a different approach to fixing this, because of some other issues the pipeline job might cause. We decided to include the variables in the Jenkinsfile script as a temporary approach until this issue is resolved.

          Show
          fhajredini fisnik hajredini added a comment - Jan Bottek Thanks for you reply. We are currently following a different approach to fixing this, because of some other issues the pipeline job might cause. We decided to include the variables in the Jenkinsfile script as a temporary approach until this issue is resolved.

            People

            • Assignee:
              Unassigned
              Reporter:
              fhajredini fisnik hajredini
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: