Coder Social home page Coder Social logo

jenkinsci / github-checks-plugin Goto Github PK

View Code? Open in Web Editor NEW
77.0 9.0 36.0 1.94 MB

Jenkins Plugin for GitHub Checks API

Home Page: https://plugins.jenkins.io/github-checks/

License: MIT License

Java 99.39% HTML 0.61%
github report post-build notifier hacktoberfest

github-checks-plugin's Introduction

GitHub Checks API Plugin

Join the chat at https://gitter.im/jenkinsci/github-checks-api contributions welcome Jenkins GitHub Actions Codacy Badge codecov

GitHub Checks Plugin Cover

This plugin publishes checks to GitHub through GitHub Checks API. It implements the extension points defined in Checks API Plugin.

This plugin has been installed, along with the General API Plugin on ci.jenkins.io to help maintain over 1500 Jenkins plugins. You can take a look at the action for this repository or other plugin repositories under Jenkins organization for the results.

Getting started

Only GitHub Apps with proper permissions can publish checks, this guide helps you authenticate your Jenkins instance as a GitHub App. The permission read/write on Checks needs to be granted in addition to the ones already mentioned in the guide.

Features

Build Status Check

GitHub Status

This plugin implements the status checks feature from Checks API Plugin to publish statuses (pending, in progress, and completed) to GitHub.

You can customize it by configuring the "Status Checks Properties" behavior for your GitHub SCM Source or Git SCM projects:

Status Checks Properties

Note: If you are using GitHub Branch Source Plugin, it will also send status notifications to GitHub through Status API. You can disable those notifications by configuring Skip GitHub Branch Source notifications option.

Rerun Failed Build

Failed Checks

If your Jenkins build failed, a failed check will be published here. A "Re-run" button will be added automatically by GitHub, by clicking it, you can schedule a new build for the last commit of this branch.

Configuration

Checks Config

  • Verbose Console Log : check for verbose build console log, the default is false

Contributing

Refer to our contribution guidelines

Acknowledgements

This plugin was started as a Google Summer of Code 2020 project, special thanks to the support from Jenkins GSoC SIG and the entire community.

LICENSE

Licensed under MIT, see LICENSE

github-checks-plugin's People

Contributors

acormier1 avatar agaudreault avatar ccfenner avatar dependabot[bot] avatar garethjevans avatar jgedarovich avatar jglick avatar jonesbusy avatar mrginglymus avatar nilmapeiris avatar oleg-nenashev avatar pcanilho avatar renovate[bot] avatar rtyler avatar timja avatar uhafner avatar viliuss avatar xiongkezhi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-checks-plugin's Issues

Github Checks configuration not available after installing the plugin

Version report

Jenkins and plugins versions report:

Result
Jenkins: 2.303.1
OS: Linux - 5.4.0-1045-aws
---
ace-editor:1.1
ant:1.11
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.1-1
bouncycastle-api:2.24
branch-api:2.6.5
build-timeout:1.20
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-folder:6.16
command-launcher:1.6
credentials:2.6.1
credentials-binding:1.27
display-url-api:2.3.5
durable-task:1.39
echarts-api:5.1.2-11
email-ext:2.83
font-awesome-api:5.15.4-1
ghprb:1.42.2
git:4.8.2
git-client:3.9.0
git-server:1.10
github:1.34.1
github-api:1.123
github-branch-source:2.11.2
github-checks:1.0.13
gradle:1.37.1
handlebars:3.0.8
jackson2-api:2.12.4
jaxb:2.3.0.1
jdk-tool:1.5
jjwt-api:0.11.2-9.c8b45b8bb173
jquery-detached:1.2.1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.53
ldap:2.7
lockable-resources:2.11
mailer:1.34
matrix-auth:2.6.8
matrix-project:1.19
momentjs:1.1.1
multibranch-scan-webhook-trigger:1.0.9
okhttp-api:3.14.9
pam-auth:1.6
pipeline-build-step:2.15
pipeline-github-lib:1.0
pipeline-graph-analysis:1.11
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.2
pipeline-model-definition:1.9.2
pipeline-model-extensions:1.9.2
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.9.2
pipeline-stage-view:2.19
plain-credentials:1.7
plugin-util-api:2.4.0
popper-api:1.16.1-2
popper2-api:2.10.1-1
resource-disposer:0.16
scm-api:2.6.5
script-security:1.78
snakeyaml-api:1.29.1
ssh-credentials:1.19
ssh-slaves:1.33.0
sshd:3.1.0
structs:1.23
timestamper:1.13
token-macro:266.v44a80cf277fd
trilead-api:1.0.13
workflow-aggregator:2.6
workflow-api:2.46
workflow-basic-steps:2.24
workflow-cps:2.94
workflow-cps-global-lib:2.21
workflow-durable-task-step:2.39
workflow-job:2.41
workflow-multibranch:2.26
workflow-scm-step:2.13
workflow-step-api:2.24
workflow-support:3.8
ws-cleanup:0.39
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Ubuntu 20.04.3 LTS

Reproduction steps

  • Installed Jenkins on ubuntu via apt-get
  • Installed Github Checks plugin
  • This configuration is not available anywhere (trying to set up a multibranch pipeline)

Results

Expected result:

Able to configure Github Status Checks

Actual result:

This configuration is not available anywhere (trying to set up a multibranch pipeline)

Updating status checks on merge of PR instead of head

Describe your use-case which is not covered by existing documentation.

If I use the branch specifier origin/pull/4/merge instead of origin/pull/4/head the status checks are trying to write to the wrong commit (the result of the merge and not the PR head). Are there any documented ways to do this?

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

No response

Allow a configurable credential for github checks plugin instead of using the cred from the initial clone

What feature do you want to see added?

I am looking for the ability to configure a specific credential for use with the github checks plugin. Right now, it appears to require a githup app credential in Jenkins. This is ok, but would be good to also be able to use a PAT where needed. I would also like to be able to use a different credential to clone the repo vs the credential used for the checks plugin.

Use Case: We have a github org where we cannot give global read access to the repo itself, but still want to enable github checks to work. Our org is managed in such a way and has too many repos for each repo to manage an app due to security constraints.

Upstream changes

No response

Status check "COMPLETED" skipped if branch deleted in the meantime

We experience an issue with the status checks reporting:

Steps to reproduce:

  • create a remote branch of an existing commit (e.g. via GitHub UI). For example: branch main with commit sha aaaaaa, create new branch test, also pointing to aaaaaa
  • Jenkins discovers new branch test via github-branch-source-plugin and triggers build automatically
  • in the build log it says [GitHub Checks] GitHub check (name: Jenkins, status: IN_PROGRESS) has been published.. Accordingly, the build status in GitHub UI is reported correctly and can be viewed at branch main and test (because they're both pointing to commit aaaaaa)
  • during the build run - as part of the pipeline - the remote branch test is deleted via GitHub API, e.g. [Pipeline] sh curl -s -X DELETE -u x-access-token:**** -H Accept: application/vnd.github.v3+json https://github.example.com/api/v3/repos/example-owner/example-repository/git/refs/heads/test
  • the build finishes successfully

Expected behaviour:

The status COMPLETED is reported to GitHub, e.g.:

image

Actual behaviour:

The status COMPLETED is not reported to GitHub.

image

This is not bad for the remote branch test (because it was deleted anyhow), but the status check on the branch main spins endlessly:

image

image

Not sure if related: we're using two shared declarative pipelines for the build.

Versions

Jenkins: 2.289.3
GitHub Enterprise Server: 3.0.13
Jenkins plugins:
ace-editor: 1.1
antisamy-markup-formatter: 2.1
apache-httpcomponents-client-4-api: 4.5.13-1.0
authentication-tokens: 1.4
authorize-project: 1.4.0
basic-branch-build-strategies: 1.3.2
blueocean: 1.24.8
blueocean-autofavorite: 1.2.4
blueocean-bitbucket-pipeline: 1.24.8
blueocean-commons: 1.24.8
blueocean-config: 1.24.8
blueocean-core-js: 1.24.8
blueocean-dashboard: 1.24.8
blueocean-display-url: 2.4.1
blueocean-events: 1.24.8
blueocean-git-pipeline: 1.24.8
blueocean-github-pipeline: 1.24.8
blueocean-i18n: 1.24.8
blueocean-jira: 1.24.8
blueocean-jwt: 1.24.8
blueocean-personalization: 1.24.8
blueocean-pipeline-api-impl: 1.24.8
blueocean-pipeline-editor: 1.24.8
blueocean-pipeline-scm-api: 1.24.8
blueocean-rest: 1.24.8
blueocean-rest-impl: 1.24.8
blueocean-web: 1.24.8
bootstrap4-api: 4.6.0-3
bootstrap5-api: 5.1.0-1
bouncycastle-api: 2.22
branch-api: 2.6.5
caffeine-api: 2.9.2-29.v717aac953ff3
checks-api: 1.7.2
cloudbees-bitbucket-branch-source: 2.9.10
cloudbees-disk-usage-simple: 0.10
cloudbees-folder: 6.16
command-launcher: 1.6
config-file-provider: 3.8.1
credentials: 2.5
credentials-binding: 1.27
cucumber-reports: 5.5.0
display-url-api: 2.3.5
docker-commons: 1.17
docker-workflow: 1.26
durable-task: 1.39
echarts-api: 5.1.2-9
email-ext: 2.83
extended-read-permission: 3.2
external-monitor-job: 1.7
favorite: 2.3.3
font-awesome-api: 5.15.3-4
git: 4.8.1
git-client: 3.9.0
git-server: 1.10
github: 1.34.0
github-api: 1.123
github-branch-source: 2.11.2
github-checks: 1.0.13
github-pr-comment-build: 2.3
h2-api: 1.4.199
handlebars: 3.0.8
handy-uri-templates-2-api: 2.1.8-1.0
htmlpublisher: 1.25
http_request: 1.10
jackson2-api: 2.12.4
jacoco: 3.3.0
javadoc: 1.6
jdk-tool: 1.5
jenkins-design-language: 1.24.8
jira: 3.5
jjwt-api: 0.11.2-9.c8b45b8bb173
jquery-detached: 1.2.1
jquery3-api: 3.6.0-2
jsch: 0.1.55.2
junit: 1.52
ldap: 2.7
lockable-resources: 2.11
mailer: 1.34
matrix-auth: 2.6.8
matrix-project: 1.19
maven-plugin: 3.12
mercurial: 2.15
metrics: 4.0.2.8
momentjs: 1.1.1
nexus-artifact-uploader: 2.13
okhttp-api: 3.14.9
openJDK-native-plugin: 1.4
pam-auth: 1.6
pipeline-aws: 1.43
pipeline-build-step: 2.15
pipeline-github: 2.7
pipeline-graph-analysis: 1.11
pipeline-input-step: 2.12
pipeline-maven: 3.10.0
pipeline-milestone-step: 1.3.2
pipeline-model-api: 1.9.1
pipeline-model-definition: 1.9.1
pipeline-model-extensions: 1.9.1
pipeline-multibranch-defaults: 2.1
pipeline-rest-api: 2.19
pipeline-stage-step: 2.5
pipeline-stage-tags-metadata: 1.9.1
pipeline-stage-view: 2.19
pipeline-utility-steps: 2.8.0
plain-credentials: 1.7
plugin-util-api: 2.4.0
popper-api: 1.16.1-2
popper2-api: 2.9.3-1
prometheus: 2.0.10
pubsub-light: 1.16
resource-disposer: 0.16
role-strategy: 3.2.0
saml: 2.0.7
scm-api: 2.6.5
script-security: 1.78
selenium: 3.141.59
seleniumhtmlreport: 1.1
serenity: 1.4
slave-proxy: 1.1
snakeyaml-api: 1.29.1
sonar: 2.13.1
sse-gateway: 1.24
ssh-agent: 1.23
ssh-credentials: 1.19
ssh-slaves: 1.32.0
sshd: 3.1.0
structs: 1.23
swarm: 3.27
token-macro: 266.v44a80cf277fd
trilead-api: 1.0.13
variant: 1.4
versionnumber: 1.9
windows-slaves: 1.8
workflow-aggregator: 2.6
workflow-api: 2.46
workflow-basic-steps: 2.24
workflow-cps: 2.93
workflow-cps-global-lib: 2.21
workflow-durable-task-step: 2.39
workflow-job: 2.41
workflow-multibranch: 2.26
workflow-scm-step: 2.13
workflow-step-api: 2.24
workflow-support: 3.8
ws-cleanup: 0.39

GitHub checks not published despite successful job execution

Jenkins and plugins versions report

Environment
Jenkins: 2.401.1
OS: Linux - 5.4.0-152-generic
Java: 11.0.19 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
additional-metrics:67.vcb_823d3999a_2
ansicolor:1.0.2
antisamy-markup-formatter:159.v25b_c67cd35fb_
apache-httpcomponents-client-4-api:4.5.14-150.v7a_b_9d17134a_5
atlassian-jira-software-cloud:2.0.7
authentication-tokens:1.53.v1c90fd9191a_b_
bootstrap4-api:4.6.0-6
bootstrap5-api:5.3.0-1
bouncycastle-api:2.28
branch-api:2.1109.vdf225489a_16d
build-blocker-plugin:1.7.8
caffeine-api:3.1.6-115.vb_8b_b_328e59d8
checks-api:2.0.0
cloudbees-disk-usage-simple:182.v62ca_0c992a_f3
cloudbees-folder:6.815.v0dd5a_cb_40e0e
cobertura:1.17
code-coverage-api:4.7.0
command-launcher:100.v2f6722292ee8
commons-httpclient3-api:3.1-3
commons-lang3-api:3.12.0-36.vd97de6465d5b_
commons-text-api:1.10.0-36.vc008c8fcda_7b_
conditional-buildstep:1.4.2
copyartifact:705.v5295cffec284
credentials:1254.vb_96f366e7b_a_d
credentials-binding:604.vb_64480b_c56ca_
dark-theme:336.v02165cd8c2ee
dashboard-view:2.487.vcf0ff9008a_c0
data-tables-api:1.13.4-3
discard-old-build:1.07
display-url-api:2.3.7
docker-commons:419.v8e3cd84ef49c
docker-workflow:563.vd5d2e5c4007f
downstream-build-cache:1.7
dtkit-api:3.0.2
durable-task:507.v050055d0cb_dd
echarts-api:5.4.0-5
email-ext:2.99
emailext-template:1.5
embeddable-build-status:385.vc95f94e91fb_3
extended-read-permission:53.v6499940139e5
external-monitor-job:203.v683c09d993b_9
favorite:2.4.2
file-operations:131.v32b_e7824fe95
font-awesome-api:6.4.0-1
forensics-api:2.3.0
git:5.1.0
git-client:4.4.0
git-server:99.va_0826a_b_cdfa_d
github:1.37.1
github-api:1.314-431.v78d72a_3fe4c3
github-branch-source:1728.v859147241f49
github-checks:545.v79a_a_68b_ca_682
github-oauth:0.39
github-scm-trait-notification-context:1.1
global-yaml-properties:1.13.vd9d55099b_597
google-oauth-plugin:1.0.9
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
htmlpublisher:1.31
http_request:1.17
instance-identity:173.va_37c494ec4e5
ionicons-api:56.v1b_1c8c49374e
jackson2-api:2.15.2-350.v0c2f3f8fc595
jacoco:3.3.3
jakarta-activation-api:2.0.1-3
jakarta-mail-api:2.0.1-3
javadoc:233.vdc1a_ec702cff
javax-activation-api:1.2.0-6
javax-mail-api:1.6.2-9
jaxb:2.3.8-1
jdk-tool:66.vd8fa_64ee91b_d
jenkins-design-language:1.27.4
jersey2-api:2.39.1-2
jira:3.10
jjwt-api:0.11.5-77.v646c772fddb_0
jnr-posix-api:3.1.17-1
job-dsl:1.84
jobConfigHistory:1212.vd4470d08ff12
jquery3-api:3.7.0-1
jsch:0.2.8-65.v052c39de79b_2
junit:1214.va_2f9db_3e6de0
kubernetes:3950.v581298fa_e4e7
kubernetes-client-api:6.4.1-215.v2ed17097a_8e9
kubernetes-credentials:0.10.0
ldap:682.v7b_544c9d1512
lockable-resources:1171.v7a_4699ec2e7e
login-theme:46.v36f624efb_23d
mailer:457.v3f72cb_e015e5
mapdb-api:1.0.9-28.vf251ce40855d
matrix-auth:3.1.8
matrix-project:789.v57a_725b_63c79
maven-plugin:3.22
mercurial:1260.vdfb_723cdcc81
metrics:4.2.18-439.v86a_20b_a_8318b_
mina-sshd-api-common:2.10.0-69.v28e3e36d18eb_
mina-sshd-api-core:2.10.0-69.v28e3e36d18eb_
nexus-artifact-uploader:2.14
nexus-jenkins-plugin:3.16.501.ve3d6b_58f1d37
oauth-credentials:0.645.ve666a_c332668
okhttp-api:4.11.0-145.vcb_8de402ef81
pam-auth:1.10
parameterized-trigger:2.45
pipeline-build-step:496.v2449a_9a_221f2
pipeline-githubnotify-step:49.vf37bf92d2bc8
pipeline-graph-analysis:202.va_d268e64deb_3
pipeline-graph-view:191.vc6da_9d3eb_70a
pipeline-groovy-lib:656.va_a_ceeb_6ffb_f7
pipeline-input-step:468.va_5db_051498a_4
pipeline-milestone-step:111.v449306f708b_7
pipeline-model-api:2.2141.v5402e818a_779
pipeline-model-definition:2.2141.v5402e818a_779
pipeline-model-extensions:2.2141.v5402e818a_779
pipeline-rest-api:2.33
pipeline-stage-step:305.ve96d0205c1c6
pipeline-stage-tags-metadata:2.2141.v5402e818a_779
pipeline-stage-view:2.33
pipeline-utility-steps:2.15.4
plain-credentials:143.v1b_df8b_d3b_e48
plugin-util-api:3.3.0
popper-api:1.16.1-3
popper2-api:2.11.6-2
prism-api:1.29.0-7
prometheus:2.2.3
publish-over:0.22
pubsub-light:1.17
pyenv-pipeline:2.1.2
rebuild:320.v5a_0933a_e7d61
run-condition:1.5
scm-api:676.v886669a_199a_a_
scm-filter-branch-pr:77.vf2b_85e1970d5
script-security:1251.vfe552ed55f8d
sectioned-view:1.25
sidebar-link:2.2.2
simple-theme-plugin:160.vb_76454b_67900
snakeyaml-api:1.33-95.va_b_a_e3e47b_fa_4
sonar:2.15
sse-gateway:1.26
ssh-credentials:305.v8f4381501156
ssh-steps:2.0.65.vd26b_5b_9b_de4d
sshd:3.303.vefc7119b_ec23
structs:324.va_f5d6774f3a_d
subversion:2.17.2
test-results-analyzer:0.4.0
text-finder:1.24
theme-manager:193.vcef22f6c5f2b_
thinBackup:1.17
timestamper:1.25
token-macro:359.vb_cde11682e0c
trilead-api:2.84.v72119de229b_7
uno-choice:2.6.5
validating-string-parameter:2.8
variant:59.vf075fe829ccb
view-job-filters:364.v48a_33389553d
workflow-aggregator:596.v8c21c963d92d
workflow-api:1215.v2b_ee3e1b_dd39
workflow-basic-steps:1017.vb_45b_302f0cea_
workflow-cps:3691.v28b_14c465a_b_b_
workflow-durable-task-step:1247.v7f9dfea_b_4fd0
workflow-job:1308.v58d48a_763b_31
workflow-multibranch:756.v891d88f2cd46
workflow-scm-step:415.v434365564324
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:839.v35e2736cfd5c
xframe-filter-plugin:1.2
xunit:3.1.2
yet-another-build-visualizer:1.16

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

The controller under Kubernetes is based on the official Jenkins docker image
Kubernetes docker agents running Ubuntu 22.04

Reproduction steps

The problem began occurring approximately a week ago. Occasionally, we encounter a situation where the Jenkins job completes successfully, but the corresponding check is not updated. In the console output, we observe that everything appears to be OK:

14:56:09.026  [GitHub Checks] GitHub check (name: Jenkins - EH8010, status: completed) has been published.
14:56:09.760  
14:56:09.760  GitHub has been notified of this commit’s build result
14:56:09.760  
14:56:09.760  Finished: SUCCESS

There are no errors present in the Jenkins logs either.

Expected Results

PR check is updated with the build result

Actual Results

PR check is not updated

Screenshot 2023-07-04 at 15 00 27

Anything else?

No response

Make GitHubChecksContext public outside of package

We want to start using this plugin to send GitHub status check, but our pipelines do not always use GIT or GitHub SCM. For instance, in some cases we use a generic pipeline and use environment variables/parameters to checkout the correct sources. By default, the GitSCM will not be configured to the repository we want to send checks to.

Would it make sense to have GitHubChecksContext public, so we can create a new context and a new ChecksPublisherFactory ?

Option to disable default notifications

Hi,
When Jenkins is added to GitHub it produces two checks for each PRs by default. This behavior can be disabled with Skip Notifications Trait plugin
image
I am thinking that it would be a great addition to Github Checks Plugin to contain this feature and allow us to toggle in configuration.

The two plugins works together well at the moment, but the configuration takes a bit longer as we need to add two Behaviours to each pipeline.
image

Skip publishing status checks - no effect

Version report

Jenkins and plugins versions report:

Jenkins: 2.289.2
OS: Linux - 4.18.0-301.1.el8.x86_64

git-server:1.10
trilead-api:1.0.13
pam-auth:1.6
jaxb:2.3.0.1
cloudbees-folder:6.15
antisamy-markup-formatter:2.1
jdk-tool:1.5
branch-api:2.6.5
structs:1.23
gradle:1.37.1
workflow-step-api:2.24
token-macro:2.15
handlebars:3.0.8
build-timeout:1.20
credentials:2.5
plain-credentials:1.7
momentjs:1.1.1
ssh-credentials:1.19
credentials-binding:1.27
scm-api:2.6.4
workflow-api:2.46
github-api:1.123
timestamper:1.13
pipeline-stage-view:2.19
script-security:1.77
workflow-support:3.8
durable-task:1.38
workflow-basic-steps:2.23
workflow-durable-task-step:2.39
git:4.7.2
junit:1.51
pipeline-build-step:2.14
command-launcher:1.6
bouncycastle-api:2.21
pipeline-model-api:1.8.5
matrix-project:1.19
resource-disposer:0.16
ws-cleanup:0.39
ant:1.11
github:1.33.1
ace-editor:1.1
jquery-detached:1.2.1
jsch:0.1.55.2
workflow-scm-step:2.13
workflow-cps:2.93
workflow-job:2.41
mailer:1.34
apache-httpcomponents-client-4-api:4.5.13-1.0
display-url-api:2.3.5
pipeline-milestone-step:1.3.2
mapdb-api:1.0.9.0
jackson2-api:2.12.4
git-client:3.8.0
pipeline-input-step:2.12
pipeline-stage-step:2.5
pipeline-rest-api:2.19
pipeline-graph-analysis:1.11
pipeline-model-extensions:1.8.5
workflow-cps-global-lib:2.21
echarts-api:5.1.2-3
workflow-multibranch:2.26
pipeline-stage-tags-metadata:1.8.5
pipeline-model-definition:1.8.5
matrix-auth:2.6.8
plugin-util-api:2.4.0
lockable-resources:2.11
workflow-aggregator:2.6
pipeline-github-lib:1.0
subversion:2.14.4
ssh-slaves:1.32.0
ldap:2.7
jjwt-api:0.11.2-9.c8b45b8bb173
configuration-as-code:1.51
build-name-setter:2.2.0
config-file-provider:3.8.1
popper-api:1.16.1-2
rebuild:1.32
bootstrap4-api:4.6.0-3
jquery:1.12.4-1
git-parameter:0.9.13
mercurial:2.15
handy-uri-templates-2-api:2.1.8-1.0
cloudbees-bitbucket-branch-source:2.9.9
generic-webhook-trigger:1.74
bitbucket-oauth:0.10
jobConfigHistory:2.28.1
snakeyaml-api:1.29.1
ansicolor:1.0.0
jquery3-api:3.6.0-2
github-branch-source:2.11.1
email-ext:2.83
authentication-tokens:1.4
okhttp-api:3.14.9
font-awesome-api:5.15.3-4
cobertura:1.16
forensics-api:1.2.1
maven-plugin:3.12
envinject:2.4.0
javadoc:1.6
pipeline-githubnotify-step:1.0.5
windows-slaves:1.8
uno-choice:2.5.6
checks-api:1.7.2
popper2-api:2.5.4-3
view-job-filters:2.3
block-queued-job:0.2.0
run-condition:1.5
bitbucket-scm-trait-commit-skip:0.4.0
github-checks:1.0.13
code-coverage-api:1.4.0
sshd:3.1.0
text-file-operations:1.3.2
built-on-column:1.1
next-executions:1.0.15
caffeine-api:2.9.1-23.v51c4e2c879c8
bootstrap5-api:5.0.2-1
google-play-android-publisher:4.1
envinject-api:1.7
ssh-agent:1.23
github-oauth:0.33
github-pullrequest:0.3.0
oauth-credentials:0.4
extended-choice-parameter:0.82
docker-commons:1.17
google-oauth-plugin:1.0.6
extensible-choice-parameter:1.7.0
jacoco:3.3.0
data-tables-api:1.10.25-2
pipeline-github:2.7
github-autostatus:3.6.2
htmlpublisher:1.25
docker-custom-build-environment:1.7.3
conditional-buildstep:1.4.1
parameterized-trigger:2.41
external-monitor-job:1.7
jenkins-multijob-plugin:1.36
multiple-scms:0.8
allure-jenkins-plugin:2.29.0
pipeline-multibranch-defaults:2.1
ssh-steps:2.0.0

  • Linux

Reproduction steps

Create a pipeline job with Pipeline script from SCM: Git (GitHub).
Add 'Status checks properties' block, with 'Skip publishing status checks' enabled'
Run the job

Results

Expected result:
No status checks published

Actual result:
The status checks are still published.

[GitHub Checks] GitHub check (name: Jenkins, status: IN_PROGRESS) has been published. Running in Durability level: PERFORMANCE_OPTIMIZED .... [GitHub Checks] GitHub check (name: Jenkins, status: COMPLETED) has been published. Finished: FAILURE

Unable to connect using GitHub SCM and github app credentials

Jenkins and plugins versions report

Environment
Jenkins: 2.361.1
OS: Linux - 5.15.0-1020-azure
---
ace-editor:1.1
ant:481.v7b_09e538fcca
antisamy-markup-formatter:2.7
apache-httpcomponents-client-4-api:4.5.13-138.v4e7d9a_7b_a_e61
authentication-tokens:1.4
blueocean:1.25.8
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.25.8
blueocean-commons:1.25.8
blueocean-config:1.25.8
blueocean-core-js:1.25.8
blueocean-dashboard:1.25.8
blueocean-display-url:2.4.1
blueocean-events:1.25.8
blueocean-git-pipeline:1.25.8
blueocean-github-pipeline:1.25.8
blueocean-i18n:1.25.8
blueocean-jwt:1.25.8
blueocean-personalization:1.25.8
blueocean-pipeline-api-impl:1.25.8
blueocean-pipeline-editor:1.25.8
blueocean-pipeline-scm-api:1.25.8
blueocean-rest:1.25.8
blueocean-rest-impl:1.25.8
blueocean-web:1.25.8
bootstrap5-api:5.2.1-2
bouncycastle-api:2.26
branch-api:2.1046.v0ca_37783ecc5
build-timeout:1.24
build-timestamp:1.0.3
caffeine-api:2.9.3-65.v6a_47d0f4d1fe
checks-api:1.7.5
cloud-stats:0.27
cloudbees-bitbucket-branch-source:791.vb_eea_a_476405b
cloudbees-folder:6.758.vfd75d09eea_a_1
command-launcher:90.v669d7ccb_7c31
credentials:1189.vf61b_a_5e2f62e
credentials-binding:523.vd859a_4b_122e6
dark-theme:245.vb_a_2b_b_010ea_96
display-url-api:2.3.6
docker-commons:1.21
docker-java-api:3.2.13-37.vf3411c9828b9
docker-plugin:1.2.10
docker-workflow:521.v1a_a_dd2073b_2e
durable-task:500.v8927d9fd99d8
echarts-api:5.3.3-1
email-ext:2.91
extended-read-permission:3.2
favorite:2.4.1
font-awesome-api:6.2.0-3
git:4.12.1
git-client:3.12.1
git-parameter:0.9.18
github:1.35.0
github-api:1.303-400.v35c2d8258028
github-branch-source:1695.v88de84e9f6b_9
github-checks:1.0.19
github-pullrequest:0.4.0
gradle:1.40
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
htmlpublisher:1.31
instance-identity:116.vf8f487400980
ionicons-api:28.va_f3a_84439e5f
jackson2-api:2.13.3-285.vc03c0256d517
jakarta-activation-api:2.0.1-1
jakarta-mail-api:2.0.1-1
javax-activation-api:1.2.0-4
javax-mail-api:1.6.2-7
jaxb:2.3.6-1
jdk-tool:55.v1b_32b_6ca_f9ca
jenkins-design-language:1.25.8
jjwt-api:0.11.5-77.v646c772fddb_0
job-import-plugin:3.5
jobConfigHistory:1176.v1b_4290db_41a_5
jquery:1.12.4-1
jquery-detached:1.2.1
jquery3-api:3.6.1-1
jsch:0.1.55.61.va_e9ee26616e7
junit:1143.v8d9a_e3355270
kafkalogs:0.1.8
ldap:2.12
mailer:438.v02c7f0a_12fa_4
matrix-auth:3.1.5
matrix-project:785.v06b_7f47b_c631
mina-sshd-api-common:2.9.1-44.v476733c11f82
mina-sshd-api-core:2.9.1-44.v476733c11f82
momentjs:1.1.1
okhttp-api:4.9.3-108.v0feda04578cf
pam-auth:1.10
pipeline-build-step:2.18
pipeline-github-lib:38.v445716ea_edda_
pipeline-graph-analysis:195.v5812d95a_a_2f9
pipeline-groovy-lib:612.v84da_9c54906d
pipeline-input-step:451.vf1a_a_4f405289
pipeline-milestone-step:101.vd572fef9d926
pipeline-model-api:2.2114.v2654ca_721309
pipeline-model-definition:2.2114.v2654ca_721309
pipeline-model-extensions:2.2114.v2654ca_721309
pipeline-rest-api:2.24
pipeline-stage-step:296.v5f6908f017a_5
pipeline-stage-tags-metadata:2.2114.v2654ca_721309
pipeline-stage-view:2.24
pipeline-utility-steps:2.13.0
plain-credentials:139.ved2b_9cf7587b
plugin-util-api:2.17.0
popper2-api:2.11.6-1
pubsub-light:1.17
rebuild:1.34
resource-disposer:0.20
role-strategy:562.v44e9a_e828d0e
scm-api:621.vda_a_b_055e58f7
script-security:1183.v774b_0b_0a_a_451
simple-theme-plugin:103.va_161d09c38c7
snakeyaml-api:1.32-86.ve3f030a_75631
sse-gateway:1.26
ssh-credentials:305.v8f4381501156
ssh-slaves:2.846.v1b_70190624f5
sshd:3.249.v2dc2ea_416e33
structs:324.va_f5d6774f3a_d
theme-manager:1.5
timestamper:1.20
token-macro:308.v4f2b_ed62b_b_16
trilead-api:2.72.v2a_3236754f73
variant:59.vf075fe829ccb
workflow-aggregator:590.v6a_d052e5a_a_b_5
workflow-api:1192.v2d0deb_19d212
workflow-basic-steps:994.vd57e3ca_46d24
workflow-cps:2801.vf82a_b_b_e3e8a_5
workflow-durable-task-step:1199.v02b_9244f8064
workflow-job:1239.v71b_b_a_124a_725
workflow-multibranch:716.vc692a_e52371b_
workflow-scm-step:400.v6b_89a_1317c9a_
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:838.va_3a_087b_4055b
ws-cleanup:0.43

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

Debian GNU/Linux 11 (bullseye)

Reproduction steps

  1. Install github-checks-plugin
  2. Follow the guide to authinticate and install app: https://github.com/jenkinsci/github-branch-source-plugin/blob/master/docs/github-app.adoc
  3. Configure multibranch/pipeline to use the newly created credentials
  4. Try to validate repo

Expected Results

Validation is successful

Actual Results

Validation fails with error: Error validating repository information. Credentials ok.
image

Anything else?

When validating this step: https://github.com/jenkinsci/github-branch-source-plugin/blob/master/docs/github-app.adoc#adding-the-jenkins-credential:~:text=Adding%20the%20Jenkins%20credential
it passes succesfully.
image
However, once I try to do the same on the multibranch pipeline it fails to retrieve the repo as shown above.
If i switch to a PAT everything works fine again, but I don't get any checks by the github-checks-plugin

java.io.FileNotFoundException: https://enterpriserepo.com/api/v3/repos/org/repo_name
	at org.kohsuke.github.GitHubConnectorResponseErrorHandler$1.onError(GitHubConnectorResponseErrorHandler.java:54)
	at org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:424)
	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:386)
Caused: org.kohsuke.github.GHFileNotFoundException: https://enterpriserepo.com/api/v3/repos/org/repo_name {"message":"Not Found","documentation_url":"https://docs.github.com/enterprise/3.5/rest/reference/repos#get-a-repository"}
	at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:540)
	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:401)
	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:355)
	at org.kohsuke.github.Requester.fetch(Requester.java:76)
	at org.kohsuke.github.GHRepository.read(GHRepository.java:131)
	at org.kohsuke.github.GitHub.getRepository(GitHub.java:673)
	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$DescriptorImpl.doValidateRepositoryUrlAndCredentials(GitHubSCMSource.java:2182)
	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:397)
	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:409)
	at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:78)
	at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:207)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:140)
	at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:558)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
	at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:289)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
	at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:289)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
	at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:289)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:690)
	at org.kohsuke.stapler.Stapler.service(Stapler.java:240)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
	at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:157)
	at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:248)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
	at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:129)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
	at jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:81)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
	at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
	at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:60)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:160)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:154)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:94)
	at jenkins.security.AcegiSecurityExceptionFilter.doFilter(AcegiSecurityExceptionFilter.java:52)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:54)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
	at 

PR is displayed as "pending" when `warnError` is met

Version report

Jenkins and plugins versions report:
Jenkins 2.321 / Checks plugin 1.0.13

Jenkins: 2.321
OS: Linux - 5.4.149-73.259.amzn2.x86_64
---
ace-editor:1.1
ansicolor:1.0.1
apache-httpcomponents-client-4-api:4.5.13-1.0
authentication-tokens:1.4
aws-credentials:1.32
aws-java-sdk:1.12.101-300.vc09c7be9cb57
aws-java-sdk-cloudformation:1.12.101-300.vc09c7be9cb57
aws-java-sdk-codebuild:1.12.101-300.vc09c7be9cb57
aws-java-sdk-ec2:1.12.101-300.vc09c7be9cb57
aws-java-sdk-ecr:1.12.101-300.vc09c7be9cb57
aws-java-sdk-ecs:1.12.101-300.vc09c7be9cb57
aws-java-sdk-elasticbeanstalk:1.12.101-300.vc09c7be9cb57
aws-java-sdk-iam:1.12.101-300.vc09c7be9cb57
aws-java-sdk-logs:1.12.101-300.vc09c7be9cb57
aws-java-sdk-minimal:1.12.101-300.vc09c7be9cb57
aws-java-sdk-ssm:1.12.101-300.vc09c7be9cb57
basic-branch-build-strategies:1.3.2
blueocean:1.25.1
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.25.1
blueocean-commons:1.25.1
blueocean-config:1.25.1
blueocean-core-js:1.25.1
blueocean-dashboard:1.25.1
blueocean-display-url:2.4.1
blueocean-events:1.25.1
blueocean-executor-info:1.25.1
blueocean-git-pipeline:1.25.1
blueocean-github-pipeline:1.25.1
blueocean-i18n:1.25.1
blueocean-jira:1.25.1
blueocean-jwt:1.25.1
blueocean-personalization:1.25.1
blueocean-pipeline-api-impl:1.25.1
blueocean-pipeline-editor:1.25.1
blueocean-pipeline-scm-api:1.25.1
blueocean-rest:1.25.1
blueocean-rest-impl:1.25.1
blueocean-web:1.25.1
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-1
bouncycastle-api:2.25
branch-api:2.7.0
build-monitor-plugin:1.13+build.202110011223
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-bitbucket-branch-source:726.vb0c1ea6c9336
cloudbees-folder:6.16
cobertura:1.17
code-coverage-api:2.0.4
command-launcher:1.6
credentials:2.6.2
credentials-binding:1.27
data-tables-api:1.11.3-4
disable-github-multibranch-status:1.2
display-url-api:2.3.5
docker-commons:1.17
docker-workflow:1.26
durable-task:493.v195aefbb0ff2
echarts-api:5.2.2-1
embeddable-build-status:2.0.3
favorite:2.3.3
font-awesome-api:5.15.4-1
forensics-api:1.6.0
git:4.10.0
git-client:3.10.0
git-server:1.10
github:1.34.1
github-api:1.133
github-autostatus:3.6.2
github-branch-source:2.11.3
github-checks:1.0.13
github-pr-comment-build:61.v49f749d31d98
google-oauth-plugin:1.0.6
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.28
jackson2-api:2.13.0-230.v59243c64b0a5
jacoco:3.3.0
jaxb:2.3.0.1
jdk-tool:1.5
jenkins-design-language:1.25.1
jira:3.6
jjwt-api:0.11.2-9.c8b45b8bb173
jquery-detached:1.2.1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.53
kubernetes:1.30.9
kubernetes-cli:1.10.3
kubernetes-client-api:5.4.1
kubernetes-credentials:0.9.0
lockable-resources:2.12
mailer:1.34
matrix-auth:2.6.8
matrix-project:1.19
mercurial:2.15
metrics:4.0.2.8
momentjs:1.1.1
oauth-credentials:0.5
oic-auth:1.8
okhttp-api:4.9.2-20211102
pipeline-aggregator-view:1.11
pipeline-build-step:2.15
pipeline-graph-analysis:1.11
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.2
pipeline-model-definition:1.9.2
pipeline-model-extensions:1.9.2
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.9.2
pipeline-stage-view:2.19
pipeline-utility-steps:2.10.0
plain-credentials:1.7
plugin-util-api:2.5.1
popper-api:1.16.1-2
popper2-api:2.10.2-1
powershell:1.7
pubsub-light:1.16
scm-api:2.6.5
scm-filter-branch-pr:0.5.1
script-security:1.78
snakeyaml-api:1.29.1
sse-gateway:1.24
ssh-credentials:1.19
sshd:3.1.0
structs:1.23
thinBackup:1.10
token-macro:267.vcdaea6462991
trilead-api:1.0.13
variant:1.4
workflow-aggregator:2.6
workflow-api:2.47
workflow-basic-steps:2.24
workflow-cps:2633.v6baeedc13805
workflow-cps-global-lib:548.v9085a486966a
workflow-durable-task-step:1097.veac1aacfbda8
workflow-job:2.42
workflow-multibranch:2.26
workflow-scm-step:2.13
workflow-step-api:2.24
workflow-support:3.8
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Linux

Reproduction steps

  • Setting "Publish unstable builds as neutral status checks" checked
  • Setting "Skip GitHub Branch Source notifications" checked
  • Other settings unchecked
  • Add a step with warnError in jenkinsfile

Results

Expected result:

Expect Github PR status to be green (with a warning)

Actual result:

Github PR status is orange (pending)

Unchecking "Publish unstable builds as neutral status checks" gives the same result.

Bug - Checks containing a lot of logs/data are not sent to GitHub

Problem

Since 1.10 https://github.com/jenkinsci/github-checks-plugin/pull/101/files the plugin errors out if the check payload is too large. I am assuming that prior to 1.10 GitHub would reject the request on their side.

Unfortunately, some of our checks contain a massive amount of logs which means that the checks will never be sent to GitHub. This is an issue for us as it may prevent people from merging to a protected branch. Our workaround is to only depend on the main GitHub check (not published by this plugin) that does not contain any logs.

Expected behavior

A truncated version is sent to GitHub. Alternatively, skip all logs altogether, but it would be nice to keep it the payload is under 65335 bytes.

Actual behavior

The check result is not posted to GitHub.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/cd.yaml
  • jenkins-infra/github-reusable-workflows v1
.github/workflows/maven.yml
  • actions/checkout v4
  • actions/setup-java v4
  • codecov/codecov-action v4
.github/workflows/release-drafter.yml
  • release-drafter/release-drafter v6
maven
.mvn/extensions.xml
  • io.jenkins.tools.incrementals:git-changelist-maven-extension 1.8
pom.xml
  • org.jenkins-ci.plugins:plugin 4.82
  • io.jenkins.tools.bom:bom-2.361.x 2102.v854b_fec19c92
  • org.assertj:assertj-core 3.25.3
  • com.github.tomakehurst:wiremock-jre8-standalone 3.0.1

  • Check this box to trigger a request for Renovate to run again on this repository

"Status Checks Properties" becomes necessary in 1.0.6

Previously, our multibranch pipeline jobs automatically reported the "Jenkins" status check for any jobs using the GitHub App authentication. Starting from 1.0.6 (which we installed on Monday), this behavior stopped, and the workaround is to explicitly add the "Status Checks Properties" section to the multibranch pipeline job configuration.

I would not expect this to be necessary given that it uses the default values (with "Skip publishing status checks" unchecked and the status checks name of "Jenkins").

Cannot set `GitSCMStatusChecksExtension` when `GitSCMChecksContext` uses `BuildData`

Description

Default checks are published to GitHub with the name Jenkins when no SCM is configured on the job (CpsFlowDefinition). A valid GitSCMChecksContext is created because the build contains a valid hudson.plugins.git.util.BuildData object.

That is awesome, however, it is not currently possible to skip that check or to configure the name.

Steps to reproduce

  1. Create a new pipeline job
  2. Use the following pipeline script
  3. Run the job
#!/usr/bin/groovy

node {
    stage ('checkout') {
        checkout scm: [
            $class: 'GitSCM',
            branches: [[name: "*/master"]],
            extensions: [
                [$class: 'CleanBeforeCheckout'],
                [$class: 'GitSCMStatusChecksExtension', name: 'Custom Name', skip: false]
            ],
            userRemoteConfigs: [[credentialsId: 'your-github-app-credential', url: 'https://github.com/user/repo.git']]
        ]
    }
}

Current behaviour

[...]
Fetching changes from the remote Git repository
[...]
[GitHub Checks] GitHub check (name: Jenkins, status: IN_PROGRESS) has been published.

Expected behaviour

[...]
Fetching changes from the remote Git repository
[...]
[GitHub Checks] GitHub check (name: Custom Name, status: IN_PROGRESS) has been published.

Implementation suggestion

I am not sure I know where to start with this issue. The configuration are retrieved in BuildStatusChecksPublisher. They could try to retrieve some config persisted in the Run object (like BuildData) to know the check property. At the moment, GitSCMStatusChecksExtension is not persisted in the Run.

Re-enable integrations tests

What feature do you want to see added?

Tests were removed in #307 to unblock refreshing the dependencies.

The test framework that was in use before was coming from plugin-util-api dependency, it moved to junit5 which prevented updating the dependencies further till that was solved.

Potential options:

  • Upgrade tests to junit5
  • Switch from plugin-util-api test framework to JTH

I briefly looked at upgrading to junit5.
It requires all the junit4 rules to be adapted to junit5, e.g. parameterized, wiremock, probably others

Upstream changes

No response

Log spam `Pull request … : Not mergeable` from `BuildStatusChecksPublisher$ChecksGraphListener`

Jenkins and plugins versions report

github-checks 1.0.13 running on Jenkins 2.319.3 (as CloudBees CI), with checks-api 1.7.2 & github-branch-source 2.11.4.

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

Linux

Reproduction steps

Not known exactly; presumably some pull requests with merge conflicts, on a multibranch pipeline using PR-merge strategy.

Expected Results

Nothing in the controller log, or at most a single-line notice.

Actual Results

Numerous stack traces of the form

WARNING	o.j.p.w.cps.CpsFlowExecution#notifyListeners
hudson.AbortException: Pull request … : Not mergeable at …+… (NOT_MERGEABLE)
	at org.jenkinsci.plugins.github_branch_source.PullRequestSCMRevision.validateMergeHash(PullRequestSCMRevision.java:116)
	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1697)
	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
	at io.jenkins.plugins.checks.github.SCMFacade.findRevision(SCMFacade.java:156)
Caused: java.lang.IllegalStateException: Could not fetch revision from repository: … and branch: PR-…
	at io.jenkins.plugins.checks.github.SCMFacade.findRevision(SCMFacade.java:159)
	at io.jenkins.plugins.checks.github.GitHubSCMSourceChecksContext.resolveHeadSha(GitHubSCMSourceChecksContext.java:131)
	at io.jenkins.plugins.checks.github.GitHubSCMSourceChecksContext.<init>(GitHubSCMSourceChecksContext.java:46)
	at io.jenkins.plugins.checks.github.GitHubSCMSourceChecksContext.fromRun(GitHubSCMSourceChecksContext.java:24)
	at io.jenkins.plugins.checks.github.GitHubChecksPublisherFactory.createPublisher(GitHubChecksPublisherFactory.java:48)
	at io.jenkins.plugins.checks.api.ChecksPublisherFactory.lambda$fromRun$0(ChecksPublisherFactory.java:89)
	at …
	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:531)
	at io.jenkins.plugins.checks.api.ChecksPublisherFactory.fromRun(ChecksPublisherFactory.java:92)
	at io.jenkins.plugins.checks.api.ChecksPublisherFactory.fromRun(ChecksPublisherFactory.java:69)
	at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher$ChecksGraphListener.lambda$onNewHead$0(BuildStatusChecksPublisher.java:257)
	at java.util.Optional.ifPresent(Optional.java:159)
	at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher$ChecksGraphListener.onNewHead(BuildStatusChecksPublisher.java:257)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1473)
	at …

Anything else?

No response

The plugin is not usable with GitHub Enterprise

Hello, everyone!

Thanks for the work that you are doing on the plugin! We are using Jenkins in an enterprise environment, where there is a Enterprise GitHub installation running.

It would be very nice to use this plugin with the installation that we have, but, as of now, that doesn't work, unfortunately.

With the current implementation, the plugin checks for the validity of the GH URL, validating the submitted string as follows:

