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

BlueOcean Pipeline View for the Latest Run shows No Changes

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • blueocean-plugin
    • None
    • Jenkins ver. 2.150.1
      Blue Ocean 1.10.1
      P4 Plugin 1.9.5
    • 1.14.0

      There is always an empty changeset in BlueOcean for the latest run of a project when navigating to BlueOcean from the classic UI for that run (from https://<jenkins-server>/job/<project>/<runId>, click the Open Blue Ocean link in the left hand side navigation bar).

      This issue occurs for standard pipeline jobs using checkout steps with the perforce scm configured (p4-plugin). The pipelines are defined using scripted pipeline. The issue is not likely limited to this context.

          [JENKINS-55497] BlueOcean Pipeline View for the Latest Run shows No Changes

          Stuart Rowe added a comment - - edited

          Debugging this issue has demonstrated the following:

          1. Loading the pipeline page triggers an initial pipeline fetch / preload
          2. During this preload, the latest run is retrieved because BluePipeline#getLatestRun is annotated as exported (see callstack below)
          3. The PipelineImpl#getLatestRun implementation returns a PipelineRunSummary which doesn't include the changeset information
          4. Eventually the fetched run object gets cached by the BunkerService on the React/JS side (I'm unclear on the exact mechanism behind this, but I witnessed it with a breakpoint in the BunkerService#setItem method)
          5. When the RunDetails react component is mounted for the latest run, the fetch hits the cached run object with the empty changeSet

          Callstack:

          PipelineRunImpl.<init>(WorkflowRun,Reachable,BlueOrganization) (./blueocean-plugin/blueocean-pipeline-api-impl/src/main/java/io/jenkins/blueocean/rest/impl/pipeline/PipelineRunImpl.java:59)
          PipelineImpl.getLatestRun() (./blueocean-plugin/blueocean-pipeline-api-impl/src/main/java/io/jenkins/blueocean/rest/impl/pipeline/PipelineImpl.java:44)
          1685057083.invokeVirtual_L_L(Object,Object) (Unknown Source:-1)
          1660368647.reinvoke(Object,Object) (Unknown Source:-1)
          1672221507.invoke_MT(Object,Object,Object) (Unknown Source:-1)
          MethodProperty.getValue(Object) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/MethodProperty.java:72)
          ExportInterceptor$1.getValue(Property,Object,ExportConfig) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/ExportInterceptor.java:46)
          Export$BlueOceanExportInterceptor.getValue(Property,Object,ExportConfig) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/Export.java:196)
          Property.writeTo(Object,TreePruner,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Property.java:136)
          Model.writeNestedObjectTo(Object,TreePruner,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:228)
          Model.writeNestedObjectTo(Object,TreePruner,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:224)
          Model.writeNestedObjectTo(Object,TreePruner,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:224)
          Model.writeTo(Object,TreePruner,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:199)
          Model.writeTo(Object,int,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:219)
          Model.writeTo(Object,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:183)
          Export.toJson(Object,Writer,boolean) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/Export.java:90)
          Export.toJson(Object,boolean) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/Export.java:59)
          Export.toJson(Object) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/Export.java:46)
          PipelineStatePreloader.getFetchData(BlueUrlTokenizer) (./blueocean-plugin/blueocean-pipeline-api-impl/src/main/java/io/jenkins/blueocean/preload/PipelineStatePreloader.java:66)
          RESTFetchPreloader.getStateJson() (./blueocean-plugin/blueocean-pipeline-api-impl/src/main/java/io/jenkins/blueocean/preload/RESTFetchPreloader.java:69)

           

           

          Stuart Rowe added a comment - - edited Debugging this issue has demonstrated the following: Loading the pipeline page triggers an initial pipeline fetch / preload During this preload, the latest run is retrieved because BluePipeline#getLatestRun is annotated as exported (see callstack below) The PipelineImpl#getLatestRun implementation returns a PipelineRunSummary which doesn't include the changeset information Eventually the fetched run object gets cached by the BunkerService on the React/JS side (I'm unclear on the exact mechanism behind this, but I witnessed it with a breakpoint in the BunkerService#setItem method) When the RunDetails react component is mounted for the latest run, the fetch hits the cached run object with the empty changeSet Callstack: PipelineRunImpl.<init>(WorkflowRun,Reachable,BlueOrganization) (./blueocean-plugin/blueocean-pipeline-api-impl/src/main/java/io/jenkins/blueocean/rest/impl/pipeline/PipelineRunImpl.java:59) PipelineImpl.getLatestRun() (./blueocean-plugin/blueocean-pipeline-api-impl/src/main/java/io/jenkins/blueocean/rest/impl/pipeline/PipelineImpl.java:44) 1685057083.invokeVirtual_L_L(Object,Object) (Unknown Source:-1) 1660368647.reinvoke(Object,Object) (Unknown Source:-1) 1672221507.invoke_MT(Object,Object,Object) (Unknown Source:-1) MethodProperty.getValue(Object) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/MethodProperty.java:72) ExportInterceptor$1.getValue(Property,Object,ExportConfig) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/ExportInterceptor.java:46) Export$BlueOceanExportInterceptor.getValue(Property,Object,ExportConfig) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/Export.java:196) Property.writeTo(Object,TreePruner,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Property.java:136) Model.writeNestedObjectTo(Object,TreePruner,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:228) Model.writeNestedObjectTo(Object,TreePruner,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:224) Model.writeNestedObjectTo(Object,TreePruner,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:224) Model.writeTo(Object,TreePruner,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:199) Model.writeTo(Object,int,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:219) Model.writeTo(Object,DataWriter) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/export/Model.java:183) Export.toJson(Object,Writer,boolean) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/Export.java:90) Export.toJson(Object,boolean) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/Export.java:59) Export.toJson(Object) (./blueocean-plugin/blueocean-commons/src/main/java/io/jenkins/blueocean/commons/stapler/Export.java:46) PipelineStatePreloader.getFetchData(BlueUrlTokenizer) (./blueocean-plugin/blueocean-pipeline-api-impl/src/main/java/io/jenkins/blueocean/preload/PipelineStatePreloader.java:66) RESTFetchPreloader.getStateJson() (./blueocean-plugin/blueocean-pipeline-api-impl/src/main/java/io/jenkins/blueocean/preload/RESTFetchPreloader.java:69)    

          Stuart Rowe added a comment -

          One solution would be to override getChangeSet in PipelineRunSummary.

          Stuart Rowe added a comment - One solution would be to override getChangeSet in PipelineRunSummary .

          Stuart Rowe added a comment -

          Stuart Rowe added a comment - In progress: https://github.com/jenkinsci/blueocean-plugin/pull/1919

          Gavin Mogan added a comment -

          stuartrowe so if i understand this correctly. This is if you goto a non multi branch pipeline's changes page directly?

          https://ci.blueocean.io/blue/organizations/jenkins/Blue%20Ocean%20docker%20image/detail/Blue%20Ocean%20docker%20image/891/changes/

          Gavin Mogan added a comment - stuartrowe so if i understand this correctly. This is if you goto a non multi branch pipeline's changes page directly? https://ci.blueocean.io/blue/organizations/jenkins/Blue%20Ocean%20docker%20image/detail/Blue%20Ocean%20docker%20image/891/changes/

          Stuart Rowe added a comment -

          halkeye exactly. For the link above, you see this:

           

          Instead of the populated change set you see when navigating from the activity page to the most recent run
          https://ci.blueocean.io/blue/organizations/jenkins/Blue%20Ocean%20docker%20image/activity

          Stuart Rowe added a comment - halkeye exactly. For the link above, you see this:   Instead of the populated change set you see when navigating from the activity page to the most recent run https://ci.blueocean.io/blue/organizations/jenkins/Blue%20Ocean%20docker%20image/activity

          Gavin Mogan added a comment -

          This is in master, so marking it as resolved (unreleased). I know nicu and I were poking at this problem a couple weeks ago so I'm very happy you solved it.

          Next release might be this week, but more likely week of the 18th.

          Gavin Mogan added a comment - This is in master, so marking it as resolved (unreleased). I know nicu and I were poking at this problem a couple weeks ago so I'm very happy you solved it. Next release might be this week, but more likely week of the 18th.

          Stuart Rowe added a comment -

          halkeye do you expect that this will be released this week?

          Stuart Rowe added a comment - halkeye do you expect that this will be released this week?

          Gavin Mogan added a comment -

          if all goes as plan, wed should be 1.14

          Gavin Mogan added a comment - if all goes as plan, wed should be 1.14

          Reinhold Füreder added a comment - stuartrowe Ad https://issues.jenkins-ci.org/browse/JENKINS-55497?focusedCommentId=359502&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-359502: No, unfortunately it has not solved JENKINS-46521

          Reinhold Füreder added a comment - - edited

          Reinhold Füreder added a comment - - edited However, I claim this (also) solved JENKINS-51111 (at least my in the past easily reproducible problem mentioned in https://issues.jenkins-ci.org/browse/JENKINS-51111?focusedCommentId=343321&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-343321 )

            stuartrowe Stuart Rowe
            stuartrowe Stuart Rowe
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: