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

JobConfigHistory-Plugin modifies UTF-8 characters within jobs

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Blocker
    • Resolution: Unresolved
    • None
    • Jenkins LTS 2.222.4 on Windows Server 2019
      Adopt Open JRE 1.8.0_252-b09 with UTF-8 (file.encoding and sun.jnu.encoding)

    Description

      I just found out that the plugin changes characters within config.xml of jobs.

      This took me some time to find out why valid jobs running on other Jenkins instances without any problems crashed. The diffrence were that on this instance the JobConfigHistory-Plugin was installed.

      It's also not immediately apparent in the Jenkins UI that the jobs have been changed because they are cached.

      But after a restart of Jenkins the UI shows the changed characters.

       

      Steps to reproduce the problem:

      Create a new Job (or use a alread existing) with UTF-8 chars inside and save it with this plugin enabled.

      Example:

      Job config.xml without JobConfigHistory-plugin installed:
            (Jira dont let me save this issue with utf-8 chars inside so // // is were the chars are)

      ...
      <builders>
       <hudson.tasks.BatchFile>
       <command> //_Emoji that are often used for logs//_
      ―― //_UTF-8 FAT CHARS//_ ――</command>
       </hudson.tasks.BatchFile>
       </builders>
      ...
      

       

      The same Jobs config.xml after saving with JobConfigHistory installed:

      ...
      <builders>
       <hudson.tasks.BatchFile>
       <command>&#128077;&#13;
      ―― &#119827;&#119812;&#119826;&#119827;: &#119816;&#119821;&#119826;&#119827;&#119808;&#119819;&#119819;&#119812;&#119825; ――</command>
       </hudson.tasks.BatchFile>
       </builders>
      ...
      

       

      All chars are transformed to HTML representation( &#"UTF-8-Number"; ), but config.xml are UTF-8 encoded, so this will change the characters to something with different meaning.

      Attachments

        1. without plugin config.xml.png
          65 kB
          Martin Bauer
        2. without plugin Jenkins UI.png
          38 kB
          Martin Bauer
        3. with Plugin after Job save.png
          89 kB
          Martin Bauer
        4. with plugin after save and Jenkins reload.png
          49 kB
          Martin Bauer

        Activity

          There are no comments yet on this issue.

          People

            stefanbrausch Stefan Brausch
            martinbauer Martin Bauer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: