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

Wrong type of quoting of gerrit parameters to Jenkins

    XMLWordPrintable

Details

    Description

      Some parameters are quoted with unix-stylq quotes, even on Windows.
      e.g.

      In this case both Gerrit and Jenkins run on Windows

      I noticed https://issues.jenkins-ci.org/browse/JENKINS-5552 which seems to have a similar problem, but blame it on the BS-Build plugin.

      When I look at the properties for the failed build they containe backslashes
      before quotes, which seems wierd. I don't think this is the right place for quoting. Shouldn't the part that passes the propertie to the command line be the one that understands what and how to quote things.

      \"My Name <myname@example.com\"

      On windows this should be something like this.

      """My Name <myname@example.com"""

      Is all of the problem in Jenkins, or does Gerrit have any part of it?

      Attachments

        Issue Links

          Activity

            meggleton Mike Eggleton added a comment -

            I'm having this issue as well on windows:

            [JOBNAME] $ cmd.exe /C '"c:\jenkins\tools\Ant\Ant1.8.4\bin\ant.bat "-DGERRIT_PATCHSET_UPLOADER=\""FIRSTNAME LASTNAME\"" <emailaddy@domain.com>" -DGERRIT_CHANGE_URL=http://gerrit.domain.net/186523 -DGERRIT_CHANGE_ID=I174269fea6e64daf2b8752b15e7831dd824541c6 -DGERRIT_CHANGE_NUMBER=186523 "-DGERRIT_PATCHSET_UPLOADER_NAME=FIRSTNAME LASTNAME" "-DGERRIT_CHANGE_SUBJECT=This is the subject of my change" -DGERRIT_PATCHSET_UPLOADER_EMAIL=emailaddy@domain.com -DGERRIT_EVENT_HASH=621616435 -DGERRIT_BRANCH=BRANCHNAME -DGERRIT_REFSPEC=refs/changes/23/186523/1 -DGERRIT_PATCHSET_NUMBER=1 "-DGERRIT_CHANGE_OWNER_NAME=FIRSTNAME LASTNAME" -DGERRIT_PATCHSET_REVISION=d4b5a7e04cf927a7ffbcde139685b95ec579e08c -DGERRIT_PROJECT=git/project "-DGERRIT_CHANGE_OWNER=\""FIRSTNAME LASTNAME\"" <emailaddy@domain.com>" -DGERRIT_CHANGE_OWNER_EMAIL=emailaddy@domain.com clean dist && exit %%ERRORLEVEL%%"'
            Buildfile: c:\jenkins\workspace\JOBNAME\build.xml

            BUILD FAILED
            Target "LASTNAME" <emailaddy@domain.com>" does not exist in the project "PROJECTNAME".

            meggleton Mike Eggleton added a comment - I'm having this issue as well on windows: [JOBNAME] $ cmd.exe /C '"c:\jenkins\tools\Ant\Ant1.8.4\bin\ant.bat "-DGERRIT_PATCHSET_UPLOADER=\""FIRSTNAME LASTNAME\"" <emailaddy@domain.com>" -DGERRIT_CHANGE_URL= http://gerrit.domain.net/186523 -DGERRIT_CHANGE_ID=I174269fea6e64daf2b8752b15e7831dd824541c6 -DGERRIT_CHANGE_NUMBER=186523 "-DGERRIT_PATCHSET_UPLOADER_NAME=FIRSTNAME LASTNAME" "-DGERRIT_CHANGE_SUBJECT=This is the subject of my change" -DGERRIT_PATCHSET_UPLOADER_EMAIL=emailaddy@domain.com -DGERRIT_EVENT_HASH=621616435 -DGERRIT_BRANCH=BRANCHNAME -DGERRIT_REFSPEC=refs/changes/23/186523/1 -DGERRIT_PATCHSET_NUMBER=1 "-DGERRIT_CHANGE_OWNER_NAME=FIRSTNAME LASTNAME" -DGERRIT_PATCHSET_REVISION=d4b5a7e04cf927a7ffbcde139685b95ec579e08c -DGERRIT_PROJECT=git/project "-DGERRIT_CHANGE_OWNER=\""FIRSTNAME LASTNAME\"" <emailaddy@domain.com>" -DGERRIT_CHANGE_OWNER_EMAIL=emailaddy@domain.com clean dist && exit %%ERRORLEVEL%%"' Buildfile: c:\jenkins\workspace\JOBNAME\build.xml BUILD FAILED Target "LASTNAME" <emailaddy@domain.com>" does not exist in the project "PROJECTNAME".

            A quick-fix at https://github.com/robinrosenberg/gerrit-trigger-plugin/commit/2a3989132d9e9dece3252c90d7fa8afe4377ac9a

            It's bad since the variables have too many quotes if one wants to use them inside ant, on the other hand the build passed.

            The tests are broken on Windows, so you need to skip these.

            robinr Robin Rosenberg added a comment - A quick-fix at https://github.com/robinrosenberg/gerrit-trigger-plugin/commit/2a3989132d9e9dece3252c90d7fa8afe4377ac9a It's bad since the variables have too many quotes if one wants to use them inside ant, on the other hand the build passed. The tests are broken on Windows, so you need to skip these.
            ocroquette Olivier Croquette added a comment - Here are some more details and a good workaround: http://ocroquette.wordpress.com/2013/09/18/string-quoting-issues-in-jenkins-using-the-gerrit-and-gradle-plugins/
            rin_ne rin_ne added a comment -

            On Windows, you should treat all GT parameters via file by using the below plugin.
            https://wiki.jenkins-ci.org/display/JENKINS/Export+Parameters+Plugin

            rin_ne rin_ne added a comment - On Windows, you should treat all GT parameters via file by using the below plugin. https://wiki.jenkins-ci.org/display/JENKINS/Export+Parameters+Plugin

            People

              rsandell rsandell
              robinr Robin Rosenberg
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: