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

Regenerating the folder removes all config files , all config file of the folder are removed.

      Regenerating the folder removes all config files , all config file of the folder are removed.

      Steps to reproduce:

      1. Create a new folder Add a new config file (config-file-provider-plugin)
      2. Regenerate the folder Check config files, there is no file
      3. I am using 2.387.3.5 cloubees SDA CI
      4. Config file provider version - 3.11.1

          [JENKINS-71861] Regenerating the folder removes all config files , all config file of the folder are removed.

          Mark Waite added a comment -

          gugan usually you want to report issues with CloudBees SDA CI to https://support.cloudbees.com

          Mark Waite added a comment - gugan usually you want to report issues with CloudBees SDA CI to https://support.cloudbees.com

          Gugan added a comment - - edited

          Hi markewaite I checked with CloudBees SDA CI to https://support.cloudbees.com. They are telling this could be a issue with Job-Dsl-plugin and it's not managed by them.

          Below is the code I am using for re creating the folder, which wipes out the config files .

          I tried in 2 ways,

          1. First I tried just recreating the folder using below code
          folder(mainFolder) {
              description("${serviceName} pipeline jobs")
              displayName(serviceName)
          }
           

          2. I tried retaining the existing properties from the existing folder then add it in the folder properties

          def mainFolderObj = Jenkins.instance.getItemByFullName(mainFolder) 
          println mainFolderObj.getProperties() 
          def capturedConfigFileProperty = null 
          if (mainFolderObj instanceof com.cloudbees.hudson.plugins.folder.Folder) {         capturedConfigFileProperty = mainFolderObj.getProperties().find { it instanceof FolderConfigFileProperty  } } 
          println capturedConfigFileProperty.getConfigs() 
          folder(mainFolder) {     
            description("${serviceName} pipeline jobs")     
            displayName(serviceName)   
            properties{       
              configFiles {       
                capturedConfigFileProperty.getConfigs() 
              } 
            } 
          }
          

          Gugan added a comment - - edited Hi markewaite I checked with CloudBees SDA CI to  https://support.cloudbees.com . They are telling this could be a issue with Job-Dsl-plugin and it's not managed by them. Below is the code I am using for re creating the folder, which wipes out the config files . I tried in 2 ways, First I tried just recreating the folder using below code folder(mainFolder) { description( "${serviceName} pipeline jobs" ) displayName(serviceName) } 2. I tried retaining the existing properties from the existing folder then add it in the folder properties def mainFolderObj = Jenkins.instance.getItemByFullName(mainFolder) println mainFolderObj.getProperties() def capturedConfigFileProperty = null if (mainFolderObj instanceof com.cloudbees.hudson.plugins.folder.Folder) {     capturedConfigFileProperty = mainFolderObj.getProperties().find { it instanceof FolderConfigFileProperty  } } println capturedConfigFileProperty.getConfigs() folder(mainFolder) {     description( "${serviceName} pipeline jobs" )     displayName(serviceName)   properties{       configFiles {       capturedConfigFileProperty.getConfigs() } } }

          Gugan added a comment -

          markewaite please help me on this issue or redirect me to the right place.

          Gugan added a comment - markewaite please help me on this issue or redirect me to the right place.

          Mark Waite added a comment -

          I'm sincerely sorry gugan, but I'm not a Job DSL user. I'm aware of what it does and have a general idea of how it does it, but I don't know the specifics of its implementation and don't have the time currently to develop those skills. I think that your println based debugging technique is the same technique that I would use to explore it further. You might also ask on https://community.jenkins.io in case a Job DSL user there is willing to offer more insights. There are more readers on of individual posts on community.jenkins.io than there are people who read issue reports in the Jenkins issue tracker.

          Mark Waite added a comment - I'm sincerely sorry gugan , but I'm not a Job DSL user. I'm aware of what it does and have a general idea of how it does it, but I don't know the specifics of its implementation and don't have the time currently to develop those skills. I think that your println based debugging technique is the same technique that I would use to explore it further. You might also ask on https://community.jenkins.io in case a Job DSL user there is willing to offer more insights. There are more readers on of individual posts on community.jenkins.io than there are people who read issue reports in the Jenkins issue tracker.

          Gugan added a comment -

          Thank you so much markewaite I will check further on this

          Gugan added a comment - Thank you so much markewaite I will check further on this

            Unassigned Unassigned
            gugan Gugan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: