-
Bug
-
Resolution: Unresolved
-
Trivial
-
None
-
github-plugin 1.34.1
Our Setup:
- CloudBees CI Managed Controller and GitHub Enterprise
- I configured the pipeline to checkout our main source code repo with credentials A.
- In addition some Jenkins libraries are loaded via git with credentials B. (This is globally configured by our IT)
- I want to call GitHubCommitStatusSetter manually to send the state of some stages.
- Credentials A: permissions for our source code repo
- Credentials B: permissions for shared Jenkins libs
- Only one GitHub Enterprise (but different repos/organizations)
What happens:
- The pipeline ("continuous-integration/jenkins/pr-merge") PENDING state is send via credentials A.
- Jenkinsfile is obtain via credentials A.
- Jenkins libraries are loaded via credentials B.
- source code repo is cloned via credentials A.
- Calls in Pipeline of GitHubCommitStatusSetter use credentials B.
- Need to set ManuallyEnteredRepositorySource and ManuallyEnteredShaSource
- At end of pipeline the ("continuous-integration/jenkins/pr-merge") SUCCESS state is send via credentials A.
The issue:
If credentials B contain permissions for our repo, then is works (but I can see in GitHub that the "continuous-integration/jenkins/pr-merge" state and the others are send from different service accounts). Unfortunately, the permissions had to be removed.
What is actually happening now: The pipeline calls to GitHubCommitStatusSetter fail with credentials B:
WARNING com.cloudbees.jenkins.GitHubRepositoryName$1 applyNullSafe Failed to obtain repository com.cloudbees.jenkins.GitHubRepositoryName$1@7b787643 java.io.FileNotFoundException: https://.../api/v3/repos/our-org/our-repo 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://.../api/v3/repos/our-org/our-repo {"message":"Not Found","documentation_url":"https://docs.github.com/enterprise/3.3/rest/reference/repos#get-a-repository"} ...
Be able to set the credentials like requested in JENKINS-67779 would also help here.