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

Toolenv job change won't save if promoted builds plugin is installed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins 2.346.3 through Jenkins 2.375 (at least)
      toolenv plugin 1.2
      promoted-builds plugin 3.7 through 892.vd6219fc0a_efb

      The environment variable checkboxes in the freestyle project section for "Tool environment" are available to be checked but when the configuration is saved, the changes do not persist when the promoted builds plugin is installed. I confirmed that the issue exists for promoted builds plugin releases 3.7, 3.10.1, and the most recent release 892.vd6219fc0a_efb.

      The problem is only visible if the promoted builds plugin is also installed. See the plugins-not-working-minimal-set.txt for the set of plugins that show the issue with Jenkins 2.375.

      With the same Jenkins 2.375 version, the checkbox values are saved when I use the minimal set of plugins needed to install toolenv 1.2. See the minimal set of plugins in plugins-working.txt

      Actual result

      With the promoted builds plugin installed, I defined a JDK8 tool and that provided a JDK8_HOME variable in the list.

      When I check JDK8_HOME in the list and save the job, the setting is not updated in the job configuration file and the next time I edit the job, the check box is not checked.

      If I modify the config.xml file of the job to include that setting and reload it, the setting is displayed as expected. Changes to the setting are ignored.

      I suspect that some assumption is now being violated in the JavaScript being used to create that control.

      Expected result

      The checkbox value should be stored when the job definition is saved even if the promoted builds plugin is installed.

      Workaround

      Edit the job configuration file with a text edit and update the toolenv values from the text editor. The values are read from the file correctly but are not written back to the file when the form is saved.

      There are less than 1500 installations of the toolenv plugin and the versions in use are widely distributed across old and new plugin versions and old and new versions of Jenkins core. There are less than 12000 installations of the promoted builds plugin. The likelihood of an installation having both plugins installed and actively using the toolenv plugin seems very small. This problem has existed for at least 6 months without being detected and may have existed for many years without being detected.

        1. toolenv-02.png
          toolenv-02.png
          12 kB
        2. toolenv-01.png
          toolenv-01.png
          18 kB
        3. plugins-working.txt
          0.5 kB
        4. plugins-not-working-minimal-set.txt
          1 kB
        5. plugins-not-working.txt
          5 kB

            Unassigned Unassigned
            markewaite Mark Waite
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: