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

job not created when name ends with whitespace but no exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: core, job-dsl-plugin
    • Labels:
      None
    • Environment:
      jenkins: 2.44
      job-dsl-plugin: 1.57
      os: windows 10
    • Similar Issues:

      Description

      Hi.

      I encountered this issue by accident and can see in jira that whitespaces have been an issue before.

      When providing a simple dsl such as:

      job('test ')

      It executes without and exceptions but yet doesn't create the job.
      I'd expect that checkGoodName would catch it and throw and exception.
      Thanks in advance!

      Processing provided DSL script
      Added items:
      GeneratedJob

      Unknown macro: {name='test '}

      Unreferenced items:
      GeneratedJob

      Unknown macro: {name='test'}

      Finished: SUCCESS

        Attachments

          Activity

          Hide
          daspilker Daniel Spilker added a comment -

          I can not reproduce the problem. The job has been generated, it's URL is http://localhost:8080/job/test%20/.

          Processing provided DSL script
          Added items:
              GeneratedJob{name='test '}
          Finished: SUCCESS
          
          Show
          daspilker Daniel Spilker added a comment - I can not reproduce the problem. The job has been generated, it's URL is http://localhost:8080/job/test%20/ . Processing provided DSL script Added items: GeneratedJob{name= 'test ' } Finished: SUCCESS
          Hide
          sdrzazga Stefan Drzazga added a comment -

          Sorry for the late reply!
          I verified what I escalated previously and it works perfectly fine under linux. It only seems to be reproducible under windows.

          Show
          sdrzazga Stefan Drzazga added a comment - Sorry for the late reply! I verified what I escalated previously and it works perfectly fine under linux. It only seems to be reproducible under windows.
          Hide
          daspilker Daniel Spilker added a comment -

          Job DSL considers every name a good name that passes checkGoodName. Then Job DSL passes the name to core APIs to create or update jobs.

          IMHO this should be fixed in core, e.g. by not allowing names that start or end with whitespace.

          Show
          daspilker Daniel Spilker added a comment - Job DSL considers every name a good name that passes checkGoodName . Then Job DSL passes the name to core APIs to create or update jobs. IMHO this should be fixed in core, e.g. by not allowing names that start or end with whitespace.

            People

            • Assignee:
              Unassigned
              Reporter:
              sdrzazga Stefan Drzazga
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: