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

After upgrade matrix jobs no longer work with perforce-plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      perforce-1.3.31
    • Similar Issues:

      Description

      We use ${JOB_NAME} in the client spec field as recommended but with the latest version of the plugin, this broke as it is no longer sanitizing the output. I get this:

      [i386-Ubuntu-12.04&&!dedicated] $ p4 -s client -i
      Caught exception communicating with perforce. Slashes not allowed in 'devops-p4python/label=i386-Ubuntu-12.04&&!dedicated-USLOLBLDV145-450408555'.

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            @Erik
            What plugin version have you used before?
            It would be also useful to know the core's version

            Show
            oleg_nenashev Oleg Nenashev added a comment - @Erik What plugin version have you used before? It would be also useful to know the core's version
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Symbol replacement code exists in 1.3.23. (PerforceSCM::getSafeJobName(AbstractProject project))
            I'll check what commit altered the behavior

            Show
            oleg_nenashev Oleg Nenashev added a comment - Symbol replacement code exists in 1.3.23. (PerforceSCM::getSafeJobName(AbstractProject project)) I'll check what commit altered the behavior
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            The regression appears in 1.3.31.
            Since this version Perforce substitutes variables from the build environment if it is possible.
            In JOB_NAME's case it takes the initial variable value instead of the escaped one.

            I'll fix the issue and create proper converters

            Show
            oleg_nenashev Oleg Nenashev added a comment - The regression appears in 1.3.31. Since this version Perforce substitutes variables from the build environment if it is possible. In JOB_NAME's case it takes the initial variable value instead of the escaped one. I'll fix the issue and create proper converters
            Show
            oleg_nenashev Oleg Nenashev added a comment - Fix is ready: https://github.com/jenkinsci/perforce-plugin/pull/65
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/hudson/plugins/perforce/utils/JobSubstitutionHelper.java
            src/main/java/hudson/plugins/perforce/utils/MacroStringHelper.java
            src/test/java/com/synopsys/arc/jenkinsci/plugins/perforce/MacroStringHelperTest.java
            src/test/java/hudson/plugins/perforce/PerforceSCMTest.java
            src/test/java/hudson/plugins/perforce/utils/JobSubstitutionHelperTest.java
            src/test/java/hudson/plugins/perforce/utils/MacroStringHelperTest.java
            http://jenkins-ci.org/commit/perforce-plugin/7381efb7105c89c8d505225f361ddb5badf59a32
            Log:
            [FIXED JENKINS-26119] - Inject custom JOB_NAME during the environment substitution

            Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/hudson/plugins/perforce/utils/JobSubstitutionHelper.java src/main/java/hudson/plugins/perforce/utils/MacroStringHelper.java src/test/java/com/synopsys/arc/jenkinsci/plugins/perforce/MacroStringHelperTest.java src/test/java/hudson/plugins/perforce/PerforceSCMTest.java src/test/java/hudson/plugins/perforce/utils/JobSubstitutionHelperTest.java src/test/java/hudson/plugins/perforce/utils/MacroStringHelperTest.java http://jenkins-ci.org/commit/perforce-plugin/7381efb7105c89c8d505225f361ddb5badf59a32 Log: [FIXED JENKINS-26119] - Inject custom JOB_NAME during the environment substitution Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/hudson/plugins/perforce/utils/JobSubstitutionHelper.java
            src/main/java/hudson/plugins/perforce/utils/MacroStringHelper.java
            src/test/java/com/synopsys/arc/jenkinsci/plugins/perforce/MacroStringHelperTest.java
            src/test/java/hudson/plugins/perforce/PerforceSCMTest.java
            src/test/java/hudson/plugins/perforce/utils/JobSubstitutionHelperTest.java
            src/test/java/hudson/plugins/perforce/utils/MacroStringHelperTest.java
            http://jenkins-ci.org/commit/perforce-plugin/762e201784d772b08c3fff457595b467e0ed99c7
            Log:
            Merge pull request #65 from synopsys-arc-oss/JENKINS-26119-fix

            [FIXED JENKINS-26119] - Restore the legacy variable escaping approach

            Compare: https://github.com/jenkinsci/perforce-plugin/compare/06a1d0ced6c5...762e201784d7

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/hudson/plugins/perforce/utils/JobSubstitutionHelper.java src/main/java/hudson/plugins/perforce/utils/MacroStringHelper.java src/test/java/com/synopsys/arc/jenkinsci/plugins/perforce/MacroStringHelperTest.java src/test/java/hudson/plugins/perforce/PerforceSCMTest.java src/test/java/hudson/plugins/perforce/utils/JobSubstitutionHelperTest.java src/test/java/hudson/plugins/perforce/utils/MacroStringHelperTest.java http://jenkins-ci.org/commit/perforce-plugin/762e201784d772b08c3fff457595b467e0ed99c7 Log: Merge pull request #65 from synopsys-arc-oss/ JENKINS-26119 -fix [FIXED JENKINS-26119] - Restore the legacy variable escaping approach Compare: https://github.com/jenkinsci/perforce-plugin/compare/06a1d0ced6c5...762e201784d7
            Hide
            elatt Erik Lattimore added a comment -

            Sorry for my lack of response. For some reason I wasn't getting any email notifications on this ticket despite being a watcher (I'll look into that further). For what it was worth, we were running with 1.3.28 with no error and the upgrade to 1.3.31 caused the problems.

            Show
            elatt Erik Lattimore added a comment - Sorry for my lack of response. For some reason I wasn't getting any email notifications on this ticket despite being a watcher (I'll look into that further). For what it was worth, we were running with 1.3.28 with no error and the upgrade to 1.3.31 caused the problems.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Robert released the new version with the fix yesterday.
            There's an issue with Update Center on Jenkins INFRA, but the release should become available soon. You can also get it from GitHub for test purposes.

            Actually, I fixed the legacy behavior for JOB_NAME only. Other variables (e.g. BUILD_TAG) won't be escaped according to the original implementation.

            Show
            oleg_nenashev Oleg Nenashev added a comment - Robert released the new version with the fix yesterday. There's an issue with Update Center on Jenkins INFRA, but the release should become available soon. You can also get it from GitHub for test purposes. Actually, I fixed the legacy behavior for JOB_NAME only. Other variables (e.g. BUILD_TAG) won't be escaped according to the original implementation.

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                elatt Erik Lattimore
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: