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

JobDSL Folder Creation Destroys Credentials

    Details

    • Similar Issues:

      Description

      When using job-dsl-plugin to create a folder 

      folder(my_folder) { 

        displayname("my_folder_name")

      }

      If the folder exists with Credentials attached to it, they are lost on recreation  . Is there anyway to wrap this in a conditional? if!(folder(my_folder) {blah..blah....}.  I believe the desired behaviour here is to not blow away the credentials attached at the folder level.

       

       

        Attachments

          Issue Links

            Activity

            Hide
            slowikone Bartlomiej Slowik added a comment -

            Same issue here - its makes hard in our use case to manage auto-creation of folders and jobs. I would also favor an update/merge strategy instead of a hard override.

            Show
            slowikone Bartlomiej Slowik added a comment - Same issue here - its makes hard in our use case to manage auto-creation of folders and jobs. I would also favor an update/merge strategy instead of a hard override.
            Hide
            docwhat Christian Höltje added a comment -

            The deletion of credentials is so unexpected. I just lost 95 folders with 100s of credentials due to this. I cannot express how frustrating this is.

            I was able to recover most via the Job Config History plugin, but apparently "Secret File" credentials are magic and seem to be truly gone.

            Show
            docwhat Christian Höltje added a comment - The deletion of credentials is so unexpected. I just lost 95 folders with 100s of credentials due to this. I cannot express how frustrating this is. I was able to recover most via the Job Config History plugin, but apparently "Secret File" credentials are magic and seem to be truly gone.
            Hide
            gpaciga Gregory Paciga added a comment -

            The suggestion in the first comment works, but only if not running in the groovy sandbox, or the user running the job is an admin (otherwise, every change to scripts needs to be approved by an admin).

            Show
            gpaciga Gregory Paciga added a comment - The suggestion in the first comment  works, but only if not running in the groovy sandbox, or the user running the job is an admin (otherwise, every change to scripts needs to be approved by an admin).
            Hide
            jamietanna Jamie Tanna added a comment -

            I've been looking into this today, and have found a way to handle this within the plugin itself (via the IntelliJ debugger). I am going to be working on integrating this into the plugin itself, then will raise a PR on GitHub.

            Show
            jamietanna Jamie Tanna added a comment - I've been looking into this today, and have found a way to handle this within the plugin itself (via the IntelliJ debugger). I am going to be working on integrating this into the plugin itself, then will raise a PR on GitHub.
            Hide
            jamietanna Jamie Tanna added a comment - - edited

            I've raised https://github.com/jenkinsci/job-dsl-plugin/pull/1232 as a suggested fix for this.

            Show
            jamietanna Jamie Tanna added a comment - - edited I've raised https://github.com/jenkinsci/job-dsl-plugin/pull/1232 as a suggested fix for this.

              People

              • Assignee:
                daspilker Daniel Spilker
                Reporter:
                smithx10 Bruce Smith
              • Votes:
                10 Vote for this issue
                Watchers:
                20 Start watching this issue

                Dates

                • Created:
                  Updated: