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

Plugin Manager does not sort by timestamp (regression in 2.274)

    XMLWordPrintable

Details

    • 2.362

    Description

      I don't know since when, but for some time sorting in plugin manager do not work.
      I guess it's after manager upgrade.

      Instead of sorting by timestamp it sorts by date string.
      https://github.com/jenkinsci/jenkins/blob/afb7c2a96be8aed2b659e9f08677b403082c4799/core/src/main/resources/hudson/PluginManager/table.jelly#L222

      I think reason of such behavior is unsupported format and html tag. According to sortable lib this sorter should be used here.
      https://github.com/jenkinsci/jenkins/blob/cee0d06770e6bed478e105368ef57371814f3f79/war/src/main/webapp/scripts/sortable.js#L296

      In attachment you have a small preview.

      Attachments

        Issue Links

          Activity

            dumam Bartosz Nowak added a comment -

            danielbeck thats not a solution. i find it as very useful info during new plugins selection.

            dumam Bartosz Nowak added a comment - danielbeck thats not a solution. i find it as very useful info during new plugins selection.
            dumam Bartosz Nowak added a comment - btw Here is an interesting line https://github.com/jenkinsci/jenkins/blob/ee9d350913c4b663d78229bc51e219ecd03255b5/core/src/main/java/hudson/PluginManager.java#L1372 Do we need to sort this every time?
            danielbeck Daniel Beck added a comment -

            thats not a solution

            I was responding to another comment claiming this cannot be reproduced from scratch anymore (accidentally duplicating what Ian Williams wrote before). Unless you're working on fixing this, my comment is irrelevant to you.

            danielbeck Daniel Beck added a comment - thats not a solution I was responding to another comment claiming this cannot be reproduced from scratch anymore (accidentally duplicating what Ian Williams wrote before). Unless you're working on fixing this, my comment is irrelevant to you.
            dumam Bartosz Nowak added a comment -

            If class sortable is used for <table class="sortable"....
            I guess implemented here:
            https://github.com/jenkinsci/jenkins/blob/ee9d350913c4b663d78229bc51e219ecd03255b5/war/src/main/webapp/scripts/sortable.js

            Then it means
            https://github.com/jenkinsci/jenkins/blob/ee9d350913c4b663d78229bc51e219ecd03255b5/war/src/main/js/templates/plugin-manager/available.hbs#L72
            There is bug -> sortable.js do not support this format (iso)

            If you change this.releaseTimestamp.displayValue to this.releaseTimestamp.iso8601, everything works back
            Those values are set here
            https://github.com/jenkinsci/jenkins/blob/ee9d350913c4b663d78229bc51e219ecd03255b5/core/src/main/java/hudson/PluginManager.java#L1435

            There are few approached it can be fixed:
            a) by adding support in sortable.js to iso8601
            b) changing display format for sortable one
            c) by using already supported format in sortable.js but there is no implementaion for it in (https://github.com/jenkinsci/jenkins/blob/ee9d350913c4b663d78229bc51e219ecd03255b5/core/src/main/java/hudson/Functions.java#L224)

            dumam Bartosz Nowak added a comment - If class sortable is used for <table class="sortable".... I guess implemented here: https://github.com/jenkinsci/jenkins/blob/ee9d350913c4b663d78229bc51e219ecd03255b5/war/src/main/webapp/scripts/sortable.js Then it means https://github.com/jenkinsci/jenkins/blob/ee9d350913c4b663d78229bc51e219ecd03255b5/war/src/main/js/templates/plugin-manager/available.hbs#L72 There is bug -> sortable.js do not support this format (iso) If you change this.releaseTimestamp.displayValue to this.releaseTimestamp.iso8601, everything works back Those values are set here https://github.com/jenkinsci/jenkins/blob/ee9d350913c4b663d78229bc51e219ecd03255b5/core/src/main/java/hudson/PluginManager.java#L1435 There are few approached it can be fixed: a) by adding support in sortable.js to iso8601 b) changing display format for sortable one c) by using already supported format in sortable.js but there is no implementaion for it in ( https://github.com/jenkinsci/jenkins/blob/ee9d350913c4b663d78229bc51e219ecd03255b5/core/src/main/java/hudson/Functions.java#L224 )
            dumam Bartosz Nowak added a comment - https://github.com/jenkinsci/jenkins/pull/6929 Fixed

            People

              Unassigned Unassigned
              dumam Bartosz Nowak
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: