mohamicorp / stash-jenkins-postreceive-webhook

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

v2.7.0 Changes/Breaks Rest API for creating Hooks #139

Open kbaltrinic opened 9 years ago

kbaltrinic commented 9 years ago

I am not sure if this was intended or an unexpected a side effect, but I think its the result of adaa1a7. Our automated hook creation script is now returning 400 bad request with the following response JSON:

{"errors":[{"context":"cloneType","message":"The repository clone type is required","exceptionName":null}]}

Adding "cloneType": "ssh" to the posted JSON fixes the issue but seems like it should not be necessary.

mikesir87 commented 9 years ago

The reason this was added was to prevent a broken URL if a repository was renamed, stash host was renamed, etc. Previously, the URL was determined at config time and stored. Now, with only the cloneType being stored, it allows for these changes to occur. So, it is necessary at this point, as the codebase relies on it when sending the notification.

I wasn't aware that there was the programatic API to setup the webhook (until the linked issue came up... still learning new things all the time about what's available) and that people are actually using it. I'll make a better effort in the future about documenting these types of changes for you and others that might be using that API.

thrownullpointer commented 7 years ago

I think it's fine you need to provide all parameters when updating the hook.