private boolean isValidUrl(@CheckForNull final String remoteUrl) {
return StringUtils.startsWith(remoteUrl, GIT_PROTOCOL)
|| StringUtils.startsWith(remoteUrl, HTTPS_PROTOCOL);

The values of the GIT_PROTOCOL and HTTPS_PROTOCOL constants are as follows:

private static final String GIT_PROTOCOL = "[email protected]:";
private static final String HTTPS_PROTOCOL = "https://github.com/";

This means that anything having its hostname different from github.com would not pass this check, and thus the results will not be published, which is what we see:

[GitHub Checks] Causes for no suitable publisher found: 
[GitHub Checks] Trying to resolve checks parameters from Git SCM...
[GitHub Checks] No supported GitSCM repository URL: https://github.<some>.<custom>.<domain>/<org>/<repo>

At the same time, the multibranch pipelines are able to push GH statuses back to our installation.

Could you have a look at this, please, and let me know if any additional information is needed?

Thanks!

`java.util.UnknownFormatConversionException: Conversion = ';'` from GitHubChecksPublisher.publish

Seen in https://ci.jenkins.io/job/Plugins/job/jjwt-api-plugin/job/PR-21/1/console building jenkinsci/jjwt-api-plugin#21:

 ​[GitHub Checks] GitHub check (name: Jenkins, status: COMPLETED) has been published
 ​java.util.UnknownFormatConversionException: Conversion = ';
 ​	at java.base/java.util.Formatter.checkText(Formatter.java:2732
 ​	at java.base/java.util.Formatter.parse(Formatter.java:2718
 ​	at java.base/java.util.Formatter.format(Formatter.java:2655
 ​	at java.base/java.util.Formatter.format(Formatter.java:2609
 ​	at java.base/java.lang.String.format(String.java:2897
 ​	at io.jenkins.plugins.util.PluginLogger.log(PluginLogger.java:47
 ​	at io.jenkins.plugins.checks.github.GitHubChecksPublisher.publish(GitHubChecksPublisher.java:92
 ​	at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher.publish(BuildStatusChecksPublisher.java:63
 ​	at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher.access$000(BuildStatusChecksPublisher.java:42
 ​	at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher$JobCheckoutListener.lambda$onCheckout$0(BuildStatusChecksPublisher.java:174
 ​	at java.base/java.util.Optional.ifPresent(Optional.java:183
 ​	at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher$JobCheckoutListener.onCheckout(BuildStatusChecksPublisher.java:174
 ​	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:150
 ​	at …

Using environment variable for status checks name

What feature do you want to see added?

Utilizing the environment variable for the status checks name field would be desirable. Our present workflow employs a single Jenkins job to construct several platforms for an identical commit hash. Is there a means to configure the plugin to adopt unique check names?

Upstream changes

No response

GitHub Checks is spamming the logs

Jenkins and plugins versions report

Environment
Jenkins: 2.401.1
OS: Linux - 4.18.0-477.13.1.el8_8.x86_64
Java: 11.0.19 - Red Hat, Inc. (OpenJDK 64-Bit Server VM)
---
Office-365-Connector:4.18.0
PrioritySorter:5.0.0
analysis-model-api:11.3.0
ansicolor:1.0.2
ant:487.vd79d090d4ea_e
antisamy-markup-formatter:159.v25b_c67cd35fb_
apache-httpcomponents-client-4-api:4.5.14-150.v7a_b_9d17134a_5
apache-httpcomponents-client-5-api:5.2.1-1.0
artifactory:3.18.4
audit-trail:333.vb_e1b_b_0f1238c
authentication-tokens:1.53.v1c90fd9191a_b_
azure-ad:349.vc02b_a_0b_142a_8
azure-artifact-manager:115.vb0d5da76bb49
azure-credentials:254.v64da_8176c83a
azure-keyvault:200.v115e9b_1644d5
azure-sdk:132.v62b_48eb_6f32f
basic-branch-build-strategies:71.vc1421f89888e
blueocean:1.27.4
blueocean-bitbucket-pipeline:1.27.4
blueocean-commons:1.27.4
blueocean-config:1.27.4
blueocean-core-js:1.27.4
blueocean-dashboard:1.27.4
blueocean-display-url:2.4.2
blueocean-events:1.27.4
blueocean-git-pipeline:1.27.4
blueocean-github-pipeline:1.27.4
blueocean-i18n:1.27.4
blueocean-jwt:1.27.4
blueocean-personalization:1.27.4
blueocean-pipeline-api-impl:1.27.4
blueocean-pipeline-editor:1.27.4
blueocean-pipeline-scm-api:1.27.4
blueocean-rest:1.27.4
blueocean-rest-impl:1.27.4
blueocean-web:1.27.4
bootstrap5-api:5.3.0-1
bouncycastle-api:2.28
branch-api:2.1109.vdf225489a_16d
build-blocker-plugin:1.7.8
build-discarder:139.v05696a_7fe240
build-monitor-plugin:1.14-717.v3efcdffe8d58
build-user-vars-plugin:1.9
build-with-parameters:76.v9382db_f78962
built-on-column:1.4
caffeine-api:3.1.6-115.vb_8b_b_328e59d8
checks-api:2.0.0
chucknorris:1.4
cloud-stats:267.v577e3742c282
cloudbees-bitbucket-branch-source:809.vc1d904b_30426
cloudbees-disk-usage-simple:182.v62ca_0c992a_f3
cloudbees-folder:6.815.v0dd5a_cb_40e0e
code-coverage-api:4.7.0
command-launcher:100.v2f6722292ee8
commons-httpclient3-api:3.1-3
commons-lang3-api:3.12.0-36.vd97de6465d5b_
commons-text-api:1.10.0-36.vc008c8fcda_7b_
conditional-buildstep:1.4.2
config-file-provider:938.ve2b_8a_591c596
confluence-publisher:156.vf3597ca_9cf27
copyartifact:705.v5295cffec284
credentials:1254.vb_96f366e7b_a_d
credentials-binding:604.vb_64480b_c56ca_
custom-folder-icon:2.8
dark-theme:336.v02165cd8c2ee
dashboard-view:2.487.vcf0ff9008a_c0
data-tables-api:1.13.4-3
dependency-check-jenkins-plugin:5.4.0
dependency-track:4.3.1
disable-github-multibranch-status:1.2
display-url-api:2.3.7
docker-commons:419.v8e3cd84ef49c
docker-java-api:3.3.1-79.v20b_53427e041
docker-plugin:1.4
docker-workflow:563.vd5d2e5c4007f
dtkit-api:3.0.2
durable-task:507.v050055d0cb_dd
echarts-api:5.4.0-5
email-ext:2.99
emailext-template:1.5
envinject:2.901.v0038b_6471582
envinject-api:1.199.v3ce31253ed13
extended-choice-parameter:373.v1a_ecea_fdf2a_a_
extended-read-permission:53.v6499940139e5
external-monitor-job:206.v9a_94ff0b_4a_10
extra-columns:1.25
favorite:2.4.2
file-operations:131.v32b_e7824fe95
file-parameters:285.287.v4b_7b_29d3469d
font-awesome-api:6.4.0-1
forensics-api:2.3.0
git:5.1.0
git-client:4.4.0
git-forensics:2.0.0
github:1.37.1
github-api:1.314-431.v78d72a_3fe4c3
github-branch-source:1728.v859147241f49
github-checks:545.v79a_a_68b_ca_682
gradle:2.8
groovy:453.vcdb_a_c5c99890
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
htmlpublisher:1.31
http_request:1.17
instance-identity:173.va_37c494ec4e5
integrity-plugin:2.5
ionicons-api:56.v1b_1c8c49374e
jackson2-api:2.15.2-350.v0c2f3f8fc595
jacoco:3.3.3
jakarta-activation-api:2.0.1-3
jakarta-mail-api:2.0.1-3
javadoc:233.vdc1a_ec702cff
javax-activation-api:1.2.0-6
javax-mail-api:1.6.2-9
jaxb:2.3.8-1
jdk-tool:66.vd8fa_64ee91b_d
jenkins-design-language:1.27.4
jersey2-api:2.39.1-2
jira:3.10
jjwt-api:0.11.5-77.v646c772fddb_0
jnr-posix-api:3.1.17-1
job-restrictions:0.8
jobConfigHistory:1212.vd4470d08ff12
jquery:1.12.4-1
jquery3-api:3.7.0-1
jsch:0.2.8-65.v052c39de79b_2
junit:1214.va_2f9db_3e6de0
ldap:682.v7b_544c9d1512
leastload:3.0.0
list-git-branches-parameter:0.0.13
locale:314.v22ce953dfe9e
localization-support:1.2
lockable-resources:1172.v4b_8fc8eed570
mailer:457.v3f72cb_e015e5
mask-passwords:150.vf80d33113e80
material-theme:0.5.2-rc100.6121925fe229
matlab:2.10.0
matrix-auth:3.1.8
matrix-project:789.v57a_725b_63c79
maven-plugin:3.22
metrics:4.2.18-439.v86a_20b_a_8318b_
mina-sshd-api-common:2.10.0-69.v28e3e36d18eb_
mina-sshd-api-core:2.10.0-69.v28e3e36d18eb_
monitoring:1.94.1
msbuild:1.30
next-executions:179.vb_e011d7e3b_64
nodejs:1.6.0
nuget:1.1
okhttp-api:4.11.0-145.vcb_8de402ef81
parameterized-scheduler:1.2
parameterized-trigger:2.45
parasoft-findings:10.6.2
pipeline-build-step:496.v2449a_9a_221f2
pipeline-github:2.8-147.3206e8179b1c
pipeline-graph-analysis:202.va_d268e64deb_3
pipeline-graph-view:191.vc6da_9d3eb_70a
pipeline-groovy-lib:656.va_a_ceeb_6ffb_f7
pipeline-input-step:468.va_5db_051498a_4
pipeline-milestone-step:111.v449306f708b_7
pipeline-model-api:2.2141.v5402e818a_779
pipeline-model-definition:2.2141.v5402e818a_779
pipeline-model-extensions:2.2141.v5402e818a_779
pipeline-rest-api:2.33
pipeline-stage-step:305.ve96d0205c1c6
pipeline-stage-tags-metadata:2.2141.v5402e818a_779
pipeline-stage-view:2.33
pipeline-utility-steps:2.15.4
plain-credentials:143.v1b_df8b_d3b_e48
plot:2.1.12
plugin-usage-plugin:4.0
plugin-util-api:3.3.0
popper2-api:2.11.6-2
powershell:2.0
prism-api:1.29.0-7
pubsub-light:1.17
resource-disposer:0.22
robot:3.3.0
run-condition:1.5
scm-api:676.v886669a_199a_a_
script-security:1251.vfe552ed55f8d
simple-theme-plugin:160.vb_76454b_67900
snakeyaml-api:1.33-95.va_b_a_e3e47b_fa_4
solarized-theme:0.1
sonar:2.15
splunk-devops:1.10.1
sse-gateway:1.26
ssh-agent:333.v878b_53c89511
ssh-credentials:305.v8f4381501156
ssh-slaves:2.877.v365f5eb_a_b_eec
ssh-steps:2.0.65.vd26b_5b_9b_de4d
sshd:3.303.vefc7119b_ec23
structs:324.va_f5d6774f3a_d
synopsys-coverity:3.0.3
theme-manager:193.vcef22f6c5f2b_
thinBackup:1.17
timestamper:1.25
token-macro:359.vb_cde11682e0c
trilead-api:2.84.v72119de229b_7
uipath-automation-package:3.0
uno-choice:2.6.5
variant:59.vf075fe829ccb
versioncolumn:162.v85841b_0790d5
warnings-ng:10.2.0
windows-azure-storage:386.v673495b0a5de
workflow-aggregator:596.v8c21c963d92d
workflow-api:1215.v2b_ee3e1b_dd39
workflow-basic-steps:1017.vb_45b_302f0cea_
workflow-cps:3691.v28b_14c465a_b_b_
workflow-durable-task-step:1247.v7f9dfea_b_4fd0
workflow-job:1308.v58d48a_763b_31
workflow-multibranch:756.v891d88f2cd46
workflow-scm-step:415.v434365564324
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:839.v35e2736cfd5c
ws-cleanup:0.45
xunit:3.1.2

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

RHEL 8

Reproduction steps

  1. Setup a job that uses GitHub Branch Source
  2. Use normal GitHub Tokens (not App credentials)
  3. Do not configure any checks -> use the default config
  4. Run the job

Expected Results

Nothing should happen

Actual Results

The build pipeline reads this warning multiple times:
org.kohsuke.github.HttpException: {"message":"You must authenticate via a GitHub App.","documentation_url":"https://docs.github.com/rest/reference/checks#create-a-check-run"}

This already confuses our users. But whats worse: The Jenkins console log is spammed HEAVILY. Every time we see this message (which is atleast 3 times per build), it throws an exception:

Jul 07 09:00:43 jenkins[3283414]: org.kohsuke.github.HttpException: {"message":"You must authenticate via a GitHub App.","documentation_url":"https://docs.github.com/rest/reference/checks#create-a-check-run"}
Jul 07 09:00:43 jenkins[3283414]:         at org.kohsuke.github.GitHubConnectorResponseErrorHandler$1.onError(GitHubConnectorResponseErrorHandler.java:62)
Jul 07 09:00:43 jenkins[3283414]:         at org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:473)
Jul 07 09:00:43 jenkins[3283414]:         at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:435)
Jul 07 09:00:43 jenkins[3283414]:         at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:403)
Jul 07 09:00:43 jenkins[3283414]:         at org.kohsuke.github.Requester.fetch(Requester.java:85)
Jul 07 09:00:43 jenkins[3283414]:         at org.kohsuke.github.GHCheckRunBuilder.create(GHCheckRunBuilder.java:232)
Jul 07 09:00:43 jenkins[3283414]:         at io.jenkins.plugins.checks.github.GitHubChecksPublisher.publish(GitHubChecksPublisher.java:85)
Jul 07 09:00:43 jenkins[3283414]:         at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher.publish(BuildStatusChecksPublisher.java:64)
Jul 07 09:00:43 jenkins[3283414]:         at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher$ChecksGraphListener.lambda$onNewHead$0(BuildStatusChecksPublisher.java:244)
Jul 07 09:00:43 jenkins[3283414]:         at java.base/java.util.Optional.ifPresent(Optional.java:183)
Jul 07 09:00:43 jenkins[3283414]:         at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher$ChecksGraphListener.onNewHead(BuildStatusChecksPublisher.java:244)
Jul 07 09:00:43 jenkins[3283414]:         at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1587)
Jul 07 09:00:43 jenkins[3283414]:         at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:509)
Jul 07 09:00:43 jenkins[3283414]:         at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38)
Jul 07 09:00:43 jenkins[3283414]:         at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
Jul 07 09:00:43 jenkins[3283414]:         at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
Jul 07 09:00:43 jenkins[3283414]:         at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
Jul 07 09:00:43 jenkins[3283414]:         at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51)
Jul 07 09:00:43 jenkins[3283414]:         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
Jul 07 09:00:43 jenkins[3283414]:         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
Jul 07 09:00:43 jenkins[3283414]:         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
Jul 07 09:00:43 jenkins[3283414]:         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
Jul 07 09:00:43 jenkins[3283414]:         at java.base/java.lang.Thread.run(Thread.java:829)

It started on the 25th of May (last release) and now we get up to 5.000 Exceptions per hour and over 1 million per month. Since this logs at the WARNING level, it also overshadows other important messages.

Anything else?

It would be nice if the checks were not published automatically for all jobs but that the default is that no checks are published and only if a user configures the build behaviour to publish them, they are published.

Validation Failed - invalid annotations

I did this commit: timja-org/codingstyle@f779380

and in the server log I have:
We probably need to log the annotation as well?

org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/timja-org/codingstyle/check-runs {"message":"Validation Failed","errors":[{"resource":"CheckRun","code":"invalid","field":"annotations"}],"documentation_url":"https://docs.github.com/rest/reference/checks#create-a-check-run"}
	at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:493)
	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:421)
	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:364)
	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:61)
	at io.jenkins.plugins.analysis.core.steps.WarningChecksPublisher.publishChecks(WarningChecksPublisher.java:55)
	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.publishResult(IssuesRecorder.java:725)
	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:651)
	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:617)
	at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:1024)
	at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:985)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/timja-org/codingstyle/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:321)
	at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:86)
	at org.kohsuke.github.Requester.lambda$fetch$1(Requester.java:74)
	at org.kohsuke.github.GitHubClient.createResponse(GitHubClient.java:462)
	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:413)
	... 17 more

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

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)

Unable to re-request Github check via Github following upgrade from 1.0.16 to 1.0.18

Jenkins and plugins versions report

Environment
Jenkins: 2.332.1
OS: Linux - 4.15.0-166-generic
---
ace-editor:1.1
active-directory:2.25.1
amazon-ecr:1.7
analysis-model-api:10.9.3
antisamy-markup-formatter:2.7
apache-httpcomponents-client-4-api:4.5.13-1.0
authentication-tokens:1.4
aws-credentials:191.vcb_f183ce58b_9
aws-java-sdk:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-cloudformation:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-codebuild:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-ec2:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-ecr:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-ecs:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-elasticbeanstalk:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-iam:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-logs:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-minimal:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-ssm:1.12.163-315.v2b_716ec8e4df
basic-branch-build-strategies:1.3.2
blueocean:1.25.3
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.25.3
blueocean-commons:1.25.3
blueocean-config:1.25.3
blueocean-core-js:1.25.3
blueocean-dashboard:1.25.3
blueocean-display-url:2.4.1
blueocean-events:1.25.3
blueocean-git-pipeline:1.25.3
blueocean-github-pipeline:1.25.3
blueocean-i18n:1.25.3
blueocean-jira:1.25.3
blueocean-jwt:1.25.3
blueocean-personalization:1.25.3
blueocean-pipeline-api-impl:1.25.3
blueocean-pipeline-editor:1.25.3
blueocean-pipeline-scm-api:1.25.3
blueocean-rest:1.25.3
blueocean-rest-impl:1.25.3
blueocean-web:1.25.3
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-6
bouncycastle-api:2.25
branch-api:2.7.0
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-bitbucket-branch-source:757.vddedc5f2589a_
cloudbees-folder:6.708.ve61636eb_65a_5
cobertura:1.17
code-coverage-api:2.0.4
command-launcher:1.6
configuration-as-code:1414.v878271fc496f
copyartifact:1.46.3
credentials:1074.v60e6c29b_b_44b_
credentials-binding:1.27.1
dark-theme:156.v6cf16af6f9ef
data-tables-api:1.11.4-3
display-url-api:2.3.5
docker-commons:1.19
docker-workflow:1.28
durable-task:493.v195aefbb0ff2
ec2:1.68
echarts-api:5.3.0-2
email-ext:2.87
envinject-api:1.180.v98d833b_27470
favorite:2.4.1
file-operations:1.11
font-awesome-api:6.0.0-1
forensics-api:1.12.0
git:4.10.3
git-client:3.11.0
git-server:1.10
github:1.34.3
github-api:1.301-378.v9807bd746da5
github-branch-source:1583.v18d333ef7379
github-checks:1.0.18
github-pr-comment-build:61.v49f749d31d98
github-scm-trait-notification-context:1.1
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.29
http_request:1.14
jackson2-api:2.13.2-260.v43d711474c77
javadoc:217.v905b_86277a_2a_
javax-activation-api:1.2.0-2
javax-mail-api:1.6.2-5
jaxb:2.3.0.1
jdk-tool:1.5
jenkins-design-language:1.25.3
jersey2-api:2.35-4
jira:3.7
jira-steps:1.6.0
jjwt-api:0.11.2-9.c8b45b8bb173
job-dsl:1.78.3
jquery-detached:1.2.1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.56
lockable-resources:2.14
mailer:408.vd726a_1130320
matrix-auth:3.1
matrix-project:758.v7a_ea_491852f3
maven-plugin:3.18
mercurial:2.16
momentjs:1.1.1
monitoring:1.90.0
multibranch-build-strategy-extension:1.0.10
node-iterator-api:1.5.1
okhttp-api:4.9.3-105.vb96869f8ac3a
permissive-script-security:0.7
pipeline-build-step:2.16
pipeline-github:2.8-138.d766e30bb08b
pipeline-githubnotify-step:49.vf37bf92d2bc8
pipeline-graph-analysis:188.v3a01e7973f2c
pipeline-input-step:446.vf27b_0b_83500e
pipeline-milestone-step:100.v60a_03cd446e1
pipeline-model-api:2.2064.v5eef7d0982b_e
pipeline-model-definition:2.2064.v5eef7d0982b_e
pipeline-model-extensions:2.2064.v5eef7d0982b_e
pipeline-rest-api:2.23
pipeline-stage-step:291.vf0a8a7aeeb50
pipeline-stage-tags-metadata:2.2064.v5eef7d0982b_e
pipeline-stage-view:2.23
pipeline-utility-steps:2.12.0
plain-credentials:1.8
plugin-util-api:2.14.0
popper-api:1.16.1-2
popper2-api:2.11.2-1
prism-api:1.26.0-2
pubsub-light:1.16
resource-disposer:0.17
s3:0.12.1
scm-api:595.vd5a_df5eb_0e39
scm-filter-branch-pr:0.5.1
script-security:1140.vf967fb_efa_55a_
skip-notifications-trait:1.0.5
snakeyaml-api:1.29.1
solarized-theme:0.1
sse-gateway:1.25
ssh-agent:1.24.1
ssh-credentials:1.19
sshd:3.1.0
structs:308.v852b473a2b8c
swarm:3.31
theme-manager:0.6
timestamper:1.17
token-macro:280.v97a_82642793c
trilead-api:1.0.13
urltrigger:1.02
variant:1.4
warnings-ng:9.11.1
workflow-aggregator:2.7
workflow-api:1143.v2d42f1e9dea_5
workflow-basic-steps:941.vdfe1b_a_132c64
workflow-cps:2660.vb_c0412dc4e6d
workflow-cps-global-lib:564.ve62a_4eb_b_e039
workflow-durable-task-step:1121.va_65b_d2701486
workflow-job:1174.vdcb_d054cf74a_
workflow-multibranch:711.vdfef37cda_816
workflow-scm-step:2.13
workflow-step-api:622.vb_8e7c15b_c95a_
workflow-support:815.vd60466279fc8
ws-cleanup:0.40
xtrigger-api:0.4

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

Controller is running Ubuntu Linux 18.04.
Github is GitHub Enterprise Server 3.2.6.

Reproduction steps

  1. Have an integration between Jenkins (checks plugin 1.0.16) and Github with checks running
  2. Create a PR, where the check run has failed and been reported as such
  3. Upgrade Jenkins (including checks plugin to 1.0.18)
  4. From the above PR in Github, request that the failed check run is re-run

Expected Results

The check run is re-executed by Jenkins.

Actual Results

No check run is executed by Jenkins.

Anything else?

This appears to have been caused by this change: c686ef4

The "external_id" format used has changed from Jenkins "Job" to Jenkins "Run", in the case of "stale" external_id references in Github, older "Job" ID format is not accepted and generates the exception shown below:

INFO i.j.p.c.g.CheckRunGHEventSubscriber#onEvent: Received rerun request through GitHub checks API.
SEVERE o.j.p.g.e.GHEventsSubscriber$4#applyNullSafe: Subscriber io.jenkins.plugins.checks.github.CheckRunGHEventSubscriber failed to process SCMEvent{type=UPDATED, <<<REDACTED>>>} hook, skipping...
java.lang.IllegalArgumentException: Invalid id
at hudson.model.Run.fromExternalizableId(Run.java:2477)
at io.jenkins.plugins.util.JenkinsFacade.getBuild(JenkinsFacade.java:225)
at io.jenkins.plugins.checks.github.CheckRunGHEventSubscriber.scheduleRerun(CheckRunGHEventSubscriber.java:108)
at io.jenkins.plugins.checks.github.CheckRunGHEventSubscriber.onEvent(CheckRunGHEventSubscriber.java:97)
at org.jenkinsci.plugins.github.extension.GHEventsSubscriber$4.applyNullSafe(GHEventsSubscriber.java:241)
at org.jenkinsci.plugins.github.extension.GHEventsSubscriber$4.applyNullSafe(GHEventsSubscriber.java:237)
at org.jenkinsci.plugins.github.util.misc.NullSafeFunction.apply(NullSafeFunction.java:18)
at com.google.common.collect.Iterators$6.transform(Iterators.java:826)
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:52)
at com.google.common.collect.Iterators.addAll(Iterators.java:367)
at com.google.common.collect.Lists.newArrayList(Lists.java:147)
at com.google.common.collect.Lists.newArrayList(Lists.java:133)
at org.jenkinsci.plugins.github.util.FluentIterableWrapper.toList(FluentIterableWrapper.java:148)
at com.cloudbees.jenkins.GitHubWebHook.doIndex(GitHubWebHook.java:124)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:398)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:410)
at org.jenkinsci.plugins.github.webhook.RequirePostWithGHHookPayload$Processor.invoke(RequirePostWithGHHookPayload.java:80)
at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:208)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:141)
at org.kohsuke.stapler.IndexDispatcher.dispatch(IndexDispatcher.java:28)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:475)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:694)
at org.kohsuke.stapler.Stapler.service(Stapler.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1626)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:157)
at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:248)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:81)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:129)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:60)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:239)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:215)
at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:88)
at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:121)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:160)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at com.cloudbees.jenkins.GitHubWebHookCrumbExclusion.process(GitHubWebHookCrumbExclusion.java:29)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:128)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:94)
at jenkins.security.AcegiSecurityExceptionFilter.doFilter(AcegiSecurityExceptionFilter.java:52)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:54)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:136)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:93)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:219)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:213)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:97)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:63)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:111)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:172)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:53)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:86)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:386)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
at java.base/java.lang.Thread.run(Thread.java:829)

Re-running Checks Programmatically

Hello,

I am using this plugin and have no trouble re-running a check through the "Rerun" button that's found on the GitHub API. However, I've attempted to do this programmatically via the Octokit APIs by sending a request like so:

const response = await octokit.checks.rerequestSuite({
        owner: org,
        repo: repoName,
        check_suite_id: suite.id
      });

where suite.id is the value for this plugin. This returns a 201 response and the status is changed to queued. From there, nothing changes in the GitHub checks UI and the status is never changed to in_progress or similar. Is this not supported, or is this a configuration issue on our end? We have the app set up with events for check_suite and check_run.

Any help is appreciated!
Thanks,

Joe

Skip status checks on Pipeline Libraries

Hello,

Thanks for this really useful plugin! It appears it is not currently possible to skip status checks on Pipeline Libraries, is anyone else having a similar issue?

On a multibranch pipeline job or a folder try to add pipeline library with a GitHub repository. One cannot add "Status Checks Properties" in its Behavior section. Unfortunately, the library repository's commits are getting hit by every check.

Jenkins version: 2.263.2
GitHub Checks plugin version: 1.0.9

Multiple builds on a PR fails to update final status

I have noticed that when multiple commits are made to a PR and then multiple builds in Jenkins are then ran for those commits, that the final Jenkins check status does not get updated and stays stuck in the "Queued" state. In this case, each build is failing due to a legitimate lint failure. Looking at the build logs, I can see that it appears to be publishing the updates, but looking at the PR in github, the check status never gets updated.

11:01:09  [GitHub Checks] GitHub check (name: Jenkins, status: IN_PROGRESS) has been published.
...
11:01:43  [GitHub Checks] GitHub check (name: Jenkins, status: IN_PROGRESS) has been published.
...
11:02:01  [GitHub Checks] GitHub check (name: Jenkins, status: IN_PROGRESS) has been published.
...
11:02:43  [GitHub Checks] GitHub check (name: Jenkins, status: COMPLETED) has been published.

Screenshot-20200910110822-699x218

Screenshot-20200910110805-587x241

This is testing on an internal repo, so I cannot share links to it directly.

GitHub Check does not get updated/dismissed after rebuild

Reporting on behalf of @jglick , the issue appears on ci.jenkins.io after deploying the plugin. Reporting to this plugin, because "dismiss" functionality is unlikely common. Feel free to move to checks API>

https://github.com/jenkinsci/suppress-stack-trace-plugin/pull/5/checks?check_run_id=950988935 was reported for https://ci.jenkins.io/job/Plugins/job/suppress-stack-trace-plugin/job/PR-5/1/ which is indeed failed. After that, https://ci.jenkins.io/job/Plugins/job/suppress-stack-trace-plugin/job/PR-5/2/ succeeded, yet the check status was not updated.

image

When multiple builds are enabled for a single commit, GH checks get overwritten by the latest to finish

Jenkins and plugins versions report

Environment
Jenkins: 2.332.3
OS: Linux - 5.11.0-1022-gcp
---
ace-editor:1.1
analysis-model-api:10.10.1
ansible:1.1
ansicolor:1.0.1
ant:475.vf34069fef73c
antisamy-markup-formatter:2.7
apache-httpcomponents-client-4-api:4.5.13-1.0
artifactory:3.16.2
authentication-tokens:1.4
authorize-project:1.4.0
azure-commons:1.1.3
basic-branch-build-strategies:1.3.2
blueocean:1.25.5
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.25.5
blueocean-commons:1.25.5
blueocean-config:1.25.5
blueocean-core-js:1.25.5
blueocean-dashboard:1.25.5
blueocean-display-url:2.4.1
blueocean-events:1.25.5
blueocean-git-pipeline:1.25.5
blueocean-github-pipeline:1.25.5
blueocean-i18n:1.25.5
blueocean-jira:1.25.5
blueocean-jwt:1.25.5
blueocean-personalization:1.25.5
blueocean-pipeline-api-impl:1.25.5
blueocean-pipeline-editor:1.25.5
blueocean-pipeline-scm-api:1.25.5
blueocean-rest:1.25.5
blueocean-rest-impl:1.25.5
blueocean-web:1.25.5
bootstrap4-api:4.6.0-5
bootstrap5-api:5.1.3-7
bouncycastle-api:2.26
branch-api:2.1046.v0ca_37783ecc5
build-blocker-plugin:1.7.8
build-time-blame:64.vd8f4018a2bbe
build-user-vars-plugin:1.8
caffeine-api:2.9.3-65.v6a_47d0f4d1fe
checks-api:1.7.4
cloudbees-bitbucket-branch-source:773.v4b_9b_005b_562b_
cloudbees-disk-usage-simple:0.10
cloudbees-folder:6.729.v2b_9d1a_74d673
cobertura:1.17
code-coverage-api:2.0.4
command-launcher:84.v4a_97f2027398
conditional-buildstep:1.4.2
config-file-provider:3.10.0
convert-to-pipeline:1.0
cortex-metrics:1.0.1
couchdb-build-metadata:0.15.2
credentials:1087.1089.v2f1b_9a_b_040e4
credentials-binding:523.vd859a_4b_122e6
data-tables-api:1.11.4-4
declarative-pipeline-migration-assistant:1.5.2
declarative-pipeline-migration-assistant-api:1.5.2
disable-github-multibranch-status:1.2
display-url-api:2.3.6
docker-build-publish:1.3.3
docker-build-step:2.8
docker-commons:1.19
docker-slaves:1.0.7
docker-workflow:1.28
doclinks:0.6.1
durable-task:496.va67c6f9eefa7
echarts-api:5.3.2-3
email-ext:2.88
embeddable-build-status:2.0.3
envinject:2.866.v5c0403e3d4df
envinject-api:1.199.v3ce31253ed13
extended-choice-parameter:346.vd87693c5a_86c
extended-read-permission:3.2
external-monitor-job:191.v363d0d1efdf8
favorite:2.4.1
font-awesome-api:6.1.1-1
forensics-api:1.14.0
git:4.11.3
git-changelog:3.23
git-client:3.11.0
git-parameter:0.9.17
git-server:1.11
github:1.34.3
github-api:1.303-400.v35c2d8258028
github-branch-source:1637.vd833b_7ca_7654
github-checks:1.0.18
google-oauth-plugin:1.0.6
gradle:1.39.1
h2-api:1.4.199
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
hashicorp-vault-pipeline:1.3
hashicorp-vault-plugin:336.v182c0fbaaeb7
htmlpublisher:1.30
http_request:1.15
ivy:2.2
jackson2-api:2.13.3-285.vc03c0256d517
jacoco:3.3.2
javadoc:217.v905b_86277a_2a_
javax-activation-api:1.2.0-3
javax-mail-api:1.6.2-6
jaxb:2.3.6-1
jdk-tool:1.5
jenkins-design-language:1.25.5
jira:3.7.1
jjwt-api:0.11.5-77.v646c772fddb_0
jnr-posix-api:3.1.7-3
job-dsl:1.79
jquery:1.12.4-1
jquery-detached:1.2.1
jquery3-api:3.6.0-4
jsch:0.1.55.2
junit:1119.va_a_5e9068da_d7
kubernetes:3636.v84b_a_1dea_6240
kubernetes-cd:2.3.1
kubernetes-client-api:5.12.2-193.v26a_6078f65a_9
kubernetes-credentials:0.9.0
ldap:2.10
lockable-resources:2.15
mailer:414.vcc4c33714601
mapdb-api:1.0.9.0
matrix-auth:3.1.2
matrix-project:771.v574584b_39e60
maven-plugin:3.19
mercurial:2.16.2
metrics:4.1.6.2
momentjs:1.1.1
multibranch-build-strategy-extension:1.0.10
oauth-credentials:0.5
oic-auth:1.8
okhttp-api:4.9.3-105.vb96869f8ac3a
opentelemetry:2.7.1
packer:1.5
pam-auth:1.8
parameter-separator:1.3
parameterized-trigger:2.44
pipeline-build-step:2.18
pipeline-github-lib:38.v445716ea_edda_
pipeline-graph-analysis:195.v5812d95a_a_2f9
pipeline-groovy-lib:593.va_a_fc25d520e9
pipeline-input-step:448.v37cea_9a_10a_70
pipeline-maven:3.10.0
pipeline-milestone-step:101.vd572fef9d926
pipeline-model-api:2.2086.v12b_420f036e5
pipeline-model-definition:2.2086.v12b_420f036e5
pipeline-model-extensions:2.2086.v12b_420f036e5
pipeline-rest-api:2.24
pipeline-stage-step:293.v200037eefcd5
pipeline-stage-tags-metadata:2.2086.v12b_420f036e5
pipeline-stage-view:2.24
pipeline-utility-steps:2.12.2
plain-credentials:1.8
plugin-util-api:2.17.0
popper-api:1.16.1-3
popper2-api:2.11.5-2
prism-api:1.28.0-2
prometheus:20.0.11
pubsub-light:1.16
rebuild:1.34
resource-disposer:0.19
robot:3.2.0
run-condition:1.5
saml:2.298.vc7a_2b_3958628
sbt:1.5
scm-api:608.vfa_f971c5a_a_e9
scmskip:1.0.3
script-security:1175.v4b_d517d6db_f0
slack:608.v19e3b_44b_b_9ff
snakeyaml-api:1.30.1
sonar:2.14
sse-gateway:1.25
ssh-agent:295.v9ca_a_1c7cc3a_a_
ssh-credentials:277.v95c2fec1c047
sshd:3.237.v883d165a_c1d3
structs:318.va_f3ccb_729b_71
subversion:2.15.5
timestamper:1.17
token-macro:293.v283932a_0a_b_49
trilead-api:1.57.v6e90e07157e1
uno-choice:2.6.2
validating-string-parameter:2.8
variant:1.4
warnings-ng:9.12.0
windows-slaves:1.8.1
workflow-aggregator:581.v0c46fa_697ffd
workflow-api:1164.v760c223ddb_32
workflow-basic-steps:948.v2c72a_091b_b_68
workflow-cps:2725.v7b_c717eb_12ce
workflow-cps-global-lib:588.v576c103a_ff86
workflow-durable-task-step:1146.v1a_d2e603f929
workflow-job:1186.v8def1a_5f3944
workflow-multibranch:716.vc692a_e52371b_
workflow-scm-step:400.v6b_89a_1317c9a_
workflow-step-api:625.vd896b_f445a_f8
workflow-support:820.vd1a_6cc65ef33

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

