Any plugin to send email to GitHub push webhook "pusher.email" field?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Any plugin to send email to GitHub push webhook "pusher.email" field?

Dan Mick

We're using the GitHub plugin extensively, and have push webhooks set up for triggering lots of builds. 

I'm now looking at trying to use the github-supplied email address for the github user that pushed the change; this is available in the json payload of the webhook as "pusher.email" (there is also a pusher.name field that contains just the github username, and this is shown in various places in the UI from the GitHub plugin).

I can't see anything in the GitHub plugin that parses this info, which may be the root of the problem (or it could be that I'm just missing it; Java is not my first language).  I'm not clear enough on the structure of plugins to know if that plugin is the only one that ever processes the webhook payload from github or not.  I can't see any reference to it in the email-ext plugin or the Mailer plugin documentation either.

Does anyone know how to extract and use that email address in a plugin or combination of plugins?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/56729718-e7cc-4525-9d98-09910ff2a6f9n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Any plugin to send email to GitHub push webhook "pusher.email" field?

Xiong Kezhi
If you want to parse the email address out of the payload each time your Jenkins receives a push event, I think you may need to take a look at the https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/org/jenkinsci/plugins/github/webhook/subscriber/DefaultPushGHEventSubscriber.java. It will encapsulate the even payload as objects using GitHub API: https://github.com/hub4j/github-api

在2020年9月3日星期四 UTC+8 下午8:21:20<Dan Mick> 写道:

We're using the GitHub plugin extensively, and have push webhooks set up for triggering lots of builds. 

I'm now looking at trying to use the github-supplied email address for the github user that pushed the change; this is available in the json payload of the webhook as "pusher.email" (there is also a pusher.name field that contains just the github username, and this is shown in various places in the UI from the GitHub plugin).

I can't see anything in the GitHub plugin that parses this info, which may be the root of the problem (or it could be that I'm just missing it; Java is not my first language).  I'm not clear enough on the structure of plugins to know if that plugin is the only one that ever processes the webhook payload from github or not.  I can't see any reference to it in the email-ext plugin or the Mailer plugin documentation either.

Does anyone know how to extract and use that email address in a plugin or combination of plugins?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3c50a97a-f42b-4d3f-90a2-50cbc645ccb1n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Any plugin to send email to GitHub push webhook "pusher.email" field?

Dan Mick
Well, I'd rather not try to enter the world of writing plugins, but I'd
like to accomplish this as a user.  I found that code, which is what
made me believe GitHub-the-plugin wasn't parsing it.  But, as I said,
I'm not certain that's proof that it's not available anywhere.  This
seems like such a common desire that I'm led to believe I might be
missing some way to use the existing plugin(s).

On 9/3/2020 8:34 AM, Xiong Kezhi wrote:

> If you want to parse the email address out of the payload each time your
> Jenkins receives a push event, I think you may need to take a look at
> the https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/org/jenkinsci/plugins/github/webhook/subscriber/DefaultPushGHEventSubscriber.java.
> It will encapsulate the even payload as objects using GitHub API:
> https://github.com/hub4j/github-api
>
> 在2020年9月3日星期四 UTC+8 下午8:21:20<Dan Mick> 写道:
>
>
>     We're using the GitHub plugin extensively, and have push webhooks
>     set up for triggering lots of builds.
>
>     I'm now looking at trying to use the github-supplied email address
>     for the github user that pushed the change; this is available in the
>     json payload of the webhook as "pusher.email" (there is also a
>     pusher.name <http://pusher.name> field that contains just the github
>     username, and this is shown in various places in the UI from the
>     GitHub plugin).
>
>     I can't see anything in the GitHub plugin that parses this info,
>     which may be the root of the problem (or it could be that I'm just
>     missing it; Java is not my first language).  I'm not clear enough on
>     the structure of plugins to know if that plugin is the only one that
>     ever processes the webhook payload from github or not.  I can't see
>     any reference to it in the email-ext plugin or the Mailer plugin
>     documentation either.
>
>     Does anyone know how to extract and use that email address in a
>     plugin or combination of plugins?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email]
> <mailto:[hidden email]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/3c50a97a-f42b-4d3f-90a2-50cbc645ccb1n%40googlegroups.com 
> <https://groups.google.com/d/msgid/jenkinsci-users/3c50a97a-f42b-4d3f-90a2-50cbc645ccb1n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b7dd6752-8b9c-405e-0c9d-fd9bba302f91%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Any plugin to send email to GitHub push webhook "pusher.email" field?

Dan Mick
In reply to this post by Dan Mick
On 9/2/2020 10:56 PM, Dan Mick wrote:

>
> We're using the GitHub plugin extensively, and have push webhooks set up
> for triggering lots of builds.
>
> I'm now looking at trying to use the github-supplied email address for
> the github user that pushed the change; this is available in the json
> payload of the webhook as "pusher.email" (there is also a pusher.name
> field that contains just the github username, and this is shown in
> various places in the UI from the GitHub plugin).
>
> I can't see anything in the GitHub plugin that parses this info, which
> may be the root of the problem (or it could be that I'm just missing it;
> Java is not my first language).  I'm not clear enough on the structure
> of plugins to know if that plugin is the only one that ever processes
> the webhook payload from github or not.  I can't see any reference to it
> in the email-ext plugin or the Mailer plugin documentation either.
>
> Does anyone know how to extract and use that email address in a plugin
> or combination of plugins?


Anyone?  I've tried and failed to figure out where to submit feature
requests for the plugin, even.  Tried emailing one of the prime
contributors, no response.

I know there is a getEmail() method to use, but I don't know how plugins
can add to the existing job environment; it's just beyond my Java abilities.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/rj3kl0%24b5%241%40ciao.gmane.io.