abrader-gms icon indicating copy to clipboard operation
abrader-gms copied to clipboard

git_webhook doesn't change hook after it's been created

Open bschonec opened this issue 6 years ago • 2 comments

On GitLab (Github untested), the git_webhook resource doesn't modify the webhook if it already exists:

git_webhook { 'web_post_receive_webhook' : ensure => present, webhook_url => 'http://puppetserver.example.com:8088/payload', token => hiera('gitlab_api_token'), project_name => 'puppet/control-repo', server_url => 'http://gitlab.example.com', provider => 'gitlab', disable_ssl_verify => false, }

This successfully creates the webhook, but if you change: disable_ssl_verify => true the webhook on Gitlab doesn't get updated.

bschonec avatar Apr 10 '18 13:04 bschonec

Interesting. Will take a look to see what needs to be included in next release.

abrader avatar Oct 30 '18 16:10 abrader

Updating several years later, the merge_request_events parameter doesn't update the Push event webhook if you change from true/false and re-run puppet. The issue is that the code only checks for the existence of the webhook on the Gitlab server - it does not check the validity of the parameters. https://github.com/abrader/abrader-gms/blob/0b90825a53b6b6f9ab87844550051febb8dfc7d4/lib/puppet/provider/git_webhook/gitlab.rb#L82 Again, Gitlab only.

bschonec avatar Apr 06 '22 15:04 bschonec