Linux VM for controller and agents running in kubernetes.

Reproduction steps

  1. Configure a GitHub app for Jenkins and have it configured with multibranch repositories
  2. Configure multibranch repositories to build on branches and on PRs (useful for using a merging strategy and test the result of the merge), thus resulting in multiple builds reporting to a single commit.
  3. Enable Skip GitHub Branch Source notifications so we on get checks issued by github-checks-plugin in GitHub.

Expected Results

Different checks to be published in GitHub, one for the branch build and one for the PR build.

Actual Results

A single check is published under Jenkins (by default) which correspond to the last build finishing.

Anything else?

No response

skip github status checks through parameters in Jenkinsfile

Hello,

Thanks for the work on this plugin!

I wonder if it is possible to use configs/parameters in Jenkinsfile to skip github status publish. The use case is that we want to skip certain jobs' status reports but not every jobs. Seems Skip publishing status checks can be only applied on org configs.

How to use this with private repos?

When attempting to follow the documentation to setup the github branch source plugin to use app credentials instead of username/password (or token), private repos are not discovered so an app credential cannot be used.

There doesn't seem to be a way to manually specify the credential to use, if the discovered one is not an app credential

What am I missing here?

Configuration ignores app credential override

Jenkins and plugins versions report

Environment
Jenkins: 2.401.3
OS: Linux - 5.4.0-1093-aws
Java: 11.0.19 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)

github-checks:545.v79a_a_68b_ca_682

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

Ubuntu 18 for the agents and the controller

Reproduction steps

  1. Set up a job to use SSH credentials to pull from GitHub
  2. In the GitHub checks configuration, override the credentials to point to app credentials
  3. Stop a job while it's building
  4. After the first job failure all subsequent jobs fail to report the build result to GitHub with the error:
[GitHub Checks] Failed Publishing GitHub checks: java.io.IOException: Unsupported credential type: com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey

Which means it is ignoring the credential override after the first failure.

Expected Results

All jobs should be using the override for the credential id, instead of the credentials used to pull the code.

Actual Results

[GitHub Checks] Failed Publishing GitHub checks: java.io.IOException: Unsupported credential type: com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey

Presumably using the wrong credentials.

Anything else?

I suspect the problem started with https://github.com/jenkinsci/github-checks-plugin/pull/341/files
Specifically, I think findGitHubAppCredentials is returning the first credentials (SSH Key type) instead of the app credentials configured:

public Optional<StandardUsernameCredentials> findGitHubAppCredentials(final Job<?, ?> job, final String credentialsId) {

Having trouble customizing GitHub Checks page view

Summary

I'm new to Jenkins/CI and web/REST development in general, but I set up a multibranch pipeline project and a basic GH app connected to cmee to handle my webhooks.

I then installed the Checks API plugin along with the GitHub Checks plugin and I'm successfully seeing some output in my Checks view on GitHub:

Screenshot from 2021-10-26 16-38-29

Since then I've skimmed some GH App documentation and watched the final demo video but I'm having trouble figuring out how to customize this view. I see the "Consume API - Create Checks" section but I'm not sure where that code implementation would even go.

Is there a way to view the code that is being run in the background that's giving me this default view after installing the app?.

I'm also not sure if that's totally necessary or if I'm missing something simple to achieve a nicer looking checks page like this one:

Screenshot from 2021-10-26 16-59-16

Some specific examples of the improvements I'd like to have from the second screenshot are: clickable build steps that display some build log info instead of plain bullet points outlining my pipeline stages.

Pipeline defined here

My only theory is that maybe it doesn't handle the fact that each stage simply runs a shell script and so the nice features of the second screenshot aren't working; but I'm also unsure if those are supposed to work by default right after installing the plugin.

Cheers!

Head of build log is not useful in failures

Looks like https://ci.jenkins.io/job/Tools/job/bom/job/master/1751/ failed at the infrastructure level. Unfortunately https://plugins.jenkins.io/github-checks/ (unlike https://docs.cloudbees.com/docs/cloudbees-ci/latest/scm-integration/enabling-scm-reporting#_cloudbees_scm_reporting_feature_benefits) includes the head rather than the tail of a failed shell step’s log, which is usually useless, and does not link to the execution/node/*/log/ for the build-terminating error.

Originally posted by @jglick in jenkinsci/bom#2121 (comment)

github-checks-plugin enables status checks in Bitbucket Server repository

Version report

Jenkins and plugins versions report:

Jenkins: 2.303.1
OS: Windows Server 2012 R2 - 6.3
---
Office-365-Connector:4.15.0
ace-editor:1.1
analysis-model-api:10.3.0
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
atlassian-bitbucket-server-integration:3.0.0
authentication-tokens:1.4
authorize-project:1.4.0
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.1-1
bouncycastle-api:2.24
branch-api:2.6.5
build-monitor-plugin:1.12+build.201809061734
buildtriggerbadge:2.10
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-bitbucket-branch-source:2.9.11
cloudbees-disk-usage-simple:0.10
cloudbees-folder:6.16
command-launcher:1.2
compress-artifacts:1.10
configuration-as-code:1.53
copyartifact:1.46.2
credentials:2.6.1
credentials-binding:1.27
crowd2:2.0.2
custom-tools-plugin:0.8
data-tables-api:1.11.2-1
display-url-api:2.3.5
dtkit-api:3.0.0
durable-task:1.39
echarts-api:5.1.2-11
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-1
forensics-api:1.3.1
git:4.8.2
git-client:3.9.0
git-forensics:1.2.1
git-server:1.10
github:1.34.1
github-api:1.123
github-branch-source:2.11.2
github-checks:1.0.13
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
hudson-wsclean-plugin:1.0.8
jackson2-api:2.12.4
jdk-tool:1.0
jira:3.6
jjwt-api:0.11.2-9.c8b45b8bb173
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.11
mailer:1.34
matrix-auth:2.6.8
matrix-project:1.19
metrics:4.0.2.8
momentjs:1.1.1
mstest:1.0.0
next-build-number:1.6
nunit:0.27
okhttp-api:3.14.9
pipeline-build-step:2.15
pipeline-graph-analysis:1.11
pipeline-graph-view:46.vedbf23da719f
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.2
pipeline-model-definition:1.9.2
pipeline-model-extensions:1.9.2
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.9.2
pipeline-stage-view:2.19
pipeline-utility-steps:2.10.0
plain-credentials:1.7
plugin-util-api:2.4.0
popper-api:1.16.1-2
popper2-api:2.10.1-1
resource-disposer:0.16
role-strategy:3.2.0
scm-api:2.6.5
script-security:1.78
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.1.0
structs:1.23
timestamper:1.13
token-macro:266.v44a80cf277fd
trilead-api:1.0.13
variant:1.4
violation-comments-to-stash:1.127
vstestrunner:1.0.8
warnings-ng:9.5.0
windows-slaves:1.0
workflow-aggregator:2.6
workflow-api:2.46
workflow-basic-steps:2.24
workflow-cps:2.94
workflow-cps-global-lib:2.21
workflow-durable-task-step:2.39
workflow-job:2.41
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.3

(bitbucket-server-checks is currently a private plugin for jenkinsci/checks-api-plugin#65.)

  • What Operating System are you using (both controller, and any agents involved in the problem)?
Windows Server 2012 R2

Reproduction steps

This is a multibranch pipeline project using Bitbucket Branch Source. The pipeline runs the recordIssues step with two tools docFx and msBuild, and I expect each tool to publish checks via Checks API to Bitbucket Server Checks. However, after I installed the GitHub Checks plugin, the pipeline started publishing checks named "Jenkins" as well. Those seem to be status checks enabled by GitHub Checks. The Bitbucket Server Checks plugin does not implement the StatusChecksProperties or AbstractStatusChecksProperties extension point.

Results

Expected result, i.e. what happens without GitHub Checks:

  1. After the recordIssues step has scanned the DocFX log file:
    [2021-09-22T17:20:53.335Z] [DocFX] Attaching ResultAction with ID 'docfx' to build 'REDACTED/PR-64 #9'.
    [2021-09-22T17:20:53.452Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
    [2021-09-22T17:20:53.499Z] [Bitbucket Server Checks] Converted 0 annotations.
    [2021-09-22T17:20:53.504Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/DocFX
    [2021-09-22T17:20:53.771Z] [Bitbucket Server Checks] Finished publishing.
    
  2. After the recordIssues step has scanned the MSBuild log file:
    [2021-09-22T17:20:53.808Z] [MSBuild] Attaching ResultAction with ID 'msbuild' to build 'REDACTED/PR-64 #9'.
    [2021-09-22T17:20:53.942Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
    [2021-09-22T17:20:53.948Z] [Bitbucket Server Checks] Converted 0 annotations.
    [2021-09-22T17:20:53.948Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/MSBuild
    [2021-09-22T17:20:54.111Z] [Bitbucket Server Checks] Finished publishing.   
    

Actual result, i.e. what happens with GitHub Checks:

  1. Unexpected status checks after the initial checkout:
    [2021-09-22T17:10:44.632Z]  > git.exe rev-list --no-walk 2f957154bd1390a150487e39987faf65f30cf9c6 # timeout=10
    [2021-09-22T17:10:44.817Z] [Bitbucket] Notifying pull request build result
    [2021-09-22T17:10:44.843Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
    [2021-09-22T17:10:44.844Z] [Bitbucket Server Checks] The checks have no output.  Preserve the annotations of any existing Code Insights report.
    [2021-09-22T17:10:44.844Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/Jenkins
    [2021-09-22T17:10:44.951Z] [Bitbucket Server Checks] Finished publishing.
    
  2. After the recordIssues step has scanned the DocFX log file:
    [2021-09-22T17:10:56.800Z] [DocFX] Attaching ResultAction with ID 'docfx' to build 'REDACTED/PR-64 #8'.
    [2021-09-22T17:10:56.893Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
    [2021-09-22T17:10:56.895Z] [Bitbucket Server Checks] Converted 0 annotations.
    [2021-09-22T17:10:56.895Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/DocFX
    [2021-09-22T17:10:57.078Z] [Bitbucket Server Checks] Finished publishing.
    
  3. After the recordIssues step has scanned the MSBuild log file:
    [2021-09-22T17:10:57.094Z] [MSBuild] Attaching ResultAction with ID 'msbuild' to build 'REDACTED/PR-64 #8'.
    [2021-09-22T17:10:57.191Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
    [2021-09-22T17:10:57.193Z] [Bitbucket Server Checks] Converted 0 annotations.
    [2021-09-22T17:10:57.193Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/MSBuild
    [2021-09-22T17:10:57.356Z] [Bitbucket Server Checks] Finished publishing.
    
  4. Unexpected status checks after the pipeline finishes:
    [2021-09-22T17:11:02.164Z] [Pipeline] }
    [2021-09-22T17:11:02.293Z] [Pipeline] // node
    [2021-09-22T17:11:02.412Z] [Pipeline] End of Pipeline
    [2021-09-22T17:11:02.473Z] [Bitbucket] Notifying pull request build result
    [2021-09-22T17:11:02.495Z] [Bitbucket] Build result notified
    [2021-09-22T17:11:02.496Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
    [2021-09-22T17:11:02.498Z] [Bitbucket Server Checks] Converted 0 annotations.
    [2021-09-22T17:11:02.498Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/Jenkins
    [2021-09-22T17:11:02.659Z] [Bitbucket Server Checks] Finished publishing.
    [2021-09-22T17:11:02.687Z] Finished: SUCCESS
    

The pipeline does not reference any GitHub repository, the settings of the pipeline do not include anything related to status checks, and the Bitbucket Server Checks plugin does not implement anything specific to status checks. Status checks should therefore not be published, but the GitHub Checks plugin seems to be enabling them anyway.

Analysis

I think what happens is that:

  1. GitHubStatusChecksProperties.isApplicable returns true because scmFacade.findGitSCM(job) finds something created by Bitbucket Branch Source.
    @Override
    public boolean isApplicable(final Job<?, ?> job) {
    return scmFacade.findGitHubSCMSource(job).isPresent() || scmFacade.findGitSCM(job).isPresent();
    }
  2. BuildStatusChecksPublisher.findProperties returns the GitHubStatusChecksProperties instance. https://github.com/jenkinsci/checks-api-plugin/blob/83a4321ed0d4ae69cfa8e2bb34dbfe7b428556dd/src/main/java/io/jenkins/plugins/checks/status/BuildStatusChecksPublisher.java#L74-L80
  3. BuildStatusChecksPublisher.ChecksGraphListener.onNewHead calls GitHubStatusChecksProperties.isSkipProgressUpdates. https://github.com/jenkinsci/checks-api-plugin/blob/83a4321ed0d4ae69cfa8e2bb34dbfe7b428556dd/src/main/java/io/jenkins/plugins/checks/status/BuildStatusChecksPublisher.java#L256
  4. GitHubStatusChecksProperties.isSkipProgressUpdates calls getConfigurations, which searches for GitHubStatusChecksConfigurations but does not find any because this is not a GitHub project and does not contain any such settings. GitHubStatusChecksProperties.isSkipProgressUpdates then uses DEFAULT_CONFIGURATION instead.
    @Override
    public boolean isSkipProgressUpdates(Job<?, ?> job) {
    return getConfigurations(job).orElse(DEFAULT_CONFIGURATION).isSkipProgressUpdates();
    }
  5. DefaultGitHubStatusChecksConfigurations.isSkipProgressUpdates returns false.
    @Override
    public boolean isSkipProgressUpdates() {
    return false;
    }
  6. BuildStatusChecksPublisher.ChecksGraphListener.onNewHead goes ahead and publishes status checks.

Indeed, if I run in the Script Console:

import io.jenkins.plugins.checks.github.status.GitHubStatusChecksProperties

Job job = Jenkins.get().getItemByFullName("REDACTED/PR-64")

println(new GitHubStatusChecksProperties().isApplicable(job))
println(new GitHubStatusChecksProperties().getConfigurations(job))
println(new GitHubStatusChecksProperties().getName(job))
println(new GitHubStatusChecksProperties().isSkipped(job))
println(new GitHubStatusChecksProperties().isSkipProgressUpdates(job))
println(new GitHubStatusChecksProperties().scmFacade.findGitHubSCMSource(job))
println(new GitHubStatusChecksProperties().scmFacade.findGitSCM(job))

then the output is:

true
Optional.empty
Jenkins
false
false
Optional.empty
Optional[hudson.plugins.git.GitSCM@6967e97]

i.e. GitHubStatusChecksProperties believes it is applicable to this job because of the GitSCM, but nothing has been configured, so it will use the default "Jenkins" name and allow status checks.

How to fix

I can think of two ways to fix this:

  1. Make GitHubStatusChecksProperties.isApplicable return false if the project does not use GitHub, according to the same logic as in GitHubChecksPublisherFactory.createPublisher.

  2. Change the API so that each AbstractStatusChecksProperties implementation can only enable status checks to be published via the ChecksPublisherFactory in the same plugin. I haven't planned this in detail.

Output summary to PR comments

It would be nice to have summary of checks to PR comments, something similar to what sonarcloud does. The comment needs to be updated every time the build is run.

Screenshot 2021-01-04 at 10 13 08

Failed Publishing GitHub checks - Only 65535 characters are allowed; 65537 were supplied.

Jenkins and plugins versions report

Environment
Jenkins: 2.401.1
OS: Linux - 5.15.0-1026-aws
Java: 11.0.19 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
ansicolor:1.0.2
antisamy-markup-formatter:159.v25b_c67cd35fb_
apache-httpcomponents-client-4-api:4.5.14-150.v7a_b_9d17134a_5
authentication-tokens:1.53.v1c90fd9191a_b_
authorize-project:1.7.0
aws-credentials:191.vcb_f183ce58b_9
aws-java-sdk:1.12.447-382.vda_68e2007233
aws-java-sdk-cloudformation:1.12.447-382.vda_68e2007233
aws-java-sdk-codebuild:1.12.447-382.vda_68e2007233
aws-java-sdk-ec2:1.12.447-382.vda_68e2007233
aws-java-sdk-ecr:1.12.447-382.vda_68e2007233
aws-java-sdk-ecs:1.12.447-382.vda_68e2007233
aws-java-sdk-efs:1.12.447-382.vda_68e2007233
aws-java-sdk-elasticbeanstalk:1.12.447-382.vda_68e2007233
aws-java-sdk-iam:1.12.447-382.vda_68e2007233
aws-java-sdk-kinesis:1.12.447-382.vda_68e2007233
aws-java-sdk-logs:1.12.447-382.vda_68e2007233
aws-java-sdk-minimal:1.12.447-382.vda_68e2007233
aws-java-sdk-sns:1.12.447-382.vda_68e2007233
aws-java-sdk-sqs:1.12.447-382.vda_68e2007233
aws-java-sdk-ssm:1.12.447-382.vda_68e2007233
basic-branch-build-strategies:71.vc1421f89888e
blueocean:1.27.4
blueocean-bitbucket-pipeline:1.27.4
blueocean-commons:1.27.4
blueocean-config:1.27.4
blueocean-core-js:1.27.4
blueocean-dashboard:1.27.4
blueocean-display-url:2.4.2
blueocean-events:1.27.4
blueocean-git-pipeline:1.27.4
blueocean-github-pipeline:1.27.4
blueocean-i18n:1.27.4
blueocean-jwt:1.27.4
blueocean-personalization:1.27.4
blueocean-pipeline-api-impl:1.27.4
blueocean-pipeline-editor:1.27.4
blueocean-pipeline-scm-api:1.27.4
blueocean-rest:1.27.4
blueocean-rest-impl:1.27.4
blueocean-web:1.27.4
bootstrap5-api:5.3.0-1
bootstraped-multi-test-results-report:2.2.1
bouncycastle-api:2.28
branch-api:2.1105.v472604208c55
build-monitor-plugin:1.14-717.v3efcdffe8d58
build-pipeline-plugin:1.5.8
caffeine-api:3.1.6-115.vb_8b_b_328e59d8
checks-api:2.0.0
cloudbees-bitbucket-branch-source:805.v7f97d29dc0f5
cloudbees-folder:6.815.v0dd5a_cb_40e0e
command-launcher:90.v669d7ccb_7c31
commons-lang3-api:3.12.0-36.vd97de6465d5b_
commons-text-api:1.10.0-36.vc008c8fcda_7b_
config-file-provider:938.ve2b_8a_591c596
credentials:1254.vb_96f366e7b_a_d
credentials-binding:604.vb_64480b_c56ca_
dark-theme:315.va_22e7d692ea_a
dashboard-view:2.487.vcf0ff9008a_c0
dependency-check-jenkins-plugin:5.4.0
display-url-api:2.3.7
docker-commons:419.v8e3cd84ef49c
docker-workflow:563.vd5d2e5c4007f
durable-task:507.v050055d0cb_dd
echarts-api:5.4.0-5
extended-choice-parameter:373.v1a_ecea_fdf2a_a_
favorite:2.4.2
font-awesome-api:6.4.0-1
git:5.0.2
git-client:4.3.0
github:1.37.1
github-api:1.314-431.v78d72a_3fe4c3
github-branch-source:1703.vd5a_2b_29c6cdc
github-checks:545.v79a_a_68b_ca_682
github-oauth:0.39
global-build-stats:269.v214f74360b_3a_
gradle:2.7
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
htmlpublisher:1.31
instance-identity:142.v04572ca_5b_265
ionicons-api:56.v1b_1c8c49374e
jackson2-api:2.15.1-344.v6eb_55303dc3e
jakarta-activation-api:2.0.1-3
jakarta-mail-api:2.0.1-3
javax-activation-api:1.2.0-6
javax-mail-api:1.6.2-8
jaxb:2.3.8-1
jdk-tool:63.v62d2fd4b_4793
jenkins-design-language:1.27.4
jjwt-api:0.11.5-77.v646c772fddb_0
jquery:1.12.4-1
jquery3-api:3.7.0-1
junit:1207.va_09d5100410f
kubernetes:3937.vd7b_82db_e347b_
kubernetes-client-api:6.4.1-215.v2ed17097a_8e9
kubernetes-credentials:0.10.0
leastload:3.0.0
mailer:457.v3f72cb_e015e5
material-theme:0.5.2-rc100.6121925fe229
matrix-auth:3.1.8
matrix-project:789.v57a_725b_63c79
metrics:4.2.18-438.v0ede325a_4c68
mina-sshd-api-common:2.10.0-69.v28e3e36d18eb_
mina-sshd-api-core:2.10.0-69.v28e3e36d18eb_
nodejs:1.6.0
okhttp-api:4.10.0-132.v7a_7b_91cef39c
parameterized-trigger:2.45
pipeline-aws:1.43
pipeline-build-step:491.v1fec530da_858
pipeline-graph-analysis:202.va_d268e64deb_3
pipeline-groovy-lib:656.va_a_ceeb_6ffb_f7
pipeline-input-step:468.va_5db_051498a_4
pipeline-milestone-step:111.v449306f708b_7
pipeline-model-api:2.2133.ve46a_6113dfc3
pipeline-model-definition:2.2133.ve46a_6113dfc3
pipeline-model-extensions:2.2133.ve46a_6113dfc3
pipeline-npm:49.v9c8598493533
pipeline-rest-api:2.32
pipeline-stage-step:305.ve96d0205c1c6
pipeline-stage-tags-metadata:2.2133.ve46a_6113dfc3
pipeline-stage-view:2.32
pipeline-utility-steps:2.15.4
plain-credentials:143.v1b_df8b_d3b_e48
plugin-util-api:3.3.0
preSCMbuildstep:71.v1f2990a_37e27
pubsub-light:1.17
scm-api:672.v64378a_b_20c60
script-security:1251.vfe552ed55f8d
simple-theme-plugin:160.vb_76454b_67900
slack:664.vc9a_90f8b_c24a_
snakeyaml-api:1.33-95.va_b_a_e3e47b_fa_4
solarized-theme:0.1
sonar:2.15
sse-gateway:1.26
ssh-agent:333.v878b_53c89511
ssh-credentials:305.v8f4381501156
sshd:3.249.v2dc2ea_416e33
structs:324.va_f5d6774f3a_d
test-results-analyzer:0.4.0
theme-manager:193.vcef22f6c5f2b_
timestamper:1.25
token-macro:359.vb_cde11682e0c
trilead-api:2.84.v72119de229b_7
uno-choice:2.6.5
variant:59.vf075fe829ccb
workflow-aggregator:596.v8c21c963d92d
workflow-api:1213.v646def1087f9
workflow-basic-steps:1017.vb_45b_302f0cea_
workflow-cps:3673.v5b_dd74276262
workflow-durable-task-step:1247.v7f9dfea_b_4fd0
workflow-job:1308.v58d48a_763b_31
workflow-multibranch:746.v05814d19c001
workflow-scm-step:408.v7d5b_135a_b_d49
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:839.v35e2736cfd5c

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

Jenkins controller runs as a pod in K8s cluster with agents being managed ad-hoc via Kubernetes plugin

Reproduction steps

  1. We have a react native pipeline that uses a container with a full Android Toolchain that allows us to run ./gradlew --no-daemon -PreactNativeArchitectures=x86_64 assembleDebug
  2. PR build fails (expected) and generates a very long console output
  3. GitHub Check plugin fails to upload check to GitHub

Expected Results

GitHub Checks plugin manages to truncate the output and upload a check to GitHub

Actual Results

Final Jenkins check is not being published to GitHub due to:

ERROR: script returned exit code 1
[GitHub Checks] Failed Publishing GitHub checks: org.kohsuke.github.HttpException: {"message":"Invalid request.\n\nOnly 65535 characters are allowed; 65537 were supplied.","documentation_url":"https://docs.github.com/rest/reference/checks#update-a-check-run"}

Anything else?

I find it interesting that supplier characters (65537) are only +2 from the max allowed (65535).
It would be quite a coincidence that output of my build exceeds the allowed characters by just 2.

I read somewhere that Check plugin is using TruncatedString to ensure that uploaded string does not exceed the max allowed value - I wonder if there is so sort of mistake in the truncation logic, which then results in truncated string to by bigger by 2 from the allowed value.

Note: for now I've used "Suppress log output in checks" of my GitHub Organization folder to avoid the issue

Jenkins in monorepo with multiple multibranch pipeline jobs

Describe your use-case which is not covered by existing documentation.

I have a GitHub monorepo setup. There is a seed job that monitors a build
configuration file when new projects are added to a repo. The seed job will create
new multibranch pipeline job for that project. Thus the monorepo has
multiple multibranch jobs. Each job only runs when files are updated in its
project.
I have a couple of questions.

  1. I noticed that the Jenkins GitHub Check does not always show the
    correct status or job for that repo. Should each job have its own unique GitHub Status
    name?

GitHub Check Status

  1. With this setup, each pull request can have one or more jobs running
    at once. GitHub branch protection rule requires selecting the check stat=
    us
    needed to check in. Since each PR will have different jobs, then cannot
    select any specific job. Is there a plugin that will aggregate status
    checks across multiple jobs?

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

I havent been able to find any documentation on how to configure a scenario where a repo has multiple jobs running. Not sure if I missed anything.

e.g. This PR shows the Jenkins Check as green but some of the jobs seems to fail.

NemProject/nem#56

Plugin sends results to previous repository

Context

Team does PR-linting as a service. Users should be able to just install a GitHub app and ask for their repository to be added to a list of repositories our team lints.

Version report

Jenkins and plugins versions report:

Jenkins: 2.289.2
OS: Linux - RHEL7
---
ace-editor:1.1
active-directory:2.24
analysis-model-api:10.2.5
ansicolor:1.0.0
ant:1.11
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
authentication-tokens:1.3
authorize-project:1.4.0
blueocean:1.24.8
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.24.8
blueocean-commons:1.24.8
blueocean-config:1.24.8
blueocean-core-js:1.24.8
blueocean-dashboard:1.24.8
blueocean-display-url:2.4.1
blueocean-events:1.24.8
blueocean-git-pipeline:1.24.8
blueocean-github-pipeline:1.24.8
blueocean-i18n:1.24.8
blueocean-jwt:1.24.8
blueocean-personalization:1.24.8
blueocean-pipeline-api-impl:1.24.8
blueocean-pipeline-editor:1.24.8
blueocean-pipeline-scm-api:1.24.8
blueocean-rest:1.24.8
blueocean-rest-impl:1.24.8
blueocean-web:1.24.8
bootstrap4-api:4.6.0-1
bootstrap5-api:5.0.2-1
bouncycastle-api:2.21
branch-api:2.6.5
build-timeout:1.20
caffeine-api:2.9.1-23.v51c4e2c879c8
checks-api:1.7.2
cloudbees-bitbucket-branch-source:2.4.4
cloudbees-folder:6.15
command-launcher:1.6
configuration-as-code:1.51
credentials:2.5
credentials-binding:1.27
dark-theme:0.0.12
data-tables-api:1.10.25-2
display-url-api:2.3.5
durable-task:1.38
echarts-api:5.1.2-3
email-ext:2.83
envinject:2.4.0
envinject-api:1.6
favorite:2.3.1
font-awesome-api:5.15.3-4
forensics-api:1.2.1
generic-webhook-trigger:1.74
git:4.8.0
git-client:3.8.0
git-server:1.10
github:1.33.1
github-api:1.123
github-branch-source:2.11.1
github-checks:1.0.13
gradle:1.37.1
handlebars:3.0.8
handy-uri-templates-2-api:2.1.6-1.0
htmlpublisher:1.25
jackson2-api:2.12.4
jaxb:2.3.0
jdk-tool:1.5
jenkins-design-language:1.24.8
jjwt-api:0.11.2-5.143e44951c52
job-dsl:1.77
jquery-detached:1.2.1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.51
ldap:2.7
lockable-resources:2.11
mailer:1.34
mapdb-api:1.0.9.0
matrix-auth:2.6.8
matrix-project:1.19
mercurial:2.0
momentjs:1.1.1
next-executions:1.0.15
okhttp-api:3.14.9
pam-auth:1.6
pipeline-build-step:2.14
pipeline-github-lib:1.0
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
plain-credentials:1.7
plugin-util-api:2.4.0
popper-api:1.16.0-7
popper2-api:2.5.4-3
pubsub-light:1.13
resource-disposer:0.16
scm-api:2.6.4
script-security:1.77
snakeyaml-api:1.29.1
sse-gateway:1.24
ssh-credentials:1.19
ssh-slaves:1.32.0
sshd:3.0.4
structs:1.23
subversion:2.14.4
theme-manager:0.6
timestamper:1.13
token-macro:2.15
trilead-api:1.0.13
variant:1.3
warnings-ng:9.4.0
workflow-aggregator:2.6
workflow-api:2.46
workflow-basic-steps:2.23
workflow-cps:2.93
workflow-cps-global-lib:2.21
workflow-durable-task-step:2.39
workflow-job:2.41
workflow-multibranch:2.26
workflow-scm-step:2.13
workflow-step-api:2.24
workflow-support:3.8
ws-cleanup:0.39
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Controller: RHEL7.7
No agents

It shouldn't make an impact, but for reference, the controller is inside a container in k8s.

Reproduction steps

  • Setup Github App to listen to pull requests, add credentials to Jenkins
  • Configure Github App to send PR events to Generic Webhook Trigger
  • Add Github App to two different repositories
  • Configure Jenkins job to build on Generic Webhook Trigger event
  • Open a PR in repo-1 (referred to as PR1). This should trigger the job, which will
    • Use GH App credentials to clone PR1 content
    • run lint tests
    • use Github Checks Plugin to return lint test results
  • Open a PR in repo-2 (referred to as PR2). This should trigger the job again, which will
    • Use GH App credentials to clone PR2 content
    • run lint tests
    • use Github Checks Plugin to return lint test results

Results

Expected result:

Github Checks Plugin returns lint results for PR2 to repo-2

Actual result:

Github Checks Plugin returns lint results for PR2 to repo-1 (and fails, because repo-1 does not have that commit).

The recommended git tool is: NONE
using credential generic-lint-github-app-credentials-repo-2
Cloning the remote Git repository
Cloning repository https://git/org/repo-2.git
 > git init /var/jenkins_home/workspace/generic-pull-request-lint-tests/target-repo # timeout=10
Fetching upstream changes from https://git/org/repo-2.git
 > git --version # timeout=10
 > git --version # 'git version 1.8.3.1'
using GIT_ASKPASS to set credentials Generic linter GH app credentials (org: repo-2)
 > git fetch --tags --progress https://git/org/repo-2.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://git/org/repo-2.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
 > git rev-parse origin/repo-2^{commit} # timeout=10
Checking out Revision 2c6d90904851dcd4fd55d02b9009cc31c34af9e2 (origin/repo-2)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 2c6d90904851dcd4fd55d02b9009cc31c34af9e2 # timeout=10
Commit message: "add a bad key/value to bad.yml"
First time build. Skipping changelog.
[GitHub Checks] Failed Publishing GitHub checks: org.kohsuke.github.GHFileNotFoundException: https://git/api/v3/repos/org/repo-1/check-runs {"message":"No commit found for SHA: 2c6d90904851dcd4fd55d02b9009cc31c34af9e2","documentation_url":"https://docs.github.com/enterprise/3.0/rest/reference/checks#create-a-check-run"}

Edit: Suspect there is some caching issues going on here, perhaps with reference build analysis?

Chess incorrectly report success on failed stage if junit is enabled and not failing

Jenkins and plugins versions report

Environment
Jenkins: 2.401.1
OS: Linux - 5.10.184-175.731.amzn2.x86_64
Java: 11.0.14.1 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
ace-editor:1.1
ansicolor:1.0.2
ant:487.vd79d090d4ea_e
antisamy-markup-formatter:159.v25b_c67cd35fb_
anything-goes-formatter:19.v3e2b_1b_3e0ee5
apache-httpcomponents-client-4-api:4.5.14-150.v7a_b_9d17134a_5
apache-httpcomponents-client-5-api:5.2.1-1.0
artifact-manager-s3:822.vf129d4836c31
atlassian-jira-software-cloud:2.0.7
audit-trail:333.vb_e1b_b_0f1238c
authentication-tokens:1.53.v1c90fd9191a_b_
aws-credentials:191.vcb_f183ce58b_9
aws-global-configuration:108.v47b_fd43dfec6
aws-java-sdk:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-cloudformation:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-codebuild:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-ec2:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-ecr:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-ecs:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-efs:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-elasticbeanstalk:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-iam:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-kinesis:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-logs:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-minimal:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-sns:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-sqs:1.12.481-392.v8b_291cfcda_09
aws-java-sdk-ssm:1.12.481-392.v8b_291cfcda_09
basic-branch-build-strategies:71.vc1421f89888e
blueocean:1.27.4
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.27.4
blueocean-commons:1.27.4
blueocean-config:1.27.4
blueocean-core-js:1.27.4
blueocean-dashboard:1.27.4
blueocean-display-url:2.4.2
blueocean-events:1.27.4
blueocean-git-pipeline:1.27.4
blueocean-github-pipeline:1.27.4
blueocean-i18n:1.27.4
blueocean-jira:1.27.4
blueocean-jwt:1.27.4
blueocean-personalization:1.27.4
blueocean-pipeline-api-impl:1.27.4
blueocean-pipeline-editor:1.27.4
blueocean-pipeline-scm-api:1.27.4
blueocean-rest:1.27.4
blueocean-rest-impl:1.27.4
blueocean-web:1.27.4
bootstrap4-api:4.6.0-6
bootstrap5-api:5.3.0-1
bouncycastle-api:2.28
branch-api:2.1109.vdf225489a_16d
build-monitor-plugin:1.14-717.v3efcdffe8d58
build-time-blame:70.v5031def3c2e3-2.1.0
build-timeout:1.31
build-timestamp:1.0.3
build-user-vars-plugin:1.9
build-with-parameters:76.v9382db_f78962
caffeine-api:3.1.6-115.vb_8b_b_328e59d8
cctray-xml:59.v22fa_7b_8c8fe5
checks-api:2.0.0
chucknorris:1.4
cloudbees-bitbucket-branch-source:809.vc1d904b_30426
cloudbees-folder:6.815.v0dd5a_cb_40e0e
cobertura:1.17
code-coverage-api:4.7.0
command-launcher:100.v2f6722292ee8
commons-lang3-api:3.12.0-36.vd97de6465d5b_
commons-text-api:1.10.0-36.vc008c8fcda_7b_
conditional-buildstep:1.4.2
config-file-provider:938.ve2b_8a_591c596
configuration-as-code:1647.ve39ca_b_829b_42
configurationslicing:548.ve92d48e66b_f8
copyartifact:705.v5295cffec284
credentials:1254.vb_96f366e7b_a_d
credentials-binding:604.vb_64480b_c56ca_
dark-theme:315.va_22e7d692ea_a
data-tables-api:1.13.4-2
datadog:5.4.1
display-url-api:2.3.7
docker-commons:419.v8e3cd84ef49c
docker-java-api:3.3.1-79.v20b_53427e041
docker-workflow:563.vd5d2e5c4007f
durable-task:507.v050055d0cb_dd
ec2:2.0.7
ec2-fleet:2.6.0
echarts-api:5.4.0-5
email-ext:2.98
embeddable-build-status:385.vc95f94e91fb_3
envinject:2.901.v0038b_6471582
envinject-api:1.199.v3ce31253ed13
environment-script:1.2.6
extended-choice-parameter:373.v1a_ecea_fdf2a_a_
extensible-choice-parameter:1.8.0
external-monitor-job:203.v683c09d993b_9
favorite:2.4.2
folder-auth:1.4
font-awesome-api:6.4.0-1
forensics-api:2.3.0
ghprb:1.42.2
git:5.1.0
git-changelog:3.30
git-client:4.4.0
git-parameter:0.9.18
git-server:99.va_0826a_b_cdfa_d
github:1.37.1
github-api:1.314-431.v78d72a_3fe4c3
github-branch-source:1728.v859147241f49
github-checks:545.v79a_a_68b_ca_682
google-oauth-plugin:1.0.8
gradle:2.8
groovy:453.vcdb_a_c5c99890
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
hashicorp-vault-plugin:360.v0a_1c04cf807d
htmlpublisher:1.31
instance-identity:173.va_37c494ec4e5
ionicons-api:56.v1b_1c8c49374e
ivy:2.5
jackson2-api:2.15.2-350.v0c2f3f8fc595
jakarta-activation-api:2.0.1-3
jakarta-mail-api:2.0.1-3
javadoc:233.vdc1a_ec702cff
javax-activation-api:1.2.0-6
javax-mail-api:1.6.2-9
jaxb:2.3.8-1
jdk-tool:66.vd8fa_64ee91b_d
jenkins-design-language:1.27.4
jersey2-api:2.39.1-2
jira:3.10
jira-steps:2.0.165.v8846cf59f3db
jjwt-api:0.11.5-77.v646c772fddb_0
jnr-posix-api:3.1.17-1
job-dsl:1.84
job-import-plugin:3.6
jobConfigHistory:1212.vd4470d08ff12
jobcacher:387.v41e893017398
jquery:1.12.4-1
jquery-detached:1.2.1
jquery3-api:3.7.0-1
jsch:0.2.8-65.v052c39de79b_2
junit:1207.va_09d5100410f
kubernetes:3909.v1f2c633e8590
kubernetes-client-api:6.4.1-215.v2ed17097a_8e9
kubernetes-credentials:0.10.0
ldap:682.v7b_544c9d1512
list-git-branches-parameter:0.0.13
lockable-resources:1156.v5e9f897ece02
mailer:457.v3f72cb_e015e5
mapdb-api:1.0.9-28.vf251ce40855d
markdown-formatter:77.vf4787624a_796
mask-passwords:150.vf80d33113e80
matrix-auth:3.1.8
matrix-project:789.v57a_725b_63c79
maven-plugin:3.22
mercurial:1260.vdfb_723cdcc81
metrics:4.2.18-439.v86a_20b_a_8318b_
mina-sshd-api-common:2.10.0-69.v28e3e36d18eb_
mina-sshd-api-core:2.10.0-69.v28e3e36d18eb_
momentjs:1.1.1
monitoring:1.94.1
next-build-number:1.8
node-iterator-api:49.v58a_8b_35f8363
oauth-credentials:0.645.ve666a_c332668
okhttp-api:4.11.0-145.vcb_8de402ef81
pam-auth:1.10
parameterized-scheduler:1.2
parameterized-trigger:2.45
pipeline-build-step:496.v2449a_9a_221f2
pipeline-github-lib:42.v0739460cda_c4
pipeline-graph-analysis:202.va_d268e64deb_3
pipeline-groovy-lib:656.va_a_ceeb_6ffb_f7
pipeline-input-step:468.va_5db_051498a_4
pipeline-milestone-step:111.v449306f708b_7
pipeline-model-api:2.2141.v5402e818a_779
pipeline-model-definition:2.2141.v5402e818a_779
pipeline-model-extensions:2.2141.v5402e818a_779
pipeline-rest-api:2.32
pipeline-stage-step:305.ve96d0205c1c6
pipeline-stage-tags-metadata:2.2141.v5402e818a_779
pipeline-stage-view:2.32
pipeline-utility-steps:2.15.4
plain-credentials:143.v1b_df8b_d3b_e48
plugin-util-api:3.3.0
popper-api:1.16.1-3
popper2-api:2.11.6-2
prism-api:1.29.0-7
publish-to-bitbucket:0.4
pubsub-light:1.17
rebuild:320.v5a_0933a_e7d61
resource-disposer:0.22
run-condition:1.5
saferestart:0.7
saml:4.418.vdfa_7489a_b_a_2d
scm-api:672.v64378a_b_20c60
script-security:1251.vfe552ed55f8d
simple-theme-plugin:160.vb_76454b_67900
skip-notifications-trait:198.vc48f25a_18f41
slack:664.vc9a_90f8b_c24a_
snakeyaml-api:1.33-95.va_b_a_e3e47b_fa_4
sse-gateway:1.26
ssh-credentials:305.v8f4381501156
ssh-slaves:2.877.v365f5eb_a_b_eec
sshd:3.303.vefc7119b_ec23
startup-trigger-plugin:2.9.3
structs:324.va_f5d6774f3a_d
subversion:2.17.2
test-results-analyzer:0.4.0
theme-manager:193.vcef22f6c5f2b_
timestamper:1.25
token-macro:359.vb_cde11682e0c
trilead-api:2.84.v72119de229b_7
validating-string-parameter:2.8
variant:59.vf075fe829ccb
violation-comments-to-stash:1.130
windows-slaves:1.8.1
workflow-aggregator:596.v8c21c963d92d
workflow-api:1213.v646def1087f9
workflow-basic-steps:1017.vb_45b_302f0cea_
workflow-cps:3691.v28b_14c465a_b_b_
workflow-durable-task-step:1247.v7f9dfea_b_4fd0
workflow-job:1308.v58d48a_763b_31
workflow-multibranch:756.v891d88f2cd46
workflow-scm-step:415.v434365564324
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:839.v35e2736cfd5c
ws-cleanup:0.45

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

Off the shelf linux containers under kubernetes, but not relevant to the bug.

Reproduction steps

Have a Jenkinsfile with a stage that fails by returning a non zero exit code, but with junit() enabled and configured to allow missing junit reports.

steps {
  sh 'exit 1'
}
post {
  always {
    junit("**/report.xml.xml", allowEmptyResults: true)
  }
}

Expected Results

In GH the PR check for the stage should match the results seen in Jenkins itself: fail.

Actual Results

The check in the PR view is showing success.

Anything else?

We will update our internal jenkins library to remove junit() calls when not needed and for the ones that need it we will remove allowEmptyResults: true as a workaround.

Can't disable/rename check with GitHub Branch Source Plugin

I'm using the warnings-ng plugin to publish checks to my GitHub Enterprise server for each code check tool I'm using. However, this plugin is also publishing another check for the entire build itself. Looks like this:
image
Is there any way to disable the "Jenkins" check there? For some jobs, I'll want it, but for others that only need a yamllint or something, I only want the warnings-ng check listed.
Based on this line in the readme, I assume it should be possible, but I can't find the setting to make the change.
image

`GitHubSCMSourceChecksContext` failing to load `SCMRevisionAction` from branch build

Take a look at the stack trace in jenkinsci/junit-plugin#308. @cathychan observed something similar from junit on a GitHub branch project build:

org.kohsuke.github.GHIOException: Ran out of retries for URL: https://api.github.com/repos/…/…
	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:407)
	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:355)
	at org.kohsuke.github.Requester.fetch(Requester.java:76)
	at org.kohsuke.github.GHRepository.read(GHRepository.java:132)
	at org.kohsuke.github.GitHub.getRepository(GitHub.java:673)
	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1685)
	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
	at io.jenkins.plugins.checks.github.SCMFacade.findRevision(SCMFacade.java:156)
Caused: java.lang.IllegalStateException: Could not fetch revision from repository: … and branch: …
	at io.jenkins.plugins.checks.github.SCMFacade.findRevision(SCMFacade.java:159)
	at io.jenkins.plugins.checks.github.GitHubSCMSourceChecksContext.resolveHeadSha(GitHubSCMSourceChecksContext.java:131)
	at io.jenkins.plugins.checks.github.GitHubSCMSourceChecksContext.<init>(GitHubSCMSourceChecksContext.java:46)
	at io.jenkins.plugins.checks.github.GitHubSCMSourceChecksContext.fromRun(GitHubSCMSourceChecksContext.java:24)
	at io.jenkins.plugins.checks.github.GitHubChecksPublisherFactory.createPublisher(GitHubChecksPublisherFactory.java:48)
	at io.jenkins.plugins.checks.api.ChecksPublisherFactory.lambda$fromRun$0(ChecksPublisherFactory.java:89)
	at …
	at io.jenkins.plugins.checks.api.ChecksPublisherFactory.fromRun(ChecksPublisherFactory.java:92)
	at io.jenkins.plugins.checks.api.ChecksPublisherFactory.fromRun(ChecksPublisherFactory.java:69)
	at io.jenkins.plugins.junit.checks.JUnitChecksPublisher.publishChecks(JUnitChecksPublisher.java:41)
	at hudson.tasks.junit.JUnitResultArchiver.parseAndSummarize(JUnitResultArchiver.java:310)
	at hudson.tasks.junit.pipeline.JUnitResultsStepExecution.run(JUnitResultsStepExecution.java:63)
	at hudson.tasks.junit.pipeline.JUnitResultsStepExecution.run(JUnitResultsStepExecution.java:29)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at …

Besides the robustness issue covered in the other issue, what is noteworthy here is that GitHubSCMSourceChecksContext.resolveHeadSha(Job) is running, which must make a network operation. That is clearly wrong because this is a branch build for which SCMRevisionAction should exist, so resolveHeadSha(Run) should have been able to get this trivial piece of information from memory. Why then did

this.sha = Optional.ofNullable(run).map(this::resolveHeadSha).orElse(resolveHeadSha(job));
fall back to the Job overload?

Allow Reducing the Verbosity of the Logging

Feature Request

Since installing the Github Checks plugin, we are seeing log entries on every build from the plugin. These have caused some confusion for the users of our build system. They look like the following:

08:57:03 [GitHub Checks] Causes for no suitable publisher found:
08:57:03 [GitHub Checks] Trying to resolve checks parameters from GitHub SCM...
08:57:03 [GitHub Checks] Job does not use GitHub SCM
08:57:03 [GitHub Checks] Trying to resolve checks parameters from Git SCM...
08:57:03 [GitHub Checks] No GitHub app credentials found: ''
08:57:03 [GitHub Checks] See: https://github.com/jenkinsci/github-branch-source-plugin/blob/master/docs/github-app.adoc
08:57:03 [GitHub Checks] Job does not have valid credentials
08:57:03 [Checks API] No suitable checks publisher found.

It would be a nice feature to be able to turn these log entries off, as the use-case in our build system does not need this information.

Add 'head_branch' to GitHubChecksRerunActionCause

Feature Request

Add the check_suite[head_branch] value of the check_run payload to GitHubChecksRerunActionCause.

Dependencies

It depends:

Potentially /org/kohsuke/github depending on if the jackson shim dep over the payload does not provide what is necessary to access the check_suite[head_branch] already. Or if org.json.JSONObject is acceptable/performant enough - none.

Context/Background

When working with freestyle jobs that use the git plugin for SCM - we've found git fetch too slow when including too wide of a refspec, and take the tooltips recommendation of specifying a single branch.

In our case - we're trying to setup jobs that trigger for every change to a non draft pull request. Using generic webhook trigger we've been able to achieve that - by filtering over they payload and only triggering jobs that are non draft. Additionally - we're able to pull out the branch name - so that we can pass that into a parameter of the job - so that the git SCM plugin can use it for the refspec to only fetch changes for that PR (even the refspec for just PR's takes exceptionally long to fetch in the repository in question).

This setup has worked well for us with one exception: the re-run button that appears next to the failed status checks in the github UI is not compatible on it's own to filling out the parameter to our job that is normally filled in by the generic webhook trigger. The result is that the SCM refspec that refers to that parameter is either blank if no default or forced to use a default value (again - too wide is unexceptably slow).

When researching this issue we noticed that the plugin actually receives the full re-run request payload from github, which includes the head_branch info we need in order to fill in the parameter value of our jobs - however - the only information that is added to the Cause is the requesting user.

Armed with this information we setup a POC fork of this plugin to add the head branch to the Cause - which we then validated worked! We then took it a step further and were able to use the envinject plugin to pull the value out of the Cause and populate the parameter, SO THAT re-runs used the intended refspec - built the correct branch and reported the status correctly!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.