Gitlab: merge request meta data change triggers bitrise builds

Description

Steps to reproduce

  1. Connect a bitrise project to a gitlab instance.
  2. Set bitrise up so that it builds new merge requests.
  3. Create a merge request in gitlab.
  4. Observe that bitrise builds as expected.
  5. Change the assignee.
  6. Observe that bitrise builds again.

Status quo

Right now bitrise cannot distinguish between a real code change to a merge request and a meta data change.

@viktorbenei already said that this might be due to gitlab’s webhook not sending any information what exactly changed in a PR thus leaving bitrise blind meaning that bitrise will build every time the webhook is triggered as it MIGHT be caused by code changes.

Next steps

First step would likely be to check what information exactly the gitlab webhook exposes.

If the webhook doesn’t provide the information needed bitrise would likely have to query gitlab for changes to the git branch as soon as the webhook is triggered. If the tip of the branch has already been build no new build needs to be triggered.

Impact

Improving this could dramatically decrease the number of builds for all gitlab users.

Hi @ubuntudroid!

Sorry as we’re fairly late to reply here. Thanks for the #feature-request! We actually have an internal card for this issue and are looking for alternatives and possible solutions. Will make sure to let you know as soon as we have an update to provide! :slight_smile:

2 Likes

I saw this too late (also this), but I also created an issue about this on GitHub:
https://github.com/bitrise-io/bitrise-webhooks/issues/81

I had dug a bit into this and saw that GitLab is sending all the required information to distinguish different actions, but Bitrise’s webhook for GitLab (last updated in 2017) doesn’t take this into account.

I was told the internal ticket is probably low-priority compared to other stuff, so if you want it fixed faster, feel free to open a pull request. :wink:

2 Likes

So I caved and proposed a fix.

Hopefully someone has the bandwidth to check it out… :pleading_face:

3 Likes

Hello thanks for the PR, I created a card for the tooling team to review it! :upside_down_face:

1 Like

Hey @ubuntudroid,

We’ve reviewed and released the PR of @usmonster, so I close this feature request, thank you again for opening :slight_smile:

2 Likes

This has been marked as solved so I’m going to set it to auto-close in a week.

This topic was automatically closed after 6 days. New replies are no longer allowed.