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

BlueOcean Pipeline View for the Latest Run shows No Changes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: blueocean-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 2.150.1
      Blue Ocean 1.10.1
      P4 Plugin 1.9.5
    • Similar Issues:
    • Released As:
      1.14.0

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            stuartrowe Stuart Rowe added a comment -
            Show
            stuartrowe Stuart Rowe added a comment - This may be a duplicate of  https://issues.jenkins-ci.org/browse/JENKINS-46521
            Hide
            stuartrowe Stuart Rowe added a comment - - edited

            Visiting the activity page for the project seems to populate the changeset:

            • blue/organizations/jenkins/<projectName>/activity

            However, if you return to the classic UI from the top navigation bar and then re-enter the BlueOcean pipeline view, the changeset is empty again.

            Show
            stuartrowe Stuart Rowe added a comment - - edited Visiting the activity page for the project seems to populate the changeset: blue/organizations/jenkins/<projectName>/activity However, if you return to the classic UI from the top navigation bar and then re-enter the BlueOcean pipeline view, the changeset is empty again.
            Hide
            stuartrowe 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)

             

             

            Show
            stuartrowe 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)    
            Hide
            stuartrowe Stuart Rowe added a comment -

            One solution would be to override getChangeSet in PipelineRunSummary.

            Show
            stuartrowe Stuart Rowe added a comment - One solution would be to override getChangeSet in PipelineRunSummary .
            Show
            stuartrowe Stuart Rowe added a comment - In progress: https://github.com/jenkinsci/blueocean-plugin/pull/1919
            Hide
            halkeye Gavin Mogan added a comment -

            Stuart Rowe 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/

            Show
            halkeye Gavin Mogan added a comment - Stuart Rowe 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/
            Hide
            stuartrowe Stuart Rowe added a comment -

            Gavin Mogan 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

            Show
            stuartrowe Stuart Rowe added a comment - Gavin Mogan 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
            Hide
            halkeye 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.

            Show
            halkeye 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.
            Hide
            stuartrowe Stuart Rowe added a comment -

            Gavin Mogan do you expect that this will be released this week?

            Show
            stuartrowe Stuart Rowe added a comment - Gavin Mogan do you expect that this will be released this week?
            Hide
            halkeye Gavin Mogan added a comment -

            if all goes as plan, wed should be 1.14

            Show
            halkeye Gavin Mogan added a comment - if all goes as plan, wed should be 1.14
            Show
            reinholdfuereder Reinhold Füreder added a comment - Stuart Rowe 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
            Hide
            reinholdfuereder Reinhold Füreder added a comment - - edited
            Show
            reinholdfuereder 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 )

              People

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

                Dates

                Created:
                Updated:
                Resolved: