jenkinsci / github-checks-plugin

Jenkins Plugin for GitHub Checks API
https://plugins.jenkins.io/github-checks/
MIT License
78 stars 38 forks source link

Failed Publishing GitHub checks - Invalid request. skipped is not a member of ... #63

Closed timja closed 3 years ago

timja commented 3 years ago

This is from ci.jenkins.io system log

Failed Publishing GitHub checks: ChecksDetails{name='Jenkins', detailsURL='null', status=COMPLETED, conclusion=SKIPPED, startedAt=null, completedAt=null, output=null, actions=[]}
java.io.FileNotFoundException: https://api.github.com/repos/jenkinsci/jenkins/check-runs
    at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$OkHttpURLConnection.getInputStream(ObsoleteUrlFactory.java:488)
    at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$DelegatingHttpsURLConnection.getInputStream(ObsoleteUrlFactory.java:1201)
    at org.kohsuke.github.GitHubHttpUrlConnectionClient$HttpURLConnectionResponseInfo.bodyStream(GitHubHttpUrlConnectionClient.java:197)
    at org.kohsuke.github.GitHubResponse$ResponseInfo.getBodyAsString(GitHubResponse.java:326)
    at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:91)
    at org.kohsuke.github.Requester.lambda$fetch$1(Requester.java:74)
    at org.kohsuke.github.GitHubClient.createResponse(GitHubClient.java:461)
    at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:412)
Caused: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/jenkinsci/jenkins/check-runs {"message":"Invalid request.\n\nskipped is not a member of [\"success\", \"failure\", \"neutral\", \"cancelled\", \"timed_out\", \"action_required\"].","documentation_url":"https://docs.github.com/rest/reference/checks#create-a-check-run"}
    at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:492)
    at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:420)
    at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:363)
    at org.kohsuke.github.Requester.fetch(Requester.java:74)
    at org.kohsuke.github.GHCheckRunBuilder.create(GHCheckRunBuilder.java:137)
    at io.jenkins.plugins.checks.github.GitHubChecksPublisher.publish(GitHubChecksPublisher.java:62)
    at io.jenkins.plugins.checks.BuildStatusChecksPublisher.publish(BuildStatusChecksPublisher.java:35)
    at io.jenkins.plugins.checks.BuildStatusChecksPublisher.access$000(BuildStatusChecksPublisher.java:30)
    at io.jenkins.plugins.checks.BuildStatusChecksPublisher$JobCompletedListener.onCompleted(BuildStatusChecksPublisher.java:110)
    at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:209)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:610)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:137)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1037)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1473)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:489)
    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38)
    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:136)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
timja commented 3 years ago

@XiongKezhi did you ever try out skipped?

https://github.com/jenkinsci/github-checks-plugin/blob/e9ab753256f1cfb182e9a41b14d1d9f2ccf11284/src/main/java/io/jenkins/plugins/checks/github/GitHubChecksDetails.java#L130

this was the only reference I found on google: https://github.community/t/create-check-run-documented-conclusion-skipped-does-not-work/14900

XiongKezhi commented 3 years ago

Can't remember, when I was adding this property to github-api in July (https://github.com/hub4j/github-api/pull/885), I was wondering why I missed it (since this part is also implemented by me earlier in March), maybe I tested it for the first time but didn't before adding it...

So fixing it by using CANCELLED instead?

timja commented 3 years ago

cancelled or neutral I think, probably cancelled