voxpupuli / webhook-go

Puppet Webhook port in Golang
Apache License 2.0
16 stars 12 forks source link

Add a 'branch_only' parameter for /module #134

Closed raincz closed 8 months ago

raincz commented 9 months ago

When passing this parameter, it tries to detect the branch from the module as well and apply it using the -e parameter to r10k. For modules that are branch-linked with the main repository, this will trigger an update only to the respective environment, rather than all environments.

raincz commented 9 months ago

This addresses issue https://github.com/voxpupuli/webhook-go/issues/133 as described.

dhollinger commented 9 months ago

Where does the branch_only option come from? The incoming request? A header? A config option?

I see the logic for acting on if branch_only gets passed in, but not where it can get set.

raincz commented 9 months ago

(sorry, missed the notification) It comes from the URL. ie http://<host:port>/api/v1/r10k/module?branch_only=1

raincz commented 9 months ago

A personal note to our use case: Gitlab (or any other git manager for that matter) doesn't really understand your puppet structure, or which repository is base puppet and which is a module. But they usually have the webhooks configured on a per-repository basis, so it makes sense that you would have the ability to distinguish/force this sort of stuff directly in a particular webhook URL. You already have to switch between api/.../environment and api/.../module anyway, so adding other context-dependent options was the most logical implementation for me.

raincz commented 8 months ago

Hello @dhollinger , is there anything else I should do for this? Any issues with the patch I should fix?

dhollinger commented 8 months ago

I have to look into why it isn't letting me merge. The GitHub Android app isn't clear on the reason. I'll take a look at it a little later today. If I get it fixed, I can get it merged

raincz commented 8 months ago

Thanks!