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

Prevent adding folders that are still referenceable with different casing to the unreferenced list

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • job-dsl-plugin
    • Jenkins: 2.190.1
      job-dsl-plugin: 1.77
    • job-dsl-plugin 1.78

      When generating jobs using the job-dsl-plugin, jobs that are created under folders that already exist with a folder name that doesn't match the casing seem to be referenced to the correct folder under the hood. However, when you remove the last job, or folder definition, that matches this casing while other jobs still exist under the original casing it gets added to the unreferenced list and, in our case, deleted.

      Example:

      A single job gets created:

       

      # job definition
      folder('test-folder')
      job('test-folder/someJob')
      
      # seed-job output
      Added items:
           GeneratedJob{name='test-folder'}
           GeneratedJob{name='test-folder/someJob'}

      A second job gets created, with the same folder name cased differently:

       

       

      # job definition
      folder('TEST-FOLDER')
      job('TEST-FOLDER/newJob')
      
      # seed-job output
      Added items:
           GeneratedJob{name='TEST-FOLDER'}
           GeneratedJob{name='TEST-FOLDER/newJob'}

      Second job gets removed by deleting the job definition

      # seed-job output
      Unreferenced items:
           GeneratedJob{name='TEST-FOLDER'}
           GeneratedJob{name='TEST-FOLDER/newJob'}
       Removed items:
           GeneratedJob{name='TEST-FOLDER'}

      When this folder gets deleted, it deletes the job and history for the first job created as well. 

       

            jamietanna Jamie Tanna
            _wayne wayne goyer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: