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

            stuartrowe Stuart Rowe created issue -
            stuartrowe Stuart Rowe made changes -
            Field Original Value New Value
            Description The pipeline view shows no changes even though the classic run page shows a changeset and the blueocean run rest endpoint returns a changeset. In these cases, the pipeline view shows no changes even though the classic run page shows a changeset and the blueocean run rest endpoint returns a changeset.
            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
            stuartrowe Stuart Rowe made changes -
            Comment [ It seems that there is a cached run from before the changeset was populated. This data is refreshed when the 'job_run_ended' event is handled. ]
            stuartrowe Stuart Rowe made changes -
            Description In these cases, the pipeline view shows no changes even though the classic run page shows a changeset and the blueocean run rest endpoint returns a changeset. In these cases, the pipeline view shows no changes even though the classic run page shows a changeset and the blueocean run rest endpoint returns a changeset.

             

             
            stuartrowe Stuart Rowe made changes -
            Description In these cases, the pipeline view shows no changes even though the classic run page shows a changeset and the blueocean run rest endpoint returns a changeset.

             

             
            In these cases, the pipeline view shows no changes even though the classic run page shows a changeset and the blueocean run rest endpoint returns a changeset.

            The changeset for a run doesn't get populated until the next run of a project starts. The changeset doesn't appear to be populated when a run completes either.

            Navigation is to the BlueOcean pipeline view is from the classic run page by following the \{{Open Blue Ocean}} link from the left hand navigation bar. This is occurring for standard pipeline jobs using {{checkout}} step with the {{perforce}} scm (p4-plugin).

             

             
            stuartrowe Stuart Rowe made changes -
            Description In these cases, the pipeline view shows no changes even though the classic run page shows a changeset and the blueocean run rest endpoint returns a changeset.

            The changeset for a run doesn't get populated until the next run of a project starts. The changeset doesn't appear to be populated when a run completes either.

            Navigation is to the BlueOcean pipeline view is from the classic run page by following the \{{Open Blue Ocean}} link from the left hand navigation bar. This is occurring for standard pipeline jobs using {{checkout}} step with the {{perforce}} scm (p4-plugin).

             

             
            In these cases, the pipeline view shows no changes even though the classic run page shows a changeset and the blueocean run rest endpoint returns a changeset.

            The changeset for a run doesn't get populated until the next run of a project starts. The changeset doesn't appear to be populated when a run completes either.

            Navigation is to the BlueOcean pipeline view is from the classic run page by following the {{Open Blue Ocean}} link from the left hand navigation bar. This is occurring for standard pipeline jobs using {{checkout}} steps with the {{perforce}} scm configured (p4-plugin).

             

             
            stuartrowe Stuart Rowe made changes -
            Description In these cases, the pipeline view shows no changes even though the classic run page shows a changeset and the blueocean run rest endpoint returns a changeset.

            The changeset for a run doesn't get populated until the next run of a project starts. The changeset doesn't appear to be populated when a run completes either.

            Navigation is to the BlueOcean pipeline view is from the classic run page by following the {{Open Blue Ocean}} link from the left hand navigation bar. This is occurring for standard pipeline jobs using {{checkout}} steps with the {{perforce}} scm configured (p4-plugin).

             

             
            In these cases, the pipeline view shows no changes even though the classic run page shows a changeset and the blueocean run rest endpoint returns a changeset.

            The changeset for a run doesn't get populated until the next run of a project starts. The changeset doesn't appear to be populated when a run completes either.

            Navigation is to the BlueOcean pipeline view is from the classic run page by following the {{Open Blue Ocean}} link from the left hand navigation bar. This is occurring for standard pipeline jobs using {{checkout}} steps with the {{perforce}} scm configured (p4-plugin). The pipelines are defined using scripted pipeline.

            This issue applies to, but is not limited to, all of the following pages:
             * blue/organizations/jenkins/<projectName>/detail/<projectName>/<runId>/pipeline
             * blue/organizations/jenkins/<projectName>/detail/<projectName>/<runId>/pipeline/changes

             
            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.
            stuartrowe Stuart Rowe made changes -
            Summary BlueOcean Pipeline View sometimes shows No Changes BlueOcean Pipeline View for the Latest Run shows No Changes
            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 .
            stuartrowe Stuart Rowe made changes -
            Description In these cases, the pipeline view shows no changes even though the classic run page shows a changeset and the blueocean run rest endpoint returns a changeset.

            The changeset for a run doesn't get populated until the next run of a project starts. The changeset doesn't appear to be populated when a run completes either.

            Navigation is to the BlueOcean pipeline view is from the classic run page by following the {{Open Blue Ocean}} link from the left hand navigation bar. This is occurring for standard pipeline jobs using {{checkout}} steps with the {{perforce}} scm configured (p4-plugin). The pipelines are defined using scripted pipeline.

            This issue applies to, but is not limited to, all of the following pages:
             * blue/organizations/jenkins/<projectName>/detail/<projectName>/<runId>/pipeline
             * blue/organizations/jenkins/<projectName>/detail/<projectName>/<runId>/pipeline/changes

             
            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://&lt;jenkins-server&gt;/job/&lt;project&gt;/&lt;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.
            stuartrowe Stuart Rowe made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            stuartrowe Stuart Rowe made changes -
            Assignee Stuart Rowe [ stuartrowe ]
            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/
            stuartrowe Stuart Rowe made changes -
            Attachment image-2019-03-04-14-57-44-135.png [ 46262 ]
            stuartrowe Stuart Rowe made changes -
            Attachment image-2019-03-04-14-59-16-553.png [ 46263 ]
            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.
            halkeye Gavin Mogan made changes -
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Fixed but Unreleased [ 10203 ]
            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
            halkeye Gavin Mogan made changes -
            Released As 1.14.0
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]
            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 )
            reinholdfuereder Reinhold Füreder made changes -
            Link This issue is related to JENKINS-51111 [ JENKINS-51111 ]
            reinholdfuereder Reinhold Füreder made changes -
            Link This issue is related to JENKINS-51111 [ JENKINS-51111 ]
            reinholdfuereder Reinhold Füreder made changes -
            Link This issue is related to JENKINS-51110 [ JENKINS-51110 ]
            reinholdfuereder Reinhold Füreder made changes -
            Link This issue is related to JENKINS-51111 [ JENKINS-51111 ]

              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: