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

Modifying Folder configuration removes all config files

    XMLWordPrintable

Details

    Description

      On modifying folder configuration, all config file of the folder are removed.

      Steps to reproduce:

      1. Create a new folder
      2. Add a new config file (config-file-provider-plugin)
      3. Rename the folder or change any other field
      4. Check config files, there is no file

      I have checked the config.file on the file system, <configs class="sorted-set"> tag has no element after modifying configuration

      Attachments

        Issue Links

          Activity

            egutierrez Evaristo Gutierrez added a comment - - edited

            imod It's not actually needed to change anything, just opening the configuration page and saving again, makes this happen.

            This automated test reproduces the issue:

            @Test
                public void sameFolderPropertyAfterConfiguration() throws Exception {
                    Folder f1 = createFolder();
                    ConfigFileStore store = getStore(f1);
            
                    r.configRoundtrip(f1);
            
                    assertThat(store, Matchers.is(getStore(f1)));
                }
            

            I think it's related with AbstractFolder because the properties are not being sent in the json after configuring.

            I am not sure of why though. Maybe they are "invisible" properties?

            egutierrez Evaristo Gutierrez added a comment - - edited imod It's not actually needed to change anything, just opening the configuration page and saving again, makes this happen. This automated test reproduces the issue: @Test public void sameFolderPropertyAfterConfiguration() throws Exception { Folder f1 = createFolder(); ConfigFileStore store = getStore(f1); r.configRoundtrip(f1); assertThat(store, Matchers.is(getStore(f1))); } I think it's related with AbstractFolder because the properties are not being sent in the json after configuring. I am not sure of why though. Maybe they are "invisible" properties?

            Code changed in jenkins
            User: imod
            Path:
            src/test/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileActionTest.java
            http://jenkins-ci.org/commit/config-file-provider-plugin/679be2283e7bf812745d6278edcfdf5533a0b4d9
            Log:
            JENKINS-42389 add test case to demonstrate problem

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: src/test/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileActionTest.java http://jenkins-ci.org/commit/config-file-provider-plugin/679be2283e7bf812745d6278edcfdf5533a0b4d9 Log: JENKINS-42389 add test case to demonstrate problem

            egutierrez I also asked on the ML for some hints on how to resolve this issue - unfortunate with no luck  

            ...maybe you could ask around internally?

            imod Dominik Bartholdi added a comment - egutierrez I also asked on the ML for some hints on how to resolve this issue - unfortunate with no luck   ...maybe you could ask around internally?

            imod sure, let me try and will come back to you.

            egutierrez Evaristo Gutierrez added a comment - imod sure, let me try and will come back to you.
            jglick Jesse Glick added a comment -

            My suggestion on the list was to make FolderConfigFileProperty a ReconfigurableDescribable.

            jglick Jesse Glick added a comment - My suggestion on the list was to make FolderConfigFileProperty  a ReconfigurableDescribable .

            hmm, strange that never made to my mailbox  - thanks!

            imod Dominik Bartholdi added a comment - hmm, strange that never made to my mailbox  - thanks!

            Code changed in jenkins
            User: imod
            Path:
            src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileProperty.java
            http://jenkins-ci.org/commit/config-file-provider-plugin/3a4282fe3ead6de1de1d3b8034646083f1dfc380
            Log:
            [FIXED JENKINS-42389] implement ReconfigurableDescribable to fix data lost when folder gets updated

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileProperty.java http://jenkins-ci.org/commit/config-file-provider-plugin/3a4282fe3ead6de1de1d3b8034646083f1dfc380 Log: [FIXED JENKINS-42389] implement ReconfigurableDescribable to fix data lost when folder gets updated

            Code changed in jenkins
            User: imod
            Path:
            src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileProperty.java
            src/test/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileActionTest.java
            http://jenkins-ci.org/commit/config-file-provider-plugin/f7206995991ee2cbbc2dca750aee2290609f994f
            Log:
            Merge branch 'JENKINS-42389'

            Compare: https://github.com/jenkinsci/config-file-provider-plugin/compare/dbda7551cec1...f7206995991e

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileProperty.java src/test/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileActionTest.java http://jenkins-ci.org/commit/config-file-provider-plugin/f7206995991ee2cbbc2dca750aee2290609f994f Log: Merge branch ' JENKINS-42389 ' Compare: https://github.com/jenkinsci/config-file-provider-plugin/compare/dbda7551cec1...f7206995991e

            People

              imod Dominik Bartholdi
              sadiqkhoja Sadiq Khoja
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: