mohamicorp / stash-jenkins-postreceive-webhook

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

Don't hardcode the stash pull url at config time #100

Closed bbaetz closed 9 years ago

bbaetz commented 9 years ago

This change sets up the http-vs-ssh selection of the URL to be configurable, but the actual URL is only resolved when trying to do a notification. The main benefit of this is that repositories that are moved/renamed automatically pick up the change, but another benefit is that it makes it slightly easier to script up the default config when creating a new repository.

Custom urls are still permitted, in case there are users with special needs (eg jenkins not using the standard hostname because its behind a reverse proxy, or something)

Existing config is treated as 'custom', but auto-corrected when the hook config is saved. That means that any existing repositories will still have the hard-coded URL and so will NOT automatically update their URL when moved. (There's no easy way I could work out to do a data migration when the plugin was updated)

mikesir87 commented 9 years ago

Great idea! I hadn't even thought of this. And nice backwards-compatibility in there too. Thanks again for another pull request!