Bug 1383070 - Generic webhook does not filter based on branch
Summary: Generic webhook does not filter based on branch
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: RFE
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: Wang Haoran
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-09 14:48 UTC by Ian Tewksbury
Modified: 2020-12-14 07:47 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-19 12:50:36 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Ian Tewksbury 2016-10-09 14:48:46 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Ian Tewksbury 2016-10-09 14:54:07 UTC
Apologies bugzilla submitted before I finished filling it out.

Description of problem:

When a generic webhook is called it rebuilds the build config no matter which branch is pushed too.

According to https://github.com/gitlabhq/gitlabhq/issues/1176 GitLab (and I assume others) expect the listener of the hook to filter based on branch rather then the Git implementer to filter based on branch.

OCP should have an option to specify which branch to trigger on when implementing a generic webhook.


How reproducible:

RFE

Steps to Reproduce:
1. configure a webhook for GitLab
2. push to any branch of project
3. OCP triggers a build no matter which branch is being pushed to.

Actual results:

Need option to only trigger on specific branches.

Expected results:

If pushing to "test" branch and S2I build is using master branch, build should not be triggered.

Comment 2 Ian Tewksbury 2016-10-09 14:57:16 UTC
It is understood that this is "generic web hook" but this seems to be a rock and a hard place. GitLab expects the listener to filter on branch, but OCP only has "generic web hook" which is not specific to git.

Maybe some sort of option on the generic web hook to filter based on payload but not specific to any particular payload, like that coming from GitLab. THus a user could say, if XYZ is in the payload filter on that. SO then no matter where the generic web hook is coming from it is not specific to any one invoker and would be more flexible.

Comment 3 Ben Parees 2017-01-16 15:25:54 UTC
Current plan is to support this by implementing a gitlab webhook rather than adding more configurable behavior to the generic webhook.

Comment 4 Ian Tewksbury 2017-01-16 18:11:32 UTC
@Ben,

Cool. Thanks for the update.

Comment 5 Anthony Kesterton 2017-01-31 11:01:39 UTC
I have received a request from a customer to support BitBucket web hook payloads too - see https://trello.com/c/AXgwIW7b


Note You need to log in before you can comment on or make changes to this bug.