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

Cobertura misconfiguration destroys 'publishers' node

      The following things happen when the 'sourceEncoding' value is misconfigured in your DSL script (AKA assign a value that isn't in the dropdown):

      When creating the job, the 'publishers' node is generated empty, no matter if other publishers are also defined.
      When regenerating the job, the 'publishers' node is generated properly, but none of the publishers show up in the UI.

      Console output of the seed job doesn't complain about anything.

      Example:

      job("RIP_publishers") {
          publishers {
              cobertura('**/target/site/cobertura/coverage.xml') {
                  sourceEncoding('UTF-8') // Invalid
              }
              git {
                  pushOnlyIfSuccess()
              }
          }
      }
      

          [JENKINS-32573] Cobertura misconfiguration destroys 'publishers' node

          Unfortunately the Cobertura plugin maintains it's own collection of valid encodings, see https://github.com/jenkinsci/cobertura-plugin/blob/cobertura-1.9.7/src/main/java/hudson/plugins/cobertura/renderers/SourceEncoding.java. I'm not going to replicate that in Job DSL. I will probably move the DSL to the Cobertura plugin.

          Daniel Spilker added a comment - Unfortunately the Cobertura plugin maintains it's own collection of valid encodings, see https://github.com/jenkinsci/cobertura-plugin/blob/cobertura-1.9.7/src/main/java/hudson/plugins/cobertura/renderers/SourceEncoding.java . I'm not going to replicate that in Job DSL. I will probably move the DSL to the Cobertura plugin.

          That's understandable.
          I just wanted to get this out in the open since it's a pain to find out what's going wrong in bigger scripts.

          Thierry Lacour added a comment - That's understandable. I just wanted to get this out in the open since it's a pain to find out what's going wrong in bigger scripts.

            jamietanna Jamie Tanna
            thi Thierry Lacour
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: