jenkinsci / ghprb-plugin

github pull requests builder plugin for Jenkins
https://plugins.jenkins.io/ghprb/
MIT License
498 stars 606 forks source link

GHPRB not sending a comment to the pull request when specified. #819

Closed JonSnowWhite closed 3 years ago

JonSnowWhite commented 3 years ago

Version report

Jenkins and plugins versions report:

Jenkins: 2.293
OS: Linux - 4.4.0-210-generic
---
ant:1.11
authentication-tokens:1.4
branch-api:2.6.4
pipeline-build-step:2.13
plugin-util-api:2.2.0
git-server:1.9
pipeline-model-api:1.8.4
handlebars:3.0.8
jsch:0.1.55.2
workflow-scm-step:2.12
workflow-support:3.8
bouncycastle-api:2.20
docker-build-publish:1.3.3
workflow-cps:2.92
docker-commons:1.17
ldap:2.7
pipeline-model-definition:1.8.4
slack-uploader:1.7
github-oauth:0.33
email-ext:2.82
github-coverage-reporter:1.9
credentials:2.4.1
echarts-api:5.1.0-2
scm-api:2.6.4
jquery-detached:1.2.1
github-pr-coverage-status:2.1.1
token-macro:2.15
icon-shim:3.0.0
jackson2-api:2.12.3
workflow-api:2.42
snakeyaml-api:1.27.0
junit:1.49
webhook-step:1.4
okhttp-api:3.14.9
jjwt-api:0.11.2-9.c8b45b8bb173
popper-api:1.16.1-2
ws-cleanup:0.39
checks-api:1.7.0
ssh-credentials:1.18.2
workflow-step-api:2.23
display-url-api:2.3.4
command-launcher:1.6
workflow-basic-steps:2.23
structs:1.23
pipeline-stage-step:2.5
github-branch-source:2.10.4
github-pullrequest:0.3.0
apache-httpcomponents-client-4-api:4.5.13-1.0
pipeline-github-lib:1.0
slack:2.47
cloudbees-folder:6.15
mapdb-api:1.0.9.0
bootstrap4-api:4.6.0-3
matrix-auth:2.6.7
workflow-durable-task-step:2.39
ssh-slaves:1.31.7
script-security:1.76
pipeline-rest-api:2.19
ace-editor:1.1
mailer:1.34
jquery3-api:3.6.0-1
workflow-cps-global-lib:2.19
trilead-api:1.0.13
momentjs:1.1.1
antisamy-markup-formatter:2.1
resource-disposer:0.15
pipeline-model-extensions:1.8.4
timestamper:1.13
ghprb:1.42.2
pipeline-stage-view:2.19
jdk-tool:1.5
git:4.7.1
subversion:2.14.1
pam-auth:1.6
multibranch-scan-webhook-trigger:1.0.5
pipeline-model-declarative-agent:1.1.1
embeddable-build-status:2.0.3
workflow-multibranch:2.24
pipeline-input-step:2.12
publish-over-ssh:1.22
pipeline-stage-tags-metadata:1.8.4
matrix-project:1.18
workflow-aggregator:2.6
credentials-binding:1.24
pipeline-milestone-step:1.3.2
build-timeout:1.20
pipeline-graph-analysis:1.10
lockable-resources:2.10
github:1.33.1
durable-task:1.36
generic-webhook-trigger:1.72
github-api:1.123
publish-over:0.22
gradle:1.36
pipeline-github:2.7
sshd:3.0.3
docker-workflow:1.26
workflow-job:2.40
plain-credentials:1.7
font-awesome-api:5.15.3-2
git-client:3.7.1
Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-210-generic x86_64)

Reproduction steps

image

image

image

Results

Expected result:

With these settings I would expect the plugin to update the build status on the pull request and comment on the pull request with "test".

Actual result:

The plugin is able to update the build status as follows

image

However, no message is send.

Jenkins/the plugin is able to write a test comment in Jenkins' global option. Therefore, I suspect the access rights to be correct as well.

JonSnowWhite commented 3 years ago

The problem was in my refspec. Changing it to +refs/pull/*:refs/remotes/origin/pr/* did the trick. For completeness sake: The append build log option did not appear on my project settings, only in my global settings. This was fixable by copying

        <org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildLog>
          <logExcerptLines>25</logExcerptLines>
        </org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildLog>

to $jenkins_home/jobs/<my_job>/config.xml into the trigger section