jenkinsci / pull-request-monitoring-plugin

Jenkins plugin to monitor pull requests with customizable dashboard. You can also provide a view for your plugin that other developers can use in their dashboard.
https://plugins.jenkins.io/pull-request-monitoring/
MIT License
9 stars 6 forks source link

URISyntaxException due to backslash on Windows #106

Closed KalleOlaviNiemitalo closed 3 years ago

KalleOlaviNiemitalo commented 3 years ago

Version report

Jenkins and plugins versions report:

Jenkins: 2.289.1
OS: Windows Server 2012 R2 - 6.3
---
ace-editor:1.1
analysis-model-api:10.2.5
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
atlassian-bitbucket-server-integration:2.1.3
authentication-tokens:1.4
authorize-project:1.4.0
basic-branch-build-strategies:1.3.2
bitbucket-server-checks:1.0-SNAPSHOT (private-eedd5336-kalle)
bootstrap4-api:4.6.0-3
bootstrap5-api:5.0.1-2
bouncycastle-api:2.20
branch-api:2.6.4
build-monitor-plugin:1.12+build.201809061734
buildtriggerbadge:2.10
caffeine-api:2.9.1-23.v51c4e2c879c8
checks-api:1.7.0
cloudbees-bitbucket-branch-source:2.9.9
cloudbees-disk-usage-simple:0.10
cloudbees-folder:6.15
command-launcher:1.6
compress-artifacts:1.10
configuration-as-code:1.51
copyartifact:1.46.1
credentials-binding:1.25
credentials:2.5
crowd2:2.0.2
custom-tools-plugin:0.8
data-tables-api:1.10.25-1
display-url-api:2.3.5
dtkit-api:3.0.0
durable-task:1.37
echarts-api:5.1.2-2
extended-choice-parameter:0.82
extended-read-permission:3.2
folder-auth:1.3
font-awesome-api:5.15.3-3
forensics-api:1.1.0
git-client:3.7.2
git-forensics:1.0.0
git-server:1.9
git:4.7.2
github-api:1.123
github-branch-source:2.11.1
github:1.33.1
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
hudson-wsclean-plugin:1.0.8
jackson2-api:2.12.3
jdk-tool:1.5
jira:3.3
jjwt-api:0.11.2-9.c8b45b8bb173
job-restrictions:0.8
jquery:1.12.4-1
jquery3-api:3.6.0-1
jsch:0.1.55.2
junit:1.50
lockable-resources:2.11
mailer:1.34
matrix-auth:2.6.7
matrix-project:1.19
momentjs:1.1.1
mstest:1.0.0
multi-branch-priority-sorter:1.0
next-build-number:1.6
nunit:0.27
Office-365-Connector:4.15.0
okhttp-api:3.14.9
pipeline-aggregator-view:1.11
pipeline-build-step:2.13
pipeline-graph-analysis:1.11
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.8.5
pipeline-model-definition:1.8.5
pipeline-model-extensions:1.8.5
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.8.5
pipeline-stage-view:2.19
pipeline-utility-steps:2.8.0
plain-credentials:1.7
plugin-util-api:2.3.0
popper-api:1.16.1-2
popper2-api:2.5.4-2
PrioritySorter:4.0.0
resource-disposer:0.16
role-strategy:3.1.1
scm-api:2.6.4
script-security:1.77
security-inspector:0.5
sidebar-link:1.12.0
sidebar-update-notification:1.1.0
skip-notifications-trait:1.0.5
snakeyaml-api:1.29.1
ssh-credentials:1.19
sshd:3.0.3
structs:1.23
timestamper:1.13
token-macro:2.15
trilead-api:1.0.13
violation-comments-to-stash:1.126
vstestrunner:1.0.8
warnings-ng:9.2.0
windows-slaves:1.8
workflow-aggregator:2.6
workflow-api:2.44
workflow-basic-steps:2.23
workflow-cps-global-lib:2.19
workflow-cps:2.92
workflow-durable-task-step:2.39
workflow-job:2.41
workflow-multibranch:2.24
workflow-scm-step:2.12
workflow-step-api:2.23
workflow-support:3.8
ws-cleanup:0.39
xunit:3.0.2
muuri-api:0.9.4-2
select2-api:4.0.13-5
pull-request-monitoring:1.7.3
Windows Server 2012 R2

Reproduction steps

Not sure. I guess it will happen with any pull request if the Jenkins controller is on Windows.

Results

Expected result:

The "Pull Request Monitoring '#11'" link on a pull-request page leads somewhere, and there are no errors in the log.

Actual result:

Clicking the "Pull Request Monitoring '#11'" link on a pull-request page does nothing, and there is an error in the log:

Failed to parse URL for io.jenkins.plugins.monitoring.MonitoringWorkflowJobAction@51c16297: java.net.URISyntaxException: Illegal character in path at index 2: 11\pull-request-monitoring

KalleOlaviNiemitalo commented 3 years ago

Maybe this needs to hardcode '/' as the URI path component separator, regardless of what the operating system uses as the directory separator in file paths.

https://github.com/jenkinsci/pull-request-monitoring-plugin/blob/e1744017f506c4547d574d06205d63b84c0b2ca1/src/main/java/io/jenkins/plugins/monitoring/MonitoringWorkflowJobAction.java#L40-L43

KalleOlaviNiemitalo commented 3 years ago

Searching for File.separator does not find matches in any other files.

simonsymhoven commented 3 years ago

Maybe this needs to hardcode '/' as the URI path component separator, regardless of what the operating system uses as the directory separator in file paths.

https://github.com/jenkinsci/pull-request-monitoring-plugin/blob/e1744017f506c4547d574d06205d63b84c0b2ca1/src/main/java/io/jenkins/plugins/monitoring/MonitoringWorkflowJobAction.java#L40-L43

Yes of course, File.seperator does not make any sense at this point. Thanks, will fix it!