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

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

    • 2.362

      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.

          [JENKINS-68750] Plugin Manager does not sort by timestamp (regression in 2.274)

          Ian Williams added a comment - - edited

          basil , sorting appears fine in 2.263.4 , so just an older regression

          Ian Williams added a comment - - edited basil , sorting appears fine in 2.263.4 , so just an older regression

          Basil Crow added a comment -

          Thanks ianw, I think this can be classified as a regression if we have steps to reproduce the problem from scratch. Since we can no longer install 2.263.4 and the suggested plugins by using the Update Center (because this core is too old), the only way to reproduce the problem from scratch would be to use a hard-coded list of plugins. The screenshot above suggests that you have such a list, could you please share it?

          Basil Crow added a comment - Thanks ianw , I think this can be classified as a regression if we have steps to reproduce the problem from scratch. Since we can no longer install 2.263.4 and the suggested plugins by using the Update Center (because this core is too old), the only way to reproduce the problem from scratch would be to use a hard-coded list of plugins. The screenshot above suggests that you have such a list, could you please share it?

          Ian Williams added a comment -

          Steps to reproduce were very easy.
          Run a clean install of Jenkins 2.263.4

          java -DJENKINS_HOME=2.263 -jar jenkins-2.236.4.war
          

          Skip the wizard steps ( so skip plugins, initial user, etc.)
          got to http://localhost:8080/pluginManager/available
          (set up proxy in Advanced first 'cos behind firewall)
          Check Now to obtain list of available plugins
          Filter on "plugin" ('cos everything is returned)
          Sort by Released , click for Up, then for Down, observe.
          Observe that under 2.263.4, the list of plugins is sorted correctly chronologically
          It's all as expected; hours, then days, months, years (see image).

          Rinse and repeat for 2.277.4

          java -DJENKINS_HOME=2.277 -jar jenkins-2.277.4.war
          

          Observe that under 2.277.4, it is not:
          1 mo, then 1 yr, 10 mo, 11, mo, then 2 mo, 2 yr, etc.

          Matrix Authorization Strategy 3.1.2 1 mo 18 days ago
          Command Agent Launcher 81.v9c2cb_cb_db_392 1 mo 23 days ago
          Jackson 2 API 2.13.3-285.vc03c0256d517 1 mo 5 days ago
          Folders 6.722.v8165b_a_cf25e9 1 mo 5 days ago
          Display URL API 2.3.5 1 yr 0 mo ago
          SCM Step 2.13 1 yr 0 mo ago
          Pipeline Graph Analysis 1.11 1 yr 0 mo ago
          Handlebars bundle 3.0.8 1 yr 2 mo ago
          Supporting APIs 3.8 1 yr 3 mo ago
          Oracle Java SE Development Kit Installer 1.5 1 yr 4 mo ago
          Apache HttpComponents Client 4.x API 4.5.13-1.0 1 yr 5 mo ago
          Trilead API 1.0.13 1 yr 6 mo ago
          SCM API 2.6.5 10 mo ago
          Basic Steps 2.24 10 mo ago
          Git client 3.9.0 11 mo ago
          Branch API 2.1045.v4ec3ed07b_e4f 2 mo 0 days ago
          Credentials 2.6.1.1 2 mo 15 days ago
          Shared Groovy Libraries 2.21.3 2 mo 16 days ago
          Build Step 2.17 2 mo 17 days ago
          JSch dependency 0.1.55.2 2 yr 4 mo ago
          SSH Credentials 1.18.1 2 yr 5 mo ago
          GIT server 1.9 2 yr 6 mo ago
          Durable Task 495.v29cd95ec10f2 3 mo 0 days ago
          API 1143.v2d42f1e9dea_5 3 mo 12 days ago
          Groovy 2660.vb_c0412dc4e6d 3 mo 19 days ago
          REST API 2.23 3 mo 19 days ago
          Script Security 1138.v8e727069a_025 3 mo 28 days ago
          Token Macro 270.v8c2ce50dc4fc 4 mo 12 days ago
          Milestone Step 100.v60a_03cd446e1 4 mo 12 days ago
          Multibranch 711.vdfef37cda_816 4 mo 2 days ago
          Plain Credentials 1.8 4 mo 26 days ago
          OWASP Markup Formatter 2.7 5 mo 10 days ago
          Step API 622.vb_8e7c15b_c95a_ 5 mo 17 days ago
          Stage Step 291.vf0a8a7aeeb50 5 mo 25 days ago
          Mailer 1.34.2 5 mo 29 days ago
          Input Step 427.va6441fa17010 6 mo 12 days ago
          Credentials Binding 1.27.1 6 mo 2 days ago
          Structs 308.v852b473a2b8c 6 mo 23 days ago
          Matrix Project 1.18.1 6 mo 5 days ago
          Job 1145.v7f2433caa07f 6 mo 6 days ago
          ACE Editor bundle 1.1 6 yr 3 mo ago
          Moment.js bundle 1.1.1 6 yr 3 mo ago
          Stage Tags Metadata 1.9.3 7 mo 4 days ago
          Model API 1.9.3 7 mo 4 days ago
          Declarative Extension Points API 1.9.3 7 mo 4 days ago
          Declarative 1.9.3 7 mo 4 days ago
          bouncycastle API 2.25 8 mo 26 days ago
          Git 4.8.3 9 mo 0 days ago
          Nodes and Processes 2.40 9 mo 1 day ago

          Ian Williams added a comment - Steps to reproduce were very easy. Run a clean install of Jenkins 2.263.4 java -DJENKINS_HOME=2.263 -jar jenkins-2.236.4.war Skip the wizard steps ( so skip plugins, initial user, etc.) got to http://localhost:8080/pluginManager/available (set up proxy in Advanced first 'cos behind firewall) Check Now to obtain list of available plugins Filter on " plugin " ('cos everything is returned) Sort by Released , click for Up , then for Down , observe. Observe that under 2.263.4, the list of plugins is sorted correctly chronologically It's all as expected; hours, then days, months, years (see image). Rinse and repeat for 2.277.4 java -DJENKINS_HOME=2.277 -jar jenkins-2.277.4.war Observe that under 2.277.4, it is not: 1 mo, then 1 yr, 10 mo, 11, mo, then 2 mo, 2 yr, etc. Matrix Authorization Strategy 3.1.2 1 mo 18 days ago Command Agent Launcher 81.v9c2cb_cb_db_392 1 mo 23 days ago Jackson 2 API 2.13.3-285.vc03c0256d517 1 mo 5 days ago Folders 6.722.v8165b_a_cf25e9 1 mo 5 days ago Display URL API 2.3.5 1 yr 0 mo ago SCM Step 2.13 1 yr 0 mo ago Pipeline Graph Analysis 1.11 1 yr 0 mo ago Handlebars bundle 3.0.8 1 yr 2 mo ago Supporting APIs 3.8 1 yr 3 mo ago Oracle Java SE Development Kit Installer 1.5 1 yr 4 mo ago Apache HttpComponents Client 4.x API 4.5.13-1.0 1 yr 5 mo ago Trilead API 1.0.13 1 yr 6 mo ago SCM API 2.6.5 10 mo ago Basic Steps 2.24 10 mo ago Git client 3.9.0 11 mo ago Branch API 2.1045.v4ec3ed07b_e4f 2 mo 0 days ago Credentials 2.6.1.1 2 mo 15 days ago Shared Groovy Libraries 2.21.3 2 mo 16 days ago Build Step 2.17 2 mo 17 days ago JSch dependency 0.1.55.2 2 yr 4 mo ago SSH Credentials 1.18.1 2 yr 5 mo ago GIT server 1.9 2 yr 6 mo ago Durable Task 495.v29cd95ec10f2 3 mo 0 days ago API 1143.v2d42f1e9dea_5 3 mo 12 days ago Groovy 2660.vb_c0412dc4e6d 3 mo 19 days ago REST API 2.23 3 mo 19 days ago Script Security 1138.v8e727069a_025 3 mo 28 days ago Token Macro 270.v8c2ce50dc4fc 4 mo 12 days ago Milestone Step 100.v60a_03cd446e1 4 mo 12 days ago Multibranch 711.vdfef37cda_816 4 mo 2 days ago Plain Credentials 1.8 4 mo 26 days ago OWASP Markup Formatter 2.7 5 mo 10 days ago Step API 622.vb_8e7c15b_c95a_ 5 mo 17 days ago Stage Step 291.vf0a8a7aeeb50 5 mo 25 days ago Mailer 1.34.2 5 mo 29 days ago Input Step 427.va6441fa17010 6 mo 12 days ago Credentials Binding 1.27.1 6 mo 2 days ago Structs 308.v852b473a2b8c 6 mo 23 days ago Matrix Project 1.18.1 6 mo 5 days ago Job 1145.v7f2433caa07f 6 mo 6 days ago ACE Editor bundle 1.1 6 yr 3 mo ago Moment.js bundle 1.1.1 6 yr 3 mo ago Stage Tags Metadata 1.9.3 7 mo 4 days ago Model API 1.9.3 7 mo 4 days ago Declarative Extension Points API 1.9.3 7 mo 4 days ago Declarative 1.9.3 7 mo 4 days ago bouncycastle API 2.25 8 mo 26 days ago Git 4.8.3 9 mo 0 days ago Nodes and Processes 2.40 9 mo 1 day ago

          Basil Crow added a comment -

          Thank you for the steps to to reproduce ianw; I bisected this to jenkinsci/jenkins#5051.

          timja FYI

          Basil Crow added a comment - Thank you for the steps to to reproduce ianw ; I bisected this to jenkinsci/jenkins#5051 . timja FYI

          Daniel Beck added a comment -

          Since we can no longer install 2.263.4 and the suggested plugins by using the Update Center (because this core is too old), the only way to reproduce the problem from scratch would be to use a hard-coded list of plugins.

          FTR you can skip plugin installation in the setup wizard. Since this concerns the "Available" list, no plugins need to be installed for that.

          Daniel Beck added a comment - Since we can no longer install 2.263.4 and the suggested plugins by using the Update Center (because this core is too old), the only way to reproduce the problem from scratch would be to use a hard-coded list of plugins. FTR you can skip plugin installation in the setup wizard. Since this concerns the "Available" list, no plugins need to be installed for that.

          Bartosz Nowak added a comment -

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

          Bartosz Nowak added a comment - danielbeck thats not a solution. i find it as very useful info during new plugins selection.

          Bartosz Nowak added a comment -

          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?

          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.

          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.

          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)

          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 )

          Bartosz Nowak added a comment -

          Bartosz Nowak added a comment - https://github.com/jenkinsci/jenkins/pull/6929 Fixed

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

              Created:
              Updated:
              Resolved: