jenkinsci / jenkinsci/github-branch-source-plugin
[JENKINS-56565] Retry on failure
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 218
- Forks
- 399
- Avg merge
- 30m
- Merged PRs (30d)
- 1
Description
Sometimes the plugin will have an error during the "scan organization" process:
ERROR: Failed to create or update a subproject foo-bar org.kohsuke.github.GHException: Failed to retrieve https://api.github.com/repos/foo/bar/pulls?state=open at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:529) at org.kohsuke.github.Requester$PagingIterator.hasNext(Requester.java:494) at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:44) at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:32) at org.jenkinsci.plugins.github_branch_source.SinglePassIterable.iterator(SinglePassIterable.java:55) at org.jenkinsci.plugins.github_branch_source.LazyIterable.iterator(LazyIterable.java:59) at org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait$ExcludeOriginPRBranchesSCMHeadFilter.isExcluded(BranchDiscoveryTrait.java:236) at jenkins.scm.api.trait.SCMSourceRequest.isExcluded(SCMSourceRequest.java:198) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:335) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:251) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:917) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:374) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:328) at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria.recognizes(MultiBranchProjectFactory.java:263) at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.recognizes(OrganizationFolder.java:1347) at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.complete(OrganizationFolder.java:1362) at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:256) at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:206) at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.visitSources(GitHubSCMNavigator.java:966) at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:459) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165) at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:911) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)
This can also sometimes be in form of a "404". But I haven't seen any errors due to API rate limits yet. And if I re-scan directly there after everything works fine. I am assuming github's API is having a hiccup at that moment.
Unfortunately this means that the project will be disabled for that moment and/or PRs will not be auto-detected anymore.
Would there be any possibility to build in a retry mechanism (maybe configurable)?
Originally reported by
lifeofguenter, imported from: Retry on failure
- status: Open
- priority: Minor
- component(s): github-branch-source-plugin
- resolution: Unresolved
- votes: 0
- watchers: 1
- imported: 2025-12-02
Raw content of original issue
Sometimes the plugin will have an error during the "scan organization" process:
ERROR: Failed to create or update a subproject foo-bar org.kohsuke.github.GHException: Failed to retrieve https://api.github.com/repos/foo/bar/pulls?state=open at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:529) at org.kohsuke.github.Requester$PagingIterator.hasNext(Requester.java:494) at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:44) at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:32) at org.jenkinsci.plugins.github_branch_source.SinglePassIterable.iterator(SinglePassIterable.java:55) at org.jenkinsci.plugins.github_branch_source.LazyIterable.iterator(LazyIterable.java:59) at org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait$ExcludeOriginPRBranchesSCMHeadFilter.isExcluded(BranchDiscoveryTrait.java:236) at jenkins.scm.api.trait.SCMSourceRequest.isExcluded(SCMSourceRequest.java:198) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:335) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:251) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:917) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:374) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:328) at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria.recognizes(MultiBranchProjectFactory.java:263) at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.recognizes(OrganizationFolder.java:1347) at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.complete(OrganizationFolder.java:1362) at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:256) at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:206) at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.visitSources(GitHubSCMNavigator.java:966) at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:459) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165) at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:911) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)
This can also sometimes be in form of a "404". But I haven't seen any errors due to API rate limits yet. And if I re-scan directly there after everything works fine. I am assuming github's API is having a hiccup at that moment.
Unfortunately this means that the project will be disabled for that moment and/or PRs will not be auto-detected anymore.
Would there be any possibility to build in a retry mechanism (maybe configurable)?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the organization-scan path through GitHubSCMNavigator.visitSources, GitHubSCMSource.retrieve, and the BranchDiscoveryTrait stack-trace entry point. Review how failures from GitHub API requests are handled; done means transient scan errors can be retried and the scan does not remain disabled after a temporary failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, java
- Domain
- api, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100