Closed reddwarf69 closed 2 years ago
I am having same issue
Environment Jenkins: [Jenkins 2.346.2] Pipeline Graph View Plugin Version51.v5a693b766483
Script: from: https://github.com/darinpope/jenkins-example-parallel/blob/main/Jenkinsfile-4
pipeline {
agent {
node {
label "maven2"
}
}
stages {
stage('build and run') {
parallel {
stage('linux-armv6') {
stages {
stage('build') {
steps {
sh 'echo'
}
}
stage('run') {
steps {
sh 'echo'
}
}
}
}
stage('linux-amd64') {
stages {
stage('build') {
steps {
sh 'echo'
}
}
stage('run') {
steps {
sh 'echo'
}
}
stage('unit test') {
steps {
sh 'echo unit test'
}
}
stage('load test') {
steps {
sh 'echo load test'
}
}
stage('deploy to storage') {
steps {
sh 'echo deploy to storage'
}
}
}
}
stage('darwin-amd64') {
stages {
stage('build') {
steps {
sh 'echo'
}
}
stage('run') {
steps {
sh 'echo'
}
}
stage('unit test') {
steps {
sh 'echo unit test'
}
}
}
}
}
}
}
}
Actual result
Expect: This is screen shot from https://www.youtube.com/watch?v=6wNbjP2WUMo at 11:30
Looks like tree endpoint (/pipeline-graph/tree
) returns properly grouped stages while graph endpoint (/pipeline-graph/graph
) doesn't. Maybe we can reimplement one based on another, if we even need both?
The below patch seems to work in my limited testing. @timja do you see any issues with the approach or do you want me to work up a PR?
diff --git a/src/main/frontend/pipeline-graph-view/pipeline-graph/main/PipelineGraph.tsx b/src/main/frontend/pipeline-graph-view/pipeline-graph/main/PipelineGraph.tsx
index f396258..892af5d 100644
--- a/src/main/frontend/pipeline-graph-view/pipeline-graph/main/PipelineGraph.tsx
+++ b/src/main/frontend/pipeline-graph-view/pipeline-graph/main/PipelineGraph.tsx
@@ -76,7 +76,7 @@ export class PipelineGraph extends React.Component {
onPipelineDataReceived,
onPollingError,
onPipelineComplete,
- this.props.path ?? "graph"
+ "tree"
);
}
diff --git a/src/main/frontend/pipeline-graph-view/pipeline-graph/main/PipelineGraphLayout.ts b/src/main/frontend/pipeline-graph-view/pipeline-graph/main/PipelineGraphLayout.ts
index 8f81f87..63441a9 100644
--- a/src/main/frontend/pipeline-graph-view/pipeline-graph/main/PipelineGraphLayout.ts
+++ b/src/main/frontend/pipeline-graph-view/pipeline-graph/main/PipelineGraphLayout.ts
@@ -112,21 +112,17 @@ function createNodeColumns(
const rowNodes: Array<NodeInfo> = [];
let nodeStage: StageInfo | undefined = firstStageForRow;
if (!collasped) {
- while (nodeStage) {
- if (nodeStage.seqContainerName) {
- column.hasBranchLabels = true;
- }
-
+ column.hasBranchLabels = !!nodeStage.name;
+ for (const childStage of nodeStage.children) {
rowNodes.push({
x: 0, // Layout is done later
y: 0,
- name: nodeStage.name,
- id: nodeStage.id,
- stage: nodeStage,
+ name: childStage.name,
+ id: childStage.id,
+ stage: { ...childStage, seqContainerName: nodeStage.name },
isPlaceholder: false,
- key: "n_" + nodeStage.id,
+ key: "n_" + childStage.id,
});
- nodeStage = nodeStage.nextSibling;
}
column.rows.push(rowNodes);
} else {
Spoke too soon. It works better for the test pipeline in https://github.com/jenkinsci/pipeline-graph-view-plugin/issues/63#issuecomment-1235178381 but breaks for my own yielding an empty page :)
if you can reproduce it in a minimal unit test in this repo with just the stages that would be useful.
I haven't had much time to work on this repo but I would like to address some of the issues.
(Working quality pull requests will certainly be merged here, especially with tests reproducing the issue)
Same problem here, not sure what I can do to help, but I'm happy to contribute!
I'm working on a PR, this will be a frontend-only change.
Not only this fixes the issue, this plugin is now able to give a correct view of something Blue Ocean is unable to.
Even with SCRIPT_SPLITTING_TRANSFORMATION I was getting "Method Code Too Large" errors (https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/troubleshooting-guides/method-code-too-large-error), so I ended up replacing a matrix step with a "script { parallel() }" and Blue Ocean started rendering a useless graph, missing stages. I guess I can now uninstall Blue Ocean.
Jenkins and plugins versions report
Environment
``` Jenkins: 2.346.1 OS: Linux - 5.15.0-40-generic --- ace-editor:1.1 analysis-model-api:10.12.0 ansicolor:1.0.1 antisamy-markup-formatter:2.7 apache-httpcomponents-client-4-api:4.5.13-1.0 authentication-tokens:1.4 authorize-project:1.4.0 blueocean:1.25.5 blueocean-autofavorite:1.2.5 blueocean-bitbucket-pipeline:1.25.5 blueocean-commons:1.25.5 blueocean-config:1.25.5 blueocean-core-js:1.25.5 blueocean-dashboard:1.25.5 blueocean-display-url:2.4.1 blueocean-events:1.25.5 blueocean-git-pipeline:1.25.5 blueocean-github-pipeline:1.25.5 blueocean-i18n:1.25.5 blueocean-jwt:1.25.5 blueocean-personalization:1.25.5 blueocean-pipeline-api-impl:1.25.5 blueocean-pipeline-editor:1.25.5 blueocean-pipeline-scm-api:1.25.5 blueocean-rest:1.25.5 blueocean-rest-impl:1.25.5 blueocean-web:1.25.5 bootstrap4-api:4.6.0-5 bootstrap5-api:5.1.3-7 bouncycastle-api:2.26 branch-api:2.1046.v0ca_37783ecc5 caffeine-api:2.9.3-65.v6a_47d0f4d1fe checks-api:1.7.4 cloudbees-bitbucket-branch-source:773.v4b_9b_005b_562b_ cloudbees-folder:6.729.v2b_9d1a_74d673 cobertura:1.17 code-coverage-api:3.0.1 command-launcher:84.v4a_97f2027398 credentials:1129.vef26f5df883c credentials-binding:523.vd859a_4b_122e6 custom-build-properties:2.79.vc095ccc85094 data-tables-api:1.12.1-2 display-url-api:2.3.6 docker-commons:1.19 docker-workflow:1.29 dtkit-api:3.0.1 durable-task:496.va67c6f9eefa7 echarts-api:5.3.3-1 extended-choice-parameter:346.vd87693c5a_86c extended-read-permission:3.2 favorite:2.4.1 file-operations:1.11 font-awesome-api:6.1.1-1 forensics-api:1.15.1 git:4.11.3 git-client:3.11.0 git-forensics:1.9.0 git-server:1.11 github:1.34.4 github-api:1.303-400.v35c2d8258028 github-branch-source:1656.v77eddb_b_e95df github-checks:1.0.18 github-oauth:0.39 handlebars:3.0.8 handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953 htmlpublisher:1.30 jackson2-api:2.13.3-285.vc03c0256d517 javax-activation-api:1.2.0-3 javax-mail-api:1.6.2-6 jaxb:2.3.6-1 jdk-tool:1.5 jenkins-design-language:1.25.5 jira:3.7.1 jjwt-api:0.11.5-77.v646c772fddb_0 jquery:1.12.4-1 jquery3-api:3.6.0-4 jsch:0.1.55.2 junit:1119.1121.vc43d0fc45561 ldap:2.10 lockable-resources:2.15 mailer:414.vcc4c33714601 matrix-auth:3.1.3 matrix-project:772.v494f19991984 mina-sshd-api-common:2.8.0-21.v493b_6b_db_22c6 mina-sshd-api-core:2.8.0-21.v493b_6b_db_22c6 momentjs:1.1.1 okhttp-api:4.9.3-105.vb96869f8ac3a pipeline-build-step:2.18 pipeline-graph-analysis:195.v5812d95a_a_2f9 pipeline-graph-view:51.v5a693b766483 pipeline-groovy-lib:593.va_a_fc25d520e9 pipeline-input-step:449.v77f0e8b_845c4 pipeline-milestone-step:101.vd572fef9d926 pipeline-model-api:2.2097.v33db_b_de764b_e pipeline-model-definition:2.2097.v33db_b_de764b_e pipeline-model-extensions:2.2097.v33db_b_de764b_e pipeline-rest-api:2.24 pipeline-stage-step:293.v200037eefcd5 pipeline-stage-tags-metadata:2.2097.v33db_b_de764b_e pipeline-stage-view:2.24 plain-credentials:1.8 plugin-util-api:2.17.0 popper-api:1.16.1-3 popper2-api:2.11.5-2 prism-api:1.28.0-2 pubsub-light:1.16 role-strategy:521.vcf7a_3a_8dde42 scm-api:608.vfa_f971c5a_a_e9 script-security:1175.v4b_d517d6db_f0 slack:616.v03b_1e98d13dd snakeyaml-api:1.30.2-76.vc104f7ce9870 sse-gateway:1.25 ssh-credentials:291.v8211e4f8efb_c ssh-slaves:1.821.vd834f8a_c390e sshd:3.242.va_db_9da_b_26a_c3 structs:318.va_f3ccb_729b_71 throttle-concurrents:2.8 token-macro:293.v283932a_0a_b_49 trilead-api:1.57.v6e90e07157e1 variant:1.4 warnings-ng:9.13.0 workflow-aggregator:590.v6a_d052e5a_a_b_5 workflow-api:1165.v02c3db_a_6b_e36 workflow-basic-steps:948.v2c72a_091b_b_68 workflow-cps:2725.v7b_c717eb_12ce workflow-durable-task-step:1155.v79567b_e0a_2de workflow-job:1189.va_d37a_e9e4eda_ workflow-multibranch:716.vc692a_e52371b_ workflow-scm-step:400.v6b_89a_1317c9a_ workflow-step-api:625.vd896b_f445a_f8 workflow-support:820.vd1a_6cc65ef33 xunit:3.1.0 ```What Operating System are you using (both controller, and any agents involved in the problem)?
Ubuntu 22.04, both controller and agent (Built-In Node)
Reproduction steps
Run this pipeline
Expected Results
I would expect to see something similar to what Blue Ocean shows
Actual Results
But I get this
Anything else?
No response