[x] I have checked that another pull request for this purpose does not exist.
[x] I have considered, and confirmed that this submission will be valuable to others.
[ ] I have created or updated the relevant documentation for this change on the PHPCI Wiki.
[ ] Do the PHPCI tests pass?
Detailed description of change:
When working with GIT webhooks every commit of every contributor triggers a build in PHPCI. As I have very time consuming acceptance tests with Codeception and my contributors are pushing a lot of stuff PHPCI is always very busy. For me there is no need to run all tests for every commit on every branch. Important for me is my master branch and my release candidate branches where I put all branches of my contributors together to see if it works.
So I've added a textarea with the name "observed_branches" to the project configuration page.
Before a build is triggered via webhook by WebhookController::createBuild I check if the requestet branch is in the projects branch observation by getting the text from "observed_branches" and exploding it by PHP_EOL. After that I'll check if the branch name submitted by the webhook is in my exploded array. If not I will not create the build.
If the project option "observed_branches" is empty all incoming branch names are triggering a build creation as it is now.
You may also use the * sign as a wildcard for branch names when configuring the "observed_branches" option, as I use this for my RC branches. For example a configuration like
master
rc-*
would accept a build creation via webhook for the "master" branch and all branch names starting with "rc-"
Contribution Type: new feature
This pull request affects the following areas:
In raising this pull request, I confirm the following (please check boxes):
Detailed description of change:
When working with GIT webhooks every commit of every contributor triggers a build in PHPCI. As I have very time consuming acceptance tests with Codeception and my contributors are pushing a lot of stuff PHPCI is always very busy. For me there is no need to run all tests for every commit on every branch. Important for me is my master branch and my release candidate branches where I put all branches of my contributors together to see if it works. So I've added a textarea with the name "observed_branches" to the project configuration page. Before a build is triggered via webhook by WebhookController::createBuild I check if the requestet branch is in the projects branch observation by getting the text from "observed_branches" and exploding it by PHP_EOL. After that I'll check if the branch name submitted by the webhook is in my exploded array. If not I will not create the build. If the project option "observed_branches" is empty all incoming branch names are triggering a build creation as it is now. You may also use the * sign as a wildcard for branch names when configuring the "observed_branches" option, as I use this for my RC branches. For example a configuration like
would accept a build creation via webhook for the "master" branch and all branch names starting with "rc-"
Maybe this can be helpful to others.