Bug 1383070

Summary: Generic webhook does not filter based on branch
Product: OpenShift Container Platform Reporter: Ian Tewksbury <itewksbu>
Component: RFEAssignee: Ben Parees <bparees>
Status: CLOSED CURRENTRELEASE QA Contact: Wang Haoran <haowang>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.3.0CC: akestert, aos-bugs, javier.ramirez, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-19 12:50:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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