• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Trivial Trivial
    • core
    • None
    • core 1.527

      When creating a new (freestyle) job by copying some existing job:

      1) If the existing job name begins with whitespace, the dropdown list does not work.

      2) If the existing job name begins or ends with whitespace, after submitting the form we get "Error: No such job: name"

      It's not obvious in either case that extra whitespace is the problem.

      Typically the whitespace comes from copying/pasting a job name from the list in the view UI, so this bug just makes that a bit less convenient.

          [JENKINS-19203] New job with whitespace in name fails

          Kanstantsin Shautsou added a comment - - edited

          1) dropdown list appeared for me when i type space
          2) successfully copied job that starts and ends with spaces.

          One note, if you are creating new job that starts/ends with space, it stripe spaces from name. You can get spaces back by renaming job.
          Please, ensure that you really has job with space.

          Kanstantsin Shautsou added a comment - - edited 1) dropdown list appeared for me when i type space 2) successfully copied job that starts and ends with spaces. One note, if you are creating new job that starts/ends with space, it stripe spaces from name. You can get spaces back by renaming job. Please, ensure that you really has job with space.

          Ben Golding added a comment -

          I'm not sure I was clear enough about the issue.
          My job names do not contain spaces, only alphanumeric and underscore.

          The issue is rather: to copy an existing job named 'foo' (no whitespace in the name)

          1) If I type ' foo' (whitespace at start) into the Copy from: textbox

          • The dropdown list does not work
          • After submitting the form we get "Error: No such job: foo"

          2) If I type 'foo ' (whitespace at end) into the Copy from: textbox

          • After submitting the form we get "Error: No such job: foo"

          So it's a usability issue of the new job form, usually the problem is when you copy and paste as I said.
          The Copy from: textbox should strip the spaces exactly like Job name: textbox.

          Also I don't think to allow whitespace at the start or end of a job name is a good idea, it's only causing more confusion. Maybe the configure form should also get fixed to strip the name.

          Ben Golding added a comment - I'm not sure I was clear enough about the issue. My job names do not contain spaces, only alphanumeric and underscore. The issue is rather: to copy an existing job named 'foo' (no whitespace in the name) 1) If I type ' foo' (whitespace at start) into the Copy from: textbox The dropdown list does not work After submitting the form we get "Error: No such job: foo" 2) If I type 'foo ' (whitespace at end) into the Copy from: textbox After submitting the form we get "Error: No such job: foo" So it's a usability issue of the new job form, usually the problem is when you copy and paste as I said. The Copy from: textbox should strip the spaces exactly like Job name: textbox. Also I don't think to allow whitespace at the start or end of a job name is a good idea, it's only causing more confusion. Maybe the configure form should also get fixed to strip the name.

          Copy-paste without spaces
          As i see spaces are allowed and this can't be disabled without breaking everybody jobs.

          Kanstantsin Shautsou added a comment - Copy-paste without spaces As i see spaces are allowed and this can't be disabled without breaking everybody jobs.

          1) jenkins does not allow you to create a job that starts with a white space. if you create a free style project. Once you to the configuration page the white space is trimmed in the project name. so how did the job with a white space get in there in the first place?

          Also if i enter the name of the project that i tried to have a white space name in front in the copy section it finds it.

          Tried this on
          Jenkins ver. 1.528

          Can not reproduce this issue.

          martin naughton added a comment - 1) jenkins does not allow you to create a job that starts with a white space. if you create a free style project. Once you to the configuration page the white space is trimmed in the project name. so how did the job with a white space get in there in the first place? Also if i enter the name of the project that i tried to have a white space name in front in the copy section it finds it. Tried this on Jenkins ver. 1.528 Can not reproduce this issue.

          Daniel Beck added a comment -

          Martin: See comment at '19/Aug/13 9:49 AM'. This is about some programs' (Internet Explorer and Outlook come to mind) annoying behavior to wrap selection in spaces when copy/pasting.

          Example: You have a job "Foo" (no whitespace). You want to create a copy of it named "Bar". So now you select Foo's name somewhere on the UI and copy it to your clipboard, but because you use Internet Explorer, it's wrapped in spaces. On the 'Create Job' page, you paste it into the "Copy existing Job" field, but it's " Foo " instead of "Foo".

          Ben, can you confirm this?

          Daniel Beck added a comment - Martin: See comment at '19/Aug/13 9:49 AM'. This is about some programs' (Internet Explorer and Outlook come to mind) annoying behavior to wrap selection in spaces when copy/pasting. Example: You have a job "Foo" (no whitespace). You want to create a copy of it named "Bar". So now you select Foo's name somewhere on the UI and copy it to your clipboard, but because you use Internet Explorer, it's wrapped in spaces. On the 'Create Job' page, you paste it into the "Copy existing Job" field, but it's " Foo " instead of "Foo". Ben, can you confirm this?

          ok see it now. did not see the comments. it is some thing that we should fix at all?

          martin naughton added a comment - ok see it now. did not see the comments. it is some thing that we should fix at all?

          Daniel Beck added a comment -

          If project names can start and end with spaces (and according to Kanstantsin Shautsou, they can), the desired change would actually break the same use case for those jobs. If you have, for some insane reason, projects " foo" and "foo" and actually enter " foo", it really should select the former.

          IMO this is not a bug.

          Daniel Beck added a comment - If project names can start and end with spaces (and according to Kanstantsin Shautsou, they can), the desired change would actually break the same use case for those jobs. If you have, for some insane reason, projects " foo" and "foo" and actually enter " foo", it really should select the former. IMO this is not a bug.

          Ben Golding added a comment -

          Hi Daniel. I can confirm the underlying issue is related to IE/Outlook and copy/paste behaviour.
          For me it's very annoying, but of course you can workaround by removing the spaces as Kanstantsin suggested.

          As I wrote already, it seems crazy to allow whitespace at the start or end of a job name, IMHO we should change this.

          Ben Golding added a comment - Hi Daniel. I can confirm the underlying issue is related to IE/Outlook and copy/paste behaviour. For me it's very annoying, but of course you can workaround by removing the spaces as Kanstantsin suggested. As I wrote already, it seems crazy to allow whitespace at the start or end of a job name, IMHO we should change this.

          Daniel Beck added a comment -

          Given that jobs actually can be renamed to contain spaces at the beginning and/or end of the name (unless a sane job name pattern is defined), this is not an issue that can be resolved without addressing those job names first. That's why I'm closing this – there's actually a legitimate use of leading/trailing spaces in the job name reference field that will break when automatically trimming.

          FWIW I experienced a lot of headache due to users copy-pasting from Outlook into parameterized jobs' string parameter text fields. I had to resort to providing mostly choice parameters because they couldn't manage trimming the strings themselves consistently. So it's not just job names – and parameters shouldn't be automatically changed in any way for any reason IMO. This weakens this issue further for consistency reasons (why trim one field, but not the other?).

          (I'm no particular authority, and my contributions to Jenkins are insignificant, so feel free to reopen if you disagree.)

          Daniel Beck added a comment - Given that jobs actually can be renamed to contain spaces at the beginning and/or end of the name (unless a sane job name pattern is defined), this is not an issue that can be resolved without addressing those job names first. That's why I'm closing this – there's actually a legitimate use of leading/trailing spaces in the job name reference field that will break when automatically trimming. FWIW I experienced a lot of headache due to users copy-pasting from Outlook into parameterized jobs' string parameter text fields. I had to resort to providing mostly choice parameters because they couldn't manage trimming the strings themselves consistently. So it's not just job names – and parameters shouldn't be automatically changed in any way for any reason IMO. This weakens this issue further for consistency reasons (why trim one field, but not the other?). (I'm no particular authority, and my contributions to Jenkins are insignificant, so feel free to reopen if you disagree.)

          agreed. i would close it.

          martin naughton added a comment - agreed. i would close it.

            Unassigned Unassigned
            bgolding Ben Golding
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: