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

Jenkins.createProjectFromXml() formats xml differently than AbstractItem.save()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins 2.106
      job-dsl-plugin 1.68
      jobConfigHistory plugin 2.18

      Hello,

      We generate our jobs using job-dsl plugin and we want to track custom changes to jobs using job-config-history plugin which compares job xml. Note that job-dsl-plugin relies on Jenkins.createProjectFromXml() to generate job xml. We noticed that after a generated job is saved (via the web UI) or a build is started, the job xml is rewritten via AbstractItem.save() adding a change to job config history. The differences are (see image attached):

      • XML version 1.1 in file generated by save versus version 1.0 (introduced in Jenkins 2.105)
      • different indentation
      • different order of tags

      Is there a way to assure that job xml formatting is independent of the way of creation?

        1. diff.png
          79 kB
          Petres Andras

            stefanbrausch Stefan Brausch
            apetres Petres Andras
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: