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

Bad validation of Perforce View

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      Linux 2.6.18-128.el5xen #1 SMP Wed Dec 17 12:22:24 EST 2008 i686 i686 i386 GNU/Linux
    • Similar Issues:

      Description

      I am getting a form validation error for my Perforce view when configuring my jobs. I have the following for my view:

      //Tuxedo/MAIN/Product/Fast_Forward/pom.xml //qaadmin_rocdevl3_hudson-core/pom.xml
      //Tuxedo/MAIN/Product/Fast_Forward/Core/Source/... //qaadmin_rocdevl3_hudson-core/Core/Source/...
      //Tuxedo/MAIN/Product/Fast_Forward/Core/pom.xml //qaadmin_rocdevl3_hudson-core/Core/pom.xml

      and I get the following error:

      Invalid mapping://Tuxedo/MAIN/Product/Fast_Forward/pom.xml //qaadmin_rocdevl3_hudson-core/pom.xml

      However, the job seems to work just fine. In looking at the source code package hudson.plugins.perforce, I see the following string pattern which seems to be used for this validation:

      ^([+-]?//\\S+?/\\S+)\\s+//\\S+?(/
      S+)$

      This seems to match that first line of my mapping. I checked for non-whitespace characters at the end of my line, and there do not appear to be any.

      I am using the latest Perforce plugin, as well as the latest Hudson build.

        Attachments

          Activity

          Hide
          rpetti Rob Petti added a comment -

          It looks like some browsers use windows-style line endings (\r\n) instead of the unix style (\n). I recently switched to chrome, and my issues went away, but opera and firefox were always giving me those validation errors. I had assumed it was because my mappings were somewhat crazy, but I guess not.

          I'll fix the regex so it recognizes those line endings properly.

          Show
          rpetti Rob Petti added a comment - It looks like some browsers use windows-style line endings (\r\n) instead of the unix style (\n). I recently switched to chrome, and my issues went away, but opera and firefox were always giving me those validation errors. I had assumed it was because my mappings were somewhat crazy, but I guess not. I'll fix the regex so it recognizes those line endings properly.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : rpetti
          Path:
          trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java
          http://jenkins-ci.org/commit/28294
          Log:
          [FIXED JENKINS-5849] fixed form validation false negatives when using browsers that have windows-style line endings on form data

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : rpetti Path: trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java http://jenkins-ci.org/commit/28294 Log: [FIXED JENKINS-5849] fixed form validation false negatives when using browsers that have windows-style line endings on form data

            People

            • Assignee:
              Unassigned
              Reporter:
              froyland froyland
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: