Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-41246

Branch scanning fails when PR refer to a deleted fork

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hi!

      I noticed that, when scanning a repository, when the source fork of a pull request have been deleted the scan fails:

      Checking pull request #5146
      ERROR: [Fri Jan 20 10:07:04 CET 2017] Could not fetch branches from source org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator::https://api.github.com::xxx::xxx
      java.lang.NullPointerException
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.doRetrieve(GitHubSCMSource.java:553)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:433)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:516)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:187)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:139)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:874)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:404)
      [Fri Jan 20 10:07:04 CET 2017] Finished branch indexing. Indexing took 18 sec
      FATAL: Failed to recompute children of Xxxxx » xxxxxx
      java.lang.NullPointerException
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.doRetrieve(GitHubSCMSource.java:553)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:433)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:516)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:187)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:139)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:874)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:404)
      Finished: FAILURE
      

      Could it be possible to skip those pull requests ? The best would be to be able to build a temporary branch and apply the patch provided by github but any workaround would be appreciated

        Attachments

          Issue Links

            Activity

            Hide
            stephenconnolly Stephen Connolly added a comment -

            I believe this is fixed by JENKINS-43507. It would be great if you could confirm by partaking in the alpha-testing: https://groups.google.com/d/msg/jenkinsci-users/GrOI6DZ7U4k/UstZZSl_AgAJ

            Show
            stephenconnolly Stephen Connolly added a comment - I believe this is fixed by JENKINS-43507 . It would be great if you could confirm by partaking in the alpha-testing:  https://groups.google.com/d/msg/jenkinsci-users/GrOI6DZ7U4k/UstZZSl_AgAJ
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/a0c20fbfb1bace3211f78aa0b8a0c24653e4c8bf
            Log:
            [FIXED JENKINS-41246] Guard against PRs from deleted forks

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java http://jenkins-ci.org/commit/github-branch-source-plugin/a0c20fbfb1bace3211f78aa0b8a0c24653e4c8bf Log: [FIXED JENKINS-41246] Guard against PRs from deleted forks
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/9abb96c49b56b3ca04a02d0d3e9d74d4e3e79ed7
            Log:
            JENKINS-41246 Would help to actually do the null check I added a comment about

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java http://jenkins-ci.org/commit/github-branch-source-plugin/9abb96c49b56b3ca04a02d0d3e9d74d4e3e79ed7 Log: JENKINS-41246 Would help to actually do the null check I added a comment about
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/ab97be962b05e0dd2d78214437747e0839c1fbfb
            Log:
            Merge pull request #143 from stephenc/jenkins-41246

            [FIXED JENKINS-41246] Guard against PRs from deleted forks

            Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/675bb4ae3628...ab97be962b05

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java http://jenkins-ci.org/commit/github-branch-source-plugin/ab97be962b05e0dd2d78214437747e0839c1fbfb Log: Merge pull request #143 from stephenc/jenkins-41246 [FIXED JENKINS-41246] Guard against PRs from deleted forks Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/675bb4ae3628...ab97be962b05
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/2c8d31f7b6b0f89587e6973714e643403e4b9a60
            Log:
            [FIXED JENKINS-41246] Guard against PRs from deleted forks

            Cherry-pick forward of a0c20fbfb1bace3211f78aa0b8a0c24653e4c8bf

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java http://jenkins-ci.org/commit/github-branch-source-plugin/2c8d31f7b6b0f89587e6973714e643403e4b9a60 Log: [FIXED JENKINS-41246] Guard against PRs from deleted forks Cherry-pick forward of a0c20fbfb1bace3211f78aa0b8a0c24653e4c8bf

              People

              • Assignee:
                stephenconnolly Stephen Connolly
                Reporter:
                clementgautier Clement Gautier
              • Votes:
                3 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: