jenkinsci / jenkinsci/github-branch-source-plugin

[JENKINS-56468] githubPRComment throws NPE

Open
#1,243 4 comments 0 reactions 0 assignees View on GitHub
component:github-branch-source-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

the following stage generates NPE, even when built against a PR:

stage ('mobileproduct - Prebuild') {

 githubPRComment comment: githubPRMessage('Build ${BUILD_NUMBER} ${BUILD_STATUS}')

}

 

the following NPE is generated:

java.lang.NullPointerException

at org.jenkinsci.plugins.github.pullrequest.utils.JobHelper.getGhRepositoryFromPRTrigger(JobHelper.java:161)

at org.jenkinsci.plugins.github.pullrequest.utils.JobHelper.getGhPullRequest(JobHelper.java:177)

at org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRCommentPublisher.perform(GitHubPRCommentPublisher.java:73)

at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)

at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)

at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Finished: FAILURE

the checkout phase checks out multiple projects, even though I am not sure it's supposed to matter.

---
Originally reported by gilbahat, imported from: githubPRComment throws NPE


  • status: Open
  • priority: Minor
  • component(s): github-branch-source-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 3
  • imported: 2025-12-02

Raw content of original issue

the following stage generates NPE, even when built against a PR:

stage ('mobileproduct - Prebuild') {

 githubPRComment comment: githubPRMessage('Build ${BUILD_NUMBER} ${BUILD_STATUS}')
}

 

the following NPE is generated:
java.lang.NullPointerException
at org.jenkinsci.plugins.github.pullrequest.utils.JobHelper.getGhRepositoryFromPRTrigger(JobHelper.java:161)
at org.jenkinsci.plugins.github.pullrequest.utils.JobHelper.getGhPullRequest(JobHelper.java:177)
at org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRCommentPublisher.perform(GitHubPRCommentPublisher.java:73)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

the checkout phase checks out multiple projects, even though I am not sure it's supposed to matter.

  • environment: Jenkins 2.150.3. branch source plugin 2.4.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.