Description
Feature Description
main error happening on jenkins server PushEvent triggering
2023-09-23 04:19:37.733+0000 [id=17] INFO o.j.p.g.w.s.DefaultPushGHEventSubscriber#onEvent: Received PushEvent for null from http://jenkinsdomain.com/github-webhook/
2023-09-23 04:19:37.733+0000 [id=17] SEVERE o.j.p.g.e.GHEventsSubscriber$4#applyNullSafe: Subscriber org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber failed to process SCMEvent
hook, skipping...
java.lang.NullPointerException
at org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber.onEvent(DefaultPushGHEventSubscriber.java:79)
I find out that in https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/org/jenkinsci/plugins/github/webhook/subscriber/DefaultPushGHEventSubscriber.java#L76
URL repoUrl = push.getRepository().getUrl();
https://github.com/hub4j/github-api/blob/main/src/main/java/org/kohsuke/github/GHObject.java#L98-L100
public URL getUrl() {
return GitHubClient.parseURL(url);
}
https://github.com/hub4j/github-api/blob/main/src/main/java/org/kohsuke/github/GHObject.java#L31
private String url;
it is trying to get url data from payload object of GHRepository
https://github.com/go-gitea/gitea/blob/main/modules/structs/repo.go#L50-L110
but in Repository struct there don't have any url variable
I test it adding the variable and it's now not showing NullPointerException on jenkins server.
2023-09-23 04:21:20.539+0000 [id=16] INFO o.j.p.g.w.s.DefaultPushGHEventSubscriber#onEvent: Received PushEvent for http://giteadomain.com/user/reponame from http://jenkinsdomain.com/github-webhook/
2023-09-23 04:21:20.607+0000 [id=16] INFO o.j.p.g.w.s.DefaultPushGHEventSubscriber$1#run: Poked test
2023-09-23 04:21:29.772+0000 [id=616] INFO c.c.jenkins.GitHubPushTrigger$1#run: SCM changes detected in test. Triggering #11
Screenshots
No response