• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • regression from 1.630 -> 1.633

      as seen in the screenshots below, there is one good (the old version), and one bad (the new version). The build history table now shows an improper sorting, at least for jobs that had existing history with them during the upgrade process.

      Instead of showing the most recent builds at the top, oldest at the bottom, it now has a rather random looking sort to it

      this seems to be caused by the following PR: https://github.com/jenkinsci/jenkins/pull/1641

          [JENKINS-30899] Build History order not sorted properly

          Vass Endre added a comment -

          Same error for me

          Vass Endre added a comment - Same error for me

          Tim College added a comment -

          I have an issue with the Build History section, though it's slightly different - mine are actually in the correct order, but many of the most recent builds are missing.

          For example, in one job, the most recent build is 973 - the most recent shown in the history is 954. In another, the most recent is 1837, but the most recent shown is just 1787.

          Tim College added a comment - I have an issue with the Build History section, though it's slightly different - mine are actually in the correct order, but many of the most recent builds are missing. For example, in one job, the most recent build is 973 - the most recent shown in the history is 954. In another, the most recent is 1837, but the most recent shown is just 1787.

          Jon Vallet added a comment -

          Can confirm, updated from version 1.631 to 1.633.

          Jon Vallet added a comment - Can confirm, updated from version 1.631 to 1.633.

          Daniel Beck added a comment -

          Assigning to Tom for investigation. We may have to revert the change.

          Daniel Beck added a comment - Assigning to Tom for investigation. We may have to revert the change.

          Tom FENNELLY added a comment -

          Tom FENNELLY added a comment - Revert PR: https://github.com/jenkinsci/jenkins/pull/1864

          Tim College added a comment -

          Downgrading to 1.632 solves the "missing a bunch of recent builds" issue I mentioned above.

          Tim College added a comment - Downgrading to 1.632 solves the "missing a bunch of recent builds" issue I mentioned above.

          Andrew Gray added a comment -

          I have this issue as well. builds out of order. Updated from 1632 to 1.633.

          Andrew Gray added a comment - I have this issue as well. builds out of order. Updated from 1632 to 1.633.

          Daniel Beck added a comment -

          Just out of curiosity, could some of you please post the XML output of the URL

          /job/JONAME/api/xml?tree=builds[number,queueId]

          , JOBNAME being one of the jobs affected by out of order build history?

          Daniel Beck added a comment - Just out of curiosity, could some of you please post the XML output of the URL /job/JONAME/api/xml?tree=builds[number,queueId] , JOBNAME being one of the jobs affected by out of order build history?

          Alexandre Silveira added a comment - - edited

          danielbeck

          <freeStyleProject>
            <build>
              <number>226</number>
              <queueId>56</queueId>
            </build>
            <build>
              <number>225</number>
              <queueId>15</queueId>
            </build>
            <build>
              <number>224</number>
              <queueId>13</queueId>
            </build>
          </freeStyleProject>
          

          Alexandre Silveira added a comment - - edited danielbeck <freeStyleProject> <build> <number> 226 </number> <queueId> 56 </queueId> </build> <build> <number> 225 </number> <queueId> 15 </queueId> </build> <build> <number> 224 </number> <queueId> 13 </queueId> </build> </freeStyleProject>

          Daniel Beck added a comment -

          alexandresneto This looks like the builds should be correctly ordered in 1.633. Are you saying they aren't?

          Daniel Beck added a comment - alexandresneto This looks like the builds should be correctly ordered in 1.633. Are you saying they aren't?

          danielbeck
          From the API result, its correctly ordered, but in the builds history at sidebar, the order is incorrect just like the issue reported.

          Let me show you another example.

          Here are the API result:

          And now the history block, for the same job:

          Alexandre Silveira added a comment - danielbeck From the API result, its correctly ordered, but in the builds history at sidebar, the order is incorrect just like the issue reported. Let me show you another example. Here are the API result: And now the history block, for the same job:

          Daniel Beck added a comment -

          This new example looks like I was expecting.

          These queueIds are common (in theory globally unique) IDs for queue items and the builds they become. Unfortunately we're only persisting the counter on clean shutdown with the persisted queue, so every time that fails (e.g. h/w crash, Jenkins crash, or just your regular old exception during shutdown), we're starting at 0 again afterwards. And the new widgets rely on this ordering.

          Daniel Beck added a comment - This new example looks like I was expecting. These queueIds are common (in theory globally unique) IDs for queue items and the builds they become. Unfortunately we're only persisting the counter on clean shutdown with the persisted queue, so every time that fails (e.g. h/w crash, Jenkins crash, or just your regular old exception during shutdown), we're starting at 0 again afterwards. And the new widgets rely on this ordering.

          Daniel Beck added a comment -

          Alternative solution at https://github.com/jenkinsci/jenkins/pull/1868

          I tested this locally, and the builds are in the correct order.

          I'd appreciate if some of you could test the following build, which is 1.633 with the fix in PR 1868 and a changed version number (upload may take another few minutes):
          https://dl.dropboxusercontent.com/u/29853/jenkins-1.633-JENKINS-30899-SNAPSHOT.war

          It is based on this patch:
          https://dl.dropboxusercontent.com/u/29853/jenkins-1.633-JENKINS-30899-SNAPSHOT.diff

          I realize the URL to Dropbox looks suspicious, if you prefer, there should be a downloadable build for the PR 1868 soon – but that's based on master, which already includes some minor changes beyond 1.633.

          Daniel Beck added a comment - Alternative solution at https://github.com/jenkinsci/jenkins/pull/1868 I tested this locally, and the builds are in the correct order. I'd appreciate if some of you could test the following build, which is 1.633 with the fix in PR 1868 and a changed version number (upload may take another few minutes): https://dl.dropboxusercontent.com/u/29853/jenkins-1.633-JENKINS-30899-SNAPSHOT.war It is based on this patch: https://dl.dropboxusercontent.com/u/29853/jenkins-1.633-JENKINS-30899-SNAPSHOT.diff I realize the URL to Dropbox looks suspicious, if you prefer, there should be a downloadable build for the PR 1868 soon – but that's based on master, which already includes some minor changes beyond 1.633.

          yann collette added a comment -

          On my side, several months of build are missing in the view.
          I clicked on the order, to see the newest file, the oldest one and I still miss this builds.
          I can get the build by search for its build number. But it doesn't shows up in the view.
          I installed 1.633 on debian 7.9 64 bits.

          yann collette added a comment - On my side, several months of build are missing in the view. I clicked on the order, to see the newest file, the oldest one and I still miss this builds. I can get the build by search for its build number. But it doesn't shows up in the view. I installed 1.633 on debian 7.9 64 bits.

          The same here, had to revert to 1.632.

          Anatolijs Tarasovs added a comment - The same here, had to revert to 1.632.

          Tom FENNELLY added a comment -

          ycollet and atarasovs are you using the build from danielbecks last comment?

          Tom FENNELLY added a comment - ycollet and atarasovs are you using the build from danielbeck s last comment?

          yann collette added a comment -

          No, I will no be able to test this. I have reinstalled 1.632 and we have a lot of builds running yet ...

          yann collette added a comment - No, I will no be able to test this. I have reinstalled 1.632 and we have a lot of builds running yet ...

          No, I was using the official 1.633 release. Now I've tested Daniel's build as well:

          • It is showing the latest builds on the first page as expected.
          • Clicking on the "Older builds" does nothing—doesn't change to the older builds.
          • Clicking on the "Newer builds" switches to a blank list.

          Anatolijs Tarasovs added a comment - No, I was using the official 1.633 release. Now I've tested Daniel's build as well: It is showing the latest builds on the first page as expected. Clicking on the "Older builds" does nothing—doesn't change to the older builds. Clicking on the "Newer builds" switches to a blank list.

          Tom FENNELLY added a comment -

          Hi atarasovs, ycollet, twilek, tcollege jvallet etc ... would you mind trying the build at https://jenkins.ci.cloudbees.com/job/core/job/jenkins-core/3363/

          We hope it contains fixes for the issues you are seeing. Would be great if you could try it out and let us know.

          Tom FENNELLY added a comment - Hi atarasovs , ycollet , twilek , tcollege jvallet etc ... would you mind trying the build at https://jenkins.ci.cloudbees.com/job/core/job/jenkins-core/3363/ We hope it contains fixes for the issues you are seeing. Would be great if you could try it out and let us know.

          Hi Tom Fennelly,

          I just testet the mentioned build from https://jenkins.ci.cloudbees.com/job/core/job/jenkins-core/3363/.
          It seems to fix the bug 30899.

          The build are shown in an order as expected.
          "Older builds" shows the "next page" correctly.
          "Newer builds" shows the same order as expected.

          Thanks for the fast reaction...

          Andreas Esterle added a comment - Hi Tom Fennelly, I just testet the mentioned build from https://jenkins.ci.cloudbees.com/job/core/job/jenkins-core/3363/ . It seems to fix the bug 30899. The build are shown in an order as expected. "Older builds" shows the "next page" correctly. "Newer builds" shows the same order as expected. Thanks for the fast reaction...

          Tom FENNELLY added a comment -

          nde Thanks for letting us know Andreas. Hopefully we'll get more positives and then we can push the fix.

          Tom FENNELLY added a comment - nde Thanks for letting us know Andreas. Hopefully we'll get more positives and then we can push the fix.

          Shaun Reich added a comment -

          tfennelly confirmed, it works as expected/previously, now.

          Shaun Reich added a comment - tfennelly confirmed, it works as expected/previously, now.

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/jenkins/widgets/HistoryPageEntry.java
          http://jenkins-ci.org/commit/jenkins/7410a593b30d635010c6344a812889074e68ac98
          Log:
          [FIX JENKINS-30899] Do not rely on Run.queueId for builds widget

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/jenkins/widgets/HistoryPageEntry.java http://jenkins-ci.org/commit/jenkins/7410a593b30d635010c6344a812889074e68ac98 Log: [FIX JENKINS-30899] Do not rely on Run.queueId for builds widget

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/jenkins/widgets/HistoryPageEntry.java
          core/src/main/java/jenkins/widgets/HistoryPageFilter.java
          core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java
          war/images/go-down.svg
          war/images/go-top.svg
          war/images/go-up.svg
          war/src/main/webapp/css/style.css
          war/src/main/webapp/images/16x16/bullseye.png
          war/src/main/webapp/images/16x16/go_down.png
          war/src/main/webapp/images/16x16/go_top.png
          war/src/main/webapp/images/16x16/go_up.png
          war/src/main/webapp/scripts/hudson-behavior.js
          http://jenkins-ci.org/commit/jenkins/2dd658d6fc9a085ea5bd1e8a4e7c178cd95e2f86
          Log:
          Merge pull request #1872 from tfennelly/bh-pagination-daniel

          [FIX JENKINS-30899] Build History Pagination/Search fixes

          Compare: https://github.com/jenkinsci/jenkins/compare/6aba76dcb00f...2dd658d6fc9a

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/jenkins/widgets/HistoryPageEntry.java core/src/main/java/jenkins/widgets/HistoryPageFilter.java core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java war/images/go-down.svg war/images/go-top.svg war/images/go-up.svg war/src/main/webapp/css/style.css war/src/main/webapp/images/16x16/bullseye.png war/src/main/webapp/images/16x16/go_down.png war/src/main/webapp/images/16x16/go_top.png war/src/main/webapp/images/16x16/go_up.png war/src/main/webapp/scripts/hudson-behavior.js http://jenkins-ci.org/commit/jenkins/2dd658d6fc9a085ea5bd1e8a4e7c178cd95e2f86 Log: Merge pull request #1872 from tfennelly/bh-pagination-daniel [FIX JENKINS-30899] Build History Pagination/Search fixes Compare: https://github.com/jenkinsci/jenkins/compare/6aba76dcb00f...2dd658d6fc9a

          Daniel Beck added a comment -

          Merged towards 1.634 which is scheduled for release early next week.

          (Note that 1.633 introduced another issue whose fixes have not yet been merged – JENKINS-30820 and all the duplicates linked there)

          Daniel Beck added a comment - Merged towards 1.634 which is scheduled for release early next week. (Note that 1.633 introduced another issue whose fixes have not yet been merged – JENKINS-30820 and all the duplicates linked there)

          dogfood added a comment -

          Integrated in jenkins_main_trunk #4323
          [FIX JENKINS-30899] Do not rely on Run.queueId for builds widget (Revision 7410a593b30d635010c6344a812889074e68ac98)

          Result = SUCCESS
          tom.fennelly : 7410a593b30d635010c6344a812889074e68ac98
          Files :

          • core/src/main/java/jenkins/widgets/HistoryPageEntry.java

          dogfood added a comment - Integrated in jenkins_main_trunk #4323 [FIX JENKINS-30899] Do not rely on Run.queueId for builds widget (Revision 7410a593b30d635010c6344a812889074e68ac98) Result = SUCCESS tom.fennelly : 7410a593b30d635010c6344a812889074e68ac98 Files : core/src/main/java/jenkins/widgets/HistoryPageEntry.java

          Jay Beeckman added a comment -

          This fix has worked for us.

          Jay Beeckman added a comment - This fix has worked for us.

            tfennelly Tom FENNELLY
            sreich Shaun Reich
            Votes:
            29 Vote for this issue
            Watchers:
            35 Start watching this issue

              Created:
              Updated:
              Resolved: