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

"Repository URL" field in mercurial plugin should trim input

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Trivial
    • Resolution: Fixed
    • Component/s: mercurial-plugin
    • Labels:
      None
    • Environment:
      linux, solaris
    • Similar Issues:

      Description

      If you type url of repository location and add space at the end jenkins will fail to checkout the code.
      Probably this have to be fixed in core to trim all user provided string.

        Attachments

          Activity

          kofemann kofemann created issue -
          Hide
          kofemann kofemann added a comment -

          an example from output: hg clone --rev default "https://kofemann@code.google.com/p/nio-jrpc/ "

          Show
          kofemann kofemann added a comment - an example from output: hg clone --rev default "https://kofemann@code.google.com/p/nio-jrpc/ "
          davidmc24 davidmc24 made changes -
          Field Original Value New Value
          Assignee davidmc24 [ davidmc24 ]
          Hide
          davidmc24 davidmc24 added a comment -

          The way this sort of situation is handled in Jenkins is to pass the input to Util.fixEmptyAndTrim or a similar function. Since this isn't a systematic problem with Jenkins, we'll treat this ticket as just a report of the particular fields that currently have problematic behaviors. Specifically, I'll work on a fix for the URL fields in the Mercurial plugin.

          Show
          davidmc24 davidmc24 added a comment - The way this sort of situation is handled in Jenkins is to pass the input to Util.fixEmptyAndTrim or a similar function. Since this isn't a systematic problem with Jenkins, we'll treat this ticket as just a report of the particular fields that currently have problematic behaviors. Specifically, I'll work on a fix for the URL fields in the Mercurial plugin.
          davidmc24 davidmc24 made changes -
          Summary jenkins have to trim imput from forms "Repository URL" field in mercurial plugin should trim input
          Description If you type url of repository location and add space ant the end jenkins will fail to checkout the code.
          Probably this have to be fixed in core to trim all user provided string.
          If you type url of repository location and add space at the end jenkins will fail to checkout the code.
          Probably this have to be fixed in core to trim all user provided string.
          Component/s core [ 15593 ]
          Hide
          kofemann kofemann added a comment -

          well, of course you can solve it in mercurial plug-in. Nevertheless a search in jenkins/hudson bugs shows similar issues in other places as well. Has been that fix for all forms on a first report, them all other bug where not there.

          Show
          kofemann kofemann added a comment - well, of course you can solve it in mercurial plug-in. Nevertheless a search in jenkins/hudson bugs shows similar issues in other places as well. Has been that fix for all forms on a first report, them all other bug where not there.
          Hide
          davidmc24 davidmc24 added a comment -

          The fix will likely be the same or very similar for all cases, but it needs to be applied on a case-by-case basis because there are cases where you can't trim, because the trailing whitespace is significant. That there other tickets for the same type of issue in pages just means that those issues haven't been fixed yet, not that the fix should be different. If there are other form fields where this is causing you issues, I recommend that you submit separate tickets for each field (as long as there isn't already a ticket for that field, of course).

          Show
          davidmc24 davidmc24 added a comment - The fix will likely be the same or very similar for all cases, but it needs to be applied on a case-by-case basis because there are cases where you can't trim, because the trailing whitespace is significant. That there other tickets for the same type of issue in pages just means that those issues haven't been fixed yet, not that the fix should be different. If there are other form fields where this is causing you issues, I recommend that you submit separate tickets for each field (as long as there isn't already a ticket for that field, of course).
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: David M. Carr
          Path:
          src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java
          http://jenkins-ci.org/commit/mercurial-plugin/3ffdb3e767d6b669955719e41e6561f5aa54c4d7
          Log:
          [FIXED JENKINS-11460] "Repository URL" field in mercurial plugin should trim input

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: David M. Carr Path: src/main/java/hudson/plugins/mercurial/MercurialSCM.java src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java http://jenkins-ci.org/commit/mercurial-plugin/3ffdb3e767d6b669955719e41e6561f5aa54c4d7 Log: [FIXED JENKINS-11460] "Repository URL" field in mercurial plugin should trim input
          scm_issue_link SCM/JIRA link daemon made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          davidmc24 davidmc24 made changes -
          Fix Version/s current [ 10162 ]
          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_mercurial #66
          [FIXED JENKINS-11460] "Repository URL" field in mercurial plugin should trim input

          david :
          Files :

          • src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java
          • src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          Show
          dogfood dogfood added a comment - Integrated in plugins_mercurial #66 [FIXED JENKINS-11460] "Repository URL" field in mercurial plugin should trim input david : Files : src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 141687 ] JNJira + In-Review [ 189757 ]

            People

            • Assignee:
              davidmc24 davidmc24
              Reporter:
              kofemann kofemann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: