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

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

    Details

    • Type: Bug
    • Status: Fixed but Unreleased (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: job-dsl-plugin
    • Labels:
    • Environment:
      Jenkins: 2.190.1
      job-dsl-plugin: 1.77
    • Similar Issues:

      Description

      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. 

       

        Attachments

          Activity

          Show
          _wayne wayne goyer added a comment - https://github.com/jenkinsci/job-dsl-plugin/pull/1230

            People

            • Assignee:
              _wayne wayne goyer
              Reporter:
              _wayne wayne goyer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: