jenkinsci / pipeline-graph-view-plugin

https://plugins.jenkins.io/pipeline-graph-view/
Other
106 stars 53 forks source link

"Back to Build" link in multi-pipeline-graph points to root of web site #55

Closed KalleOlaviNiemitalo closed 1 year ago

KalleOlaviNiemitalo commented 2 years ago

Version report

Jenkins and plugins versions report:

Jenkins: 2.319.1
OS: Windows Server 2012 R2 - 6.3
---
Office-365-Connector:4.15.2
ace-editor:1.1
analysis-model-api:10.8.1
antisamy-markup-formatter:2.5
apache-httpcomponents-client-4-api:4.5.13-1.0
atlassian-bitbucket-server-integration:3.1.0
authentication-tokens:1.4
authorize-project:1.4.0
azure-ad:185.v3b416408dcb1
azure-sdk:70.v63f6a95999a7
basic-branch-build-strategies:1.3.2
bitbucket-server-checks:1.0-SNAPSHOT (private-49d94041-kalle)
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-3
bouncycastle-api:2.25
branch-api:2.7.0
buildtriggerbadge:2.11
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-bitbucket-branch-source:734.v2f848c5e6ea2
cloudbees-disk-usage-simple:0.10
cloudbees-folder:6.16
command-launcher:1.2
compress-artifacts:1.10
configuration-as-code:1.55
copyartifact:1.46.2
credentials:2.6.2
credentials-binding:1.27
custom-tools-plugin:0.8
data-tables-api:1.11.3-4
display-url-api:2.3.5
dtkit-api:3.0.0
durable-task:493.v195aefbb0ff2
echarts-api:5.2.2-1
extended-choice-parameter:0.82
extended-read-permission:3.2
fast-track:1.0.0
folder-auth:1.3
font-awesome-api:5.15.4-4
forensics-api:1.7.0
git:4.10.0
git-client:3.10.0
git-forensics:1.3.0
git-server:1.10
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
hudson-wsclean-plugin:1.0.8
jackson2-api:2.13.0-230.v59243c64b0a5
jaxb:2.3.0.1
jdk-tool:1.0
jira:3.6
job-restrictions:0.8
jquery:1.12.4-1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.53
lockable-resources:2.12
mailer:1.34
matrix-auth:2.6.9
matrix-project:1.19
momentjs:1.1.1
mstest:1.0.0
next-build-number:1.7
nunit:0.27
okhttp-api:4.9.3-105.vb96869f8ac3a
pipeline-build-step:2.15
pipeline-graph-analysis:1.12
pipeline-graph-view:47.v91726240f7a6
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.3
pipeline-model-definition:1.9.3
pipeline-model-extensions:1.9.3
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.9.3
pipeline-stage-view:2.19
pipeline-utility-steps:2.11.0
plain-credentials:1.7
plugin-util-api:2.6.0
popper-api:1.16.1-2
popper2-api:2.10.2-1
prism-api:1.25.0-1
resource-disposer:0.16
role-strategy:3.2.0
scm-api:2.6.5
script-security:1.78
sidebar-link:1.12.1
sidebar-update-notification:1.1.0
snakeyaml-api:1.29.1
ssh-credentials:1.19
sshd:3.1.0
structs:308.v852b473a2b8c
timestamper:1.15
token-macro:267.vcdaea6462991
trilead-api:1.0.13
vstestrunner:1.0.8
warnings-ng:9.9.0
windows-slaves:1.0
workflow-aggregator:2.6
workflow-api:2.47
workflow-basic-steps:2.24
workflow-cps:2640.v00e79c8113de
workflow-cps-global-lib:548.v9085a486966a
workflow-durable-task-step:1102.v9c8d2f466adb
workflow-job:2.42
workflow-multibranch:2.26
workflow-scm-step:2.13
workflow-step-api:2.24
workflow-support:3.8
ws-cleanup:0.39
xunit:3.0.5
Controller and agents on Windows Server 2012 R2

Reproduction steps

Results

Expected result:

Should navigate back to https://REDACTED/jenkins/job/MIG/job/migration/job/master/.

Actual result:

Navigates to https://REDACTED/, which doesn't even have /jenkins at the start of the path.

jglick commented 2 years ago

I am guessing that buildUrl is null in https://github.com/jenkinsci/pipeline-graph-view-plugin/blob/5a693b7664832396215511ce79a2975138bafb71/src/main/resources/io/jenkins/plugins/pipelinegraphview/multipipelinegraphview/MultiPipelineGraphViewAction/sidepanel.jelly#L7-L8 which would make sense given that this is an action for a job not a build. Anyway using Functions.decompose is unnecessary even in say https://github.com/jenkinsci/pipeline-graph-view-plugin/blob/5a693b7664832396215511ce79a2975138bafb71/src/main/resources/io/jenkins/plugins/pipelinegraphview/PipelineGraphViewAction/sidepanel.jelly#L7 because https://github.com/jenkinsci/pipeline-graph-view-plugin/blob/5a693b7664832396215511ce79a2975138bafb71/src/main/java/io/jenkins/plugins/pipelinegraphview/utils/AbstractPipelineViewAction.java#L34 could just keep a reference to the build and make it accessible via a getter for Jelly.

timja commented 1 year ago

Link was removed in https://github.com/jenkinsci/pipeline-graph-view-plugin/pull/80