jenkinsci / jenkinsci/github-branch-source-plugin
[JENKINS-75950] Github branch source plugin is not able to deal with Github's Copilot pseudo user
- Dominant language
- Java
- Stars
- 217
- Forks
- 398
- Avg merge
- 30m
- Merged PRs (30d)
- 1
Description
Recently, I started trying Github's CoPilot feature of implementing a ticket (feature).
After having at least one open Copilot PR, the Github multibranch job started to fail to scanning the repository (see stack trace below).
As it appears, the reason behind this is that Github introduced a new pseudo user called `Copilot` that doesn't have a presence in their api under https://api.github.com/users/Copilot which makes it fail.
Why am I setting this to Major? because breaking the scan loop there ended up in not removing orphan items (closed or merged PRs) causing the used space to rise over the time until it blocks Jenkins from working properly.
Interestingly, seems like the code was intended to skip instead of failing according to code comments but ended up throwing an exception (see code block).
How to fix this? I see 2 solutions to be applied:
- First, in case of failure, we should skip and warn as the code comment says.
- Second, we need to have some way to handle such pseudo user but without allowing it to run CI unless the PR is approved (to avoid any unexpected behavior from an AI bot written code).
Examining [ORG_NAME]/[REPO_NAME]
Checking branches...
Getting remote branches...
Checking branch master
Getting remote pull requests...
Could not find user Copilot for pull request [PR_NUMBER].
ERROR: [Thu Jul 31 06:38:27 PDT 2025] Could not fetch branches from source org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator::https://api.github.com::[ORG_NAME]::[REPO_NAME]
[Thu Jul 31 06:38:27 PDT 2025] Finished branch indexing. Indexing took 12 sec
FATAL: Failed to recompute children of [PROJECT_NAME] » [REPO_NAME]
java.io.FileNotFoundException: https://api.github.com/users/Copilot
at PluginClassLoader for github-api//org.kohsuke.github.GitHubConnectorResponseErrorHandler$1.onError(GitHubConnectorResponseErrorHandler.java:68)
at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:504)
at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:464)
Caused: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/users/Copilot {"message":"Not Found","documentation_url":"https://docs.github.com/rest","status":"404"}
at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:735)
at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:480)
at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:427)
at PluginClassLoader for github-api//org.kohsuke.github.Requester.fetchInto(Requester.java:102)
at PluginClassLoader for github-api//org.kohsuke.github.GHPerson.populate(GHPerson.java:60)
at PluginClassLoader for github-api//org.kohsuke.github.GHPerson.getName(GHPerson.java:208)
at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyPullRequests$CacheUpdatingIterable.observe(GitHubSCMSource.java:2580)
at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyPullRequests$CacheUpdatingIterable.observe(GitHubSCMSource.java:2558)
at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.SinglePassIterable$1.next(SinglePassIterable.java:91)
at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait$ExcludeOriginPRBranchesSCMHeadFilter.isExcluded(BranchDiscoveryTrait.java:219)
at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.isExcluded(SCMSourceRequest.java:196)
at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:333)
at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:249)
at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1070)
at PluginClassLoader for scm-api//jenkins.scm.api.SCMSource._retrieve(SCMSource.java:372)
at PluginClassLoader for scm-api//jenkins.scm.api.SCMSource.fetch(SCMSource.java:282)
at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:660)
at PluginClassLoader for cloudbees-folder//com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:272)
at PluginClassLoader for cloudbees-folder//com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:170)
at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1063)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:454)
---
Originally reported by muhammad_st, imported from: Github branch source plugin is not able to deal with Github's Copilot pseudo user
Raw content of original issue
Recently, I started trying Github's CoPilot feature of implementing a ticket (feature).
After having at least one open Copilot PR, the Github multibranch job started to fail to scanning the repository (see stack trace below).
As it appears, the reason behind this is that Github introduced a new pseudo user called `Copilot` that doesn't have a presence in their api under https://api.github.com/users/Copilot which makes it fail.
Why am I setting this to Major? because breaking the scan loop there ended up in not removing orphan items (closed or merged PRs) causing the used space to rise over the time until it blocks Jenkins from working properly.
Interestingly, seems like the code was intended to skip instead of failing according to code comments but ended up throwing an exception (see code block).
How to fix this? I see 2 solutions to be applied:
- First, in case of failure, we should skip and warn as the code comment says.
- Second, we need to have some way to handle such pseudo user but without allowing it to run CI unless the PR is approved (to avoid any unexpected behavior from an AI bot written code).
Examining [ORG_NAME]/[REPO_NAME]
Checking branches...
Getting remote branches...
Checking branch master
Getting remote pull requests...
Could not find user Copilot for pull request [PR_NUMBER].
ERROR: [Thu Jul 31 06:38:27 PDT 2025] Could not fetch branches from source org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator::https://api.github.com::[ORG_NAME]::[REPO_NAME]
[Thu Jul 31 06:38:27 PDT 2025] Finished branch indexing. Indexing took 12 sec
FATAL: Failed to recompute children of [PROJECT_NAME] » [REPO_NAME]
java.io.FileNotFoundException: https://api.github.com/users/Copilot
at PluginClassLoader for github-api//org.kohsuke.github.GitHubConnectorResponseErrorHandler$1.onError(GitHubConnectorResponseErrorHandler.java:68)
at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:504)
at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:464)
Caused: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/users/Copilot {"message":"Not Found","documentation_url":"https://docs.github.com/rest","status":"404"}
at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:735)
at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:480)
at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:427)
at PluginClassLoader for github-api//org.kohsuke.github.Requester.fetchInto(Requester.java:102)
at PluginClassLoader for github-api//org.kohsuke.github.GHPerson.populate(GHPerson.java:60)
at PluginClassLoader for github-api//org.kohsuke.github.GHPerson.getName(GHPerson.java:208)
at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyPullRequests$CacheUpdatingIterable.observe(GitHubSCMSource.java:2580)
at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyPullRequests$CacheUpdatingIterable.observe(GitHubSCMSource.java:2558)
at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.SinglePassIterable$1.next(SinglePassIterable.java:91)
at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait$ExcludeOriginPRBranchesSCMHeadFilter.isExcluded(BranchDiscoveryTrait.java:219)
at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.isExcluded(SCMSourceRequest.java:196)
at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:333)
at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:249)
at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1070)
at PluginClassLoader for scm-api//jenkins.scm.api.SCMSource._retrieve(SCMSource.java:372)
at PluginClassLoader for scm-api//jenkins.scm.api.SCMSource.fetch(SCMSource.java:282)
at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:660)
at PluginClassLoader for cloudbees-folder//com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:272)
at PluginClassLoader for cloudbees-folder//com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:170)
at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1063)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:454)
Contributor guide
Research direction
Start at src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java around line 2585, where pull-request indexing encounters the Copilot user. Reproduce scanning a repository with an open Copilot pull request and trace the reported exception. Done means indexing no longer fails on the missing user and orphan items can still be removed; the issue also raises a separate policy question about running CI for Copilot-authored changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, java
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100