gitgitlabwebhookstaiga

Taiga+GitLab integration: only enable for master branch?


At work we use GitLab and Taiga.

So we enabled the integration between them, and now when a developer pushes a commit that includes the text TG-XYZ #closed then the taiga issue with number XYZ gets closed and a comment is placed in it auomatically.

This is definitely great. However, it doesn't work well with MergeRequests (or feature branches in general): as we don't want to close the taiga issue until the MergeRequest is merged to master.

How to restrict this integration to only work with the master branch?


Solution

  • We've found a workaround that is good enough: create MergeRequests only from forks of the repository instead of from branches in the repository.

    If you want to enforce this policy so that your devs don't break it by mistake, you can go use the "Protect branches" feature in gitlab and use a wildcard (*) to not allow any creation of new branches (this way they will be able to push branches on each developer's fork, and so the notifications to Taiga will only arrive when the MR is merged to master).