Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration ignores app credential override #360

Open
ioanav104 opened this issue Oct 2, 2023 · 0 comments
Open

Configuration ignores app credential override #360

ioanav104 opened this issue Oct 2, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ioanav104
Copy link

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) {

@ioanav104 ioanav104 added the bug Something isn't working label Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant