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

Rework sorting for the Enabled columns of Installed in Plugin Manager

      This is detached from JENKINS-59665 by jsoref

      open /pluginManager/installed (Jenkins 2.198)

      Have:

      1. a couple of plugins with dependencies (enabled)
      2. a couple of plugins (disabled)
      3. a couple of plugins that have never been upgraded
      4. a couple of plugins which have been upgraded

      Actual results

      I can't really explain what it's doing. – It appears to be stable (i.e. toggling the sort direction for one of these columns reverses the sort), but it isn't global (i.e. changing the sort key to a different column, e.g. Name, and then back to the Enabled column results in a new sort).

      Expected results

      Sorting by Enabled should sort into three sets:
      1. Enabled (checkbox checked)
      2. Enabled (checkbox disabled) and can't be disabled (because they're used by enabled plugins)
      3. Disabled (checkbox unchecked)

          [JENKINS-60117] Rework sorting for the Enabled columns of Installed in Plugin Manager

          Oleg Nenashev added a comment -

          In https://github.com/jenkinsci/jenkins/pull/4298 is was suggested that the issue is fixed, but looks like it's not according to the feedback from danielbeck and jsoref. So I detached it to a separate ticket

          Oleg Nenashev added a comment - In  https://github.com/jenkinsci/jenkins/pull/4298  is was suggested that the issue is fixed, but looks like it's not according to the feedback from danielbeck and jsoref . So I detached it to a separate ticket

          Hi oleg_nenashev,

           

          Shall I work on this?

          Kalana Wijethunga added a comment - Hi oleg_nenashev ,   Shall I work on this?

          Oleg Nenashev added a comment -

          Feel free to do so

          Oleg Nenashev added a comment - Feel free to do so

          Hi oleg_nenashev,

          I was able to reproduce the issue and I followed the same process used in https://github.com/jenkinsci/jenkins/pull/4298 to group the data rows into Enabled, Enabled and cannot disable and Disabled and add the group name to data attribute of the table data column.

          I used the following logic to group these 3 categories.

          • Enabled - plugin.Enabled and !hasMandatoryDependencies
          • Enabled and cannot disable - plugin.Enabled and hasMandatoryDependencies
          • Disabled - If it doesnt belong to above 2 categories(essentially !plugin.Enabled should belong to this)

          I am able to correctly sort by Enable column using these groups. But some of the actually enabled plugins are yielding false for plugin.Enabled and therefore they are categorized into the Disabled group, which is wrong. I cant understand why some of the actually working plugins are giving the result false for plugin.Enabled . Do you have any idea what is causing this? 

           

          I have attached a screenshot for further clarification. I have setup the checked attribute of the highlighted input tab directly from the value plugin.Enabled. You can see that it has resulted in a false

           

          Any help would be much appreciated

          Kalana Wijethunga added a comment - Hi oleg_nenashev , I was able to reproduce the issue and I followed the same process used in https://github.com/jenkinsci/jenkins/pull/4298  to group the data rows into Enabled, Enabled and cannot disable and Disabled and add the group name to data attribute of the table data column. I used the following logic to group these 3 categories. Enabled - plugin.Enabled and !hasMandatoryDependencies Enabled and cannot disable - plugin.Enabled and hasMandatoryDependencies Disabled - If it doesnt belong to above 2 categories(essentially !plugin.Enabled should belong to this) I am able to correctly sort by Enable column using these groups. But some of the actually enabled plugins are yielding false for plugin.Enabled and therefore they are categorized into the Disabled group, which is wrong. I cant understand why some of the actually working plugins are giving the result false for plugin.Enabled . Do you have any idea what is causing this?    I have attached a screenshot for further clarification. I have setup the checked attribute of the highlighted input tab directly from the value plugin.Enabled. You can see that it has resulted in a false   Any help would be much appreciated

          I have achieved the following expected result.

          Sorting by Enabled should sort into three sets:
          1. Enabled (checkbox checked)
          2. Enabled (checkbox disabled) and can't be disabled (because they're used by enabled plugins)
          3. Disabled (checkbox unchecked)

           

          But it can be seen that there is one more group in addition to the above and that is 'Enabled (checkbox checked) and can be disabled(because it has mandatory dependents, but all the dependents are disabled)'.  I used Plugin.hasMandatoryDependencies() to check whether the plugin can be disabled or not. But seems it is incorrect in the identified case because a plugin can be disabled even if it hasMandatoryDependencies() when those dependencies are disabled. oleg_nenashev, danielbeck Can somebody suggest me a better criteria to identify whether the plugins can be disabled or not, please?

          Kalana Wijethunga added a comment - I have achieved the following expected result. Sorting by Enabled should sort into three sets: Enabled (checkbox checked) Enabled (checkbox disabled) and can't be disabled (because they're used by enabled plugins) Disabled (checkbox unchecked)   But it can be seen that there is one more group in addition to the above and that is 'Enabled (checkbox checked) and can be disabled(because it has mandatory dependents, but all the dependents are disabled)'.  I used Plugin.hasMandatoryDependencies() to check whether the plugin can be disabled or not. But seems it is incorrect in the identified case because a plugin can be disabled even if it hasMandatoryDependencies() when those dependencies are disabled. oleg_nenashev , danielbeck  Can somebody suggest me a better criteria to identify whether the plugins can be disabled or not, please?

          Sam Hrncir added a comment -

          I'll also look into this and report.

          Sam Hrncir added a comment - I'll also look into this and report.

            kalana Kalana Wijethunga
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: