mohamicorp / stash-jenkins-postreceive-webhook

Webhook used to notify Jenkins when commits are made to Stash
Other
138 stars 98 forks source link

The plugin could be made more generic #17

Open GaretJax opened 11 years ago

GaretJax commented 11 years ago

I installed this plugin and I am currently using it to notify my buildbot. Currently there is almost nothing Jenkins specific in this plugin and it could be used as a generic webhook.

One exception is that the plugins unconditionally adds the /git/notifyCommit?url=... part to the URL, but the whole generated URL could be put in the Jenkins URL field as well. It's a little less user friendly, but much more flexible.

mikesir87 commented 11 years ago

This is very similar to the request in issue #14. I have considered this approach, but not all webhook URLs are just simple GET requests. Some require authentication (OAuth, Basic, etc.), some webhooks want POST data in a certain format, etc.

The current thought is this plugin may be able to expand to a generic webhook plugin as long as the other end is a simple GET request. If it's more than that, it'll have to be considered on a case-by-case basis and may just require its own custom plugin.

Make sense?

GaretJax commented 11 years ago

Absolutely. Actually, just being able to specify the whole URL (as it is a constant anyway and does not contain any change-specific data) would be enough.

For more complex webhooks, I agree with you, specific solutions are more appropriate.

A possible way maintain the current user-friendliness for Jenkins users: a simple javascript callback which shows the Jenkins-specific URL while typing it in (i.e. appending /git/notifyCommit?url=...) and a button to copy it to the input field may be enough.

CSchulz commented 10 years ago

Hello,

perhaps it is possible for you to deliver an "extension point", which allows generic description of the expected format on the other side. I haven't checked if it is possible to create Plugins for Plugin otherwise a simple xml upload describing the format would do the same.

ggmsfo commented 9 years ago

I would also like this feature.