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

Source Code Management senction is not accepting String parameter

    Details

    • Similar Issues:

      Description

      Source Code Management senction is not accepting String parameter
      I am passing string parameter from Python script the value which is not substituting in the file path of the SCM section.
      ex: File Path: /mnt/test_dir/${PARAM}/

      I am able to see the value of the PRAM in the environment variables section. but the value is not substituting in the file path
       

       

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            It definitely works well for Pipeline.

            Regarding classic jobs, it's more complicated than one may think. For checkout it's possible to do it for sure, but cases like SCM polling and Workspace cleanup are problematic since there is no parameter values there. How do you see such case?

            Show
            oleg_nenashev Oleg Nenashev added a comment - It definitely works well for Pipeline. Regarding classic jobs, it's more complicated than one may think. For checkout it's possible to do it for sure, but cases like SCM polling and Workspace cleanup are problematic since there is no parameter values there. How do you see such case?
            Hide
            kkirangogula Kiran Gogula added a comment - - edited

            I am just reading files from the given folder location. Not using any version control. if you don't mind can you please send me the sample for pipeline which will satisfy my case.

            I am using parameterized build to add string parameter. the same parameter I am trying to use in SCM file path.

            Show
            kkirangogula Kiran Gogula added a comment - - edited I am just reading files from the given folder location. Not using any version control. if you don't mind can you please send me the sample for pipeline which will satisfy my case. I am using parameterized build to add string parameter. the same parameter I am trying to use in SCM file path.
            Hide
            kkirangogula Kiran Gogula added a comment -

            Why the env or Parameterized build parameters are not available on the SCM file path. I think those variable should be accessible from any plugin in Jenkins. Please help me to understand will send you the screenshots

            Show
            kkirangogula Kiran Gogula added a comment - Why the env or Parameterized build parameters are not available on the SCM file path. I think those variable should be accessible from any plugin in Jenkins. Please help me to understand will send you the screenshots
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            > I am just reading files from the given folder location. Not using any version control. if you don't mind can you please send me the sample for pipeline which will satisfy my case.

            I do not know your case, but you can find examples here: https://github.com/jenkinsci/filesystem_scm-plugin/pull/2  . It requires a version form the experimental UC.

            > Why the env or Parameterized build parameters are not available on the SCM file path. 

            It's managed by plugins. Some plugins enable env vars in fields, others - not. For SCM fields it may be error-prone, see my comment about polling above.

             

             

             

             

            Show
            oleg_nenashev Oleg Nenashev added a comment - > I am just reading files from the given folder location. Not using any version control. if you don't mind can you please send me the sample for pipeline which will satisfy my case. I do not know your case, but you can find examples here: https://github.com/jenkinsci/filesystem_scm-plugin/pull/2   . It requires a version form the experimental UC. > Why the env or Parameterized build parameters are not available on the SCM file path.  It's managed by plugins. Some plugins enable env vars in fields, others - not. For SCM fields it may be error-prone, see my comment about polling above.        
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I do not plan to add support of EnvVar resolution to the plugin. If somebody wants to contribute, I will be happy to review the pull requests.

             

            Show
            oleg_nenashev Oleg Nenashev added a comment - I do not plan to add support of EnvVar resolution to the plugin. If somebody wants to contribute, I will be happy to review the pull requests.  
            Hide
            kkirangogula Kiran Gogula added a comment -

            That will not help me.

            Show
            kkirangogula Kiran Gogula added a comment - That will not help me.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Kiran Gogula so what is your expectation here?

            Show
            oleg_nenashev Oleg Nenashev added a comment - Kiran Gogula so what is your expectation here?
            Hide
            kkirangogula Kiran Gogula added a comment -

            As per the design view all plugin should have an access to environment variables that would be more generic. And I have seen the SCM source code, the build parameters are not injected to that. Please let me know that if you can able to make a small change on the same to make sure the build variables should be accessible in SCM section or plugin.

            Please let me know your thought on the above comment.

            Show
            kkirangogula Kiran Gogula added a comment - As per the design view all plugin should have an access to environment variables that would be more generic. And I have seen the SCM source code, the build parameters are not injected to that. Please let me know that if you can able to make a small change on the same to make sure the build variables should be accessible in SCM section or plugin. Please let me know your thought on the above comment.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            > As per the design view all plugin should have an access to environment variables that would be more generic.

            It is not a Jenkins design. Each plugin has its own choice whether to handle env vars or not. If you see it mentioned in documentation anywhere, please provide me a link, Then it will be a bug which we would need to fix.

            > And I have seen the SCM source code, the build parameters are not injected to that. Please let me know that if you can able to make a small change...

            As I mentioned above, this small change needs decisions about the behavior in cases when Environment variables do not exist. And it should be a non-breaking behavior (you can see how much fun I had with it in the Perforce plugin).

            You have not responded to my question about the desired behavior yet, in the current state I see no way to iterate on it.

             

             

            Show
            oleg_nenashev Oleg Nenashev added a comment - > As per the design view all plugin should have an access to environment variables that would be more generic. It is not a Jenkins design. Each plugin has its own choice whether to handle env vars or not. If you see it mentioned in documentation anywhere, please provide me a link, Then it will be a bug which we would need to fix. > And I have seen the SCM source code, the build parameters are not injected to that. Please let me know that if you can able to make a small change... As I mentioned above, this small change needs decisions about the behavior in cases when Environment variables do not exist. And it should be a non-breaking behavior (you can see how much fun I had with it in the Perforce plugin). You have not responded to my question about the desired behavior yet, in the current state I see no way to iterate on it.    
            Hide
            kkirangogula Kiran Gogula added a comment -

            My expectation was I need to pass dynamic directory name as a parameter from the python script. And currently I am using the custom plugin so in that case I can not use the pipeline plug in to make my build success.

            Show
            kkirangogula Kiran Gogula added a comment - My expectation was I need to pass dynamic directory name as a parameter from the python script. And currently I am using the custom plugin so in that case I can not use the pipeline plug in to make my build success.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Duplicates JENKINS-7133

            Show
            oleg_nenashev Oleg Nenashev added a comment - Duplicates JENKINS-7133

              People

              • Assignee:
                Unassigned
                Reporter:
                kkirangogula Kiran Gogula
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: