jenkinsci / pipeline-github-plugin

Pipeline: GitHub
https://plugins.jenkins.io/pipeline-github/
MIT License
159 stars 73 forks source link

Version 2.8-138.d766e30bb08b fails on pullRequest.reviewComment with Missing required 'pull_request_review_thread.diff_hunk' #106

Closed gabpil45 closed 1 year ago

gabpil45 commented 2 years ago

Jenkins and plugins versions report

2.8-138.d766e30bb08b Latest on 13 Sep 2021

Version 2.8-138.d766e30bb08b fails on pullRequest.reviewComment with Missing required 'pull_request_review_thread.diff_hunk'

Error

10:39:03.188 hudson.remoting.ProxyException: org.eclipse.egit.github.core.client.RequestException: Validation Failed (422): Invalid value for 'pull_request_review_thread.path' field, Missing required 'pull_request_review_thread.diff_hunk' field
10:39:03.188    at org.eclipse.egit.github.core.client.GitHubClient.createException(GitHubClient.java:585)
10:39:03.188    at org.eclipse.egit.github.core.client.GitHubClient.sendJson(GitHubClient.java:676)
10:39:03.188    at org.eclipse.egit.github.core.client.GitHubClient.post(GitHubClient.java:795)

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux

Reproduction steps

  1. send a comment to Github Enterprise (GitHub Enterprise Server 3.2.6) PR using pullRequest.reviewComment
  2. Got error saying, when sending review comments based on a list of findings cfg.results.each { pullRequest.reviewComment(_last_commit.sha, it.path, it.start.line, body) }
    10:39:03.188 hudson.remoting.ProxyException: org.eclipse.egit.github.core.client.RequestException: Validation Failed (422): Invalid value for 'pull_request_review_thread.path' field, Missing required 'pull_request_review_thread.diff_hunk' field
    10:39:03.188    at org.eclipse.egit.github.core.client.GitHubClient.createException(GitHubClient.java:585)
    10:39:03.188    at org.eclipse.egit.github.core.client.GitHubClient.sendJson(GitHubClient.java:676)
    10:39:03.188    at org.eclipse.egit.github.core.client.GitHubClient.post(GitHubClient.java:795)
    10:39:03.188    at org.jenkinsci.plugins.pipeline.github.client.ExtendedPullRequestService.createComment2(ExtendedPullRequestService.java:136)
    10:39:03.188    at org.jenkinsci.plugins.pipeline.github.PullRequestGroovyObject.reviewComment(PullRequestGroovyObject.java:693)
    ...

Expected Results

reviewcomment works

Actual Results

error

Anything else?

No response

aaronwalker commented 1 year ago

can't reproduce