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

implement syntax verification for parameters

    Details

    • Similar Issues:

      Description

      While running the plugin and having the typo/wrong syntax in "token" field (missing " in my case), allows to execute further steps even when in advanced options of this plugin "fail the build" is set on evaluation failure (see config.png for setup example). Execution.png has the steps that are placed after the plugin that is having bad behaviour and they are executed.

      In my opinion there should be a syntax verification performed there, and when syntax is not correct, should fail the job at this step or at least this situation should be treated as condition evaluation failure.

      If i can assist with more information please let me know to improve this wonderfull tool.
      Thank you.

        Attachments

          Activity

          Hide
          danielbeck Daniel Beck added a comment -

          The problem is that it doesn't fail to evaluate. It expects a string (to compare to a list of values that are considered to mean "true"), and a string is what it got. It's no different than not building when the value entered is foo or hello world.

          Show
          danielbeck Daniel Beck added a comment - The problem is that it doesn't fail to evaluate. It expects a string (to compare to a list of values that are considered to mean "true"), and a string is what it got. It's no different than not building when the value entered is foo or hello world .
          Hide
          wojtek_haj Wojciech Hajduczenia added a comment -

          Any chances that it can evaluate if the syntax is correct or not when the first " is entered?
          Dont know what are the exact rulles for the syntax there but i think that when " is entered it should expect a second to close like it is in shell unless tehre is an escape character cancelling the propper usage.
          Sorry if i have opened this issue and took your time but i am teaching a friend from work some tricks and i did a mistake on purpose and i was suprised that the build not failed and stayed "green" and executed the tasks that were later indicated. I though that if tghe condition is not met or something is not correct with that (syntax error) it would behave like the verification failure. and would fail the job as it was indicated in the advanced option. Could use some help with configuring something like that to fail the job in case the condition is not met or syntax is wrong.

          Thanks

          Show
          wojtek_haj Wojciech Hajduczenia added a comment - Any chances that it can evaluate if the syntax is correct or not when the first " is entered? Dont know what are the exact rulles for the syntax there but i think that when " is entered it should expect a second to close like it is in shell unless tehre is an escape character cancelling the propper usage. Sorry if i have opened this issue and took your time but i am teaching a friend from work some tricks and i did a mistake on purpose and i was suprised that the build not failed and stayed "green" and executed the tasks that were later indicated. I though that if tghe condition is not met or something is not correct with that (syntax error) it would behave like the verification failure. and would fail the job as it was indicated in the advanced option. Could use some help with configuring something like that to fail the job in case the condition is not met or syntax is wrong. Thanks
          Hide
          domi Dominik Bartholdi added a comment -

          That going to be quite hard to implement...
          Maybe some smart regex could be used to do this validation in a basic way. But be aware that you don't have to enter a macro here, a normal string is fine too.
          And then when you really wanna make this solid, then you would have to check for all parameters for all macros provided by plugins too: https://wiki.jenkins-ci.org/display/JENKINS/Token+Macro+Plugin

          Show
          domi Dominik Bartholdi added a comment - That going to be quite hard to implement... Maybe some smart regex could be used to do this validation in a basic way. But be aware that you don't have to enter a macro here, a normal string is fine too. And then when you really wanna make this solid, then you would have to check for all parameters for all macros provided by plugins too: https://wiki.jenkins-ci.org/display/JENKINS/Token+Macro+Plugin
          Hide
          wojtek_haj Wojciech Hajduczenia added a comment - - edited

          If workload to implement some syntax verification for the options/makros used in plugins is to great, please close this issue with appropriate comment attached. As mentioned, in text editors some verification is used tracking if brackets or other special characters are used in tandems, opening/closing given functionality completing the correct syntax.
          A small thing like a missing , or " may be difficult and very frustrating to track in bigger jobs if the proper syntax is not used. An assumption that the person using a given plugin, knows correct syntax is spot on, but we are all human and mistakes lie in our nature.

          Nevertheless this could be an interesting option in the future releases.

          Thanks for the time and support.

          Show
          wojtek_haj Wojciech Hajduczenia added a comment - - edited If workload to implement some syntax verification for the options/makros used in plugins is to great, please close this issue with appropriate comment attached. As mentioned, in text editors some verification is used tracking if brackets or other special characters are used in tandems, opening/closing given functionality completing the correct syntax. A small thing like a missing , or " may be difficult and very frustrating to track in bigger jobs if the proper syntax is not used. An assumption that the person using a given plugin, knows correct syntax is spot on, but we are all human and mistakes lie in our nature. Nevertheless this could be an interesting option in the future releases. Thanks for the time and support.
          Hide
          domi Dominik Bartholdi added a comment -

          If the value starts with '$', then maybe we could use a regex to verify the Token Expansion Model as described here: https://wiki.jenkins-ci.org/display/JENKINS/Token+Macro+Plugin

          ...any regex guru around?

          Show
          domi Dominik Bartholdi added a comment - If the value starts with '$', then maybe we could use a regex to verify the Token Expansion Model as described here: https://wiki.jenkins-ci.org/display/JENKINS/Token+Macro+Plugin ...any regex guru around?

            People

            • Assignee:
              jenkins_git Jenkins git
              Reporter:
              wojtek_haj Wojciech Hajduczenia
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: