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

Creates addition empty connection cfg. after applying JCasC

      Simple YAML definition as:

      unclassified:
        gitLabConnectionConfig:
          connections:
          - apiTokenId: "token"
            clientBuilderId: "autodetect"
            name: "test"
            url: "https://test.foo.com"
      

      The result is 2 connections in UI as you can see in the attached screenshot. The second one shouldn't be there.

          [JENKINS-57793] Creates addition empty connection cfg. after applying JCasC

          Owen Mehegan added a comment -

          ndeloof do you have any thoughts about why this would happen? The GitLab plugin has not been modified at all to support CasC.

          Owen Mehegan added a comment - ndeloof do you have any thoughts about why this would happen? The GitLab plugin has not been modified at all to support CasC.

          gitlab is supported and fully tested by JCasC plugin "integrations" module.

          see https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/integrations/src/test/resources/io/jenkins/plugins/casc/GitLabTest.yml

           

          please also tell us which version of gitlab plugin you're using.

          Nicolas De Loof added a comment - gitlab is supported and fully tested by JCasC plugin "integrations" module. see  https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/integrations/src/test/resources/io/jenkins/plugins/casc/GitLabTest.yml   please also tell us which version of gitlab plugin you're using.

          Used versions:

          • gitlab-plugin 1.5.12
          • configuration-as-code 1.20
          • Jenkins core 2.164.2

          Pavel Janoušek added a comment - Used versions: gitlab-plugin 1.5.12 configuration-as-code 1.20 Jenkins core 2.164.2

          Pavel Janoušek added a comment - - edited

          Also JCasC export doesn't work due to io.jenkins.plugins.casc.ConfiguratorException: Can't read attribute 'connectionTimeout' from com.dabsquared.gitlabjenkins.connection.GitLabConnection@a566e.

          An update after even a deeper investigation:
          Above is valid right after Jenkins booted-up via replaying JCasC YUM definition, so the memory moder for this plug-in is somehow corrupted.

          But when you go to Global configuration (and see two GitLab connections, one from your declaration, second 'an empty' one) and change there anything (even not related to the gitlab plugin), than save or apply the current setting and do the JCasC export, there isn't an exception, but exported configuration like:

          unclassified:
            gitLabConnectionConfig:
              connections:
              - apiTokenId: "token"
                clientBuilderId: "autodetect"
                connectionTimeout: 10
                ignoreCertificateErrors: false
                name: "test"
                readTimeout: 10
                url: "https://test.foo.com"
              - clientBuilderId: "autodetect"
                connectionTimeout: 10
                ignoreCertificateErrors: false
                readTimeout: 10
          

          Pavel Janoušek added a comment - - edited Also JCasC export doesn't work due to io.jenkins.plugins.casc.ConfiguratorException: Can't read attribute 'connectionTimeout' from com.dabsquared.gitlabjenkins.connection.GitLabConnection@a566e . An update after even a deeper investigation: Above is valid right after Jenkins booted-up via replaying JCasC YUM definition, so the memory moder for this plug-in is somehow corrupted. But when you go to Global configuration (and see two GitLab connections, one from your declaration, second 'an empty' one) and change there anything (even not related to the gitlab plugin), than save or apply the current setting and do the JCasC export, there isn't an exception, but exported configuration like: unclassified: gitLabConnectionConfig: connections: - apiTokenId: "token" clientBuilderId: "autodetect" connectionTimeout: 10 ignoreCertificateErrors: false name: "test" readTimeout: 10 url: "https: //test.foo.com" - clientBuilderId: "autodetect" connectionTimeout: 10 ignoreCertificateErrors: false readTimeout: 10

            owenmehegan Owen Mehegan
            pajasoft Pavel Janoušek
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: