Gitlab runs too many deploys

Hello Netlify team!
We have 2 issues with gitlab integration in netlify:

  1. Every time somebody resolves threads to merge request or approves it - netlify runs new deployment for this branch. Is it possible to not run it every time we do these actions?
  2. When we merge something or just create a new merge request - sometimes netlify runs not 1 deployment process, but it can be 2 or 3 of them - for the same branch.

Hope it can be solved somehow

Hey @alisakova,

Which site is this about?

@hrishikesh Hello :slight_smile:
I want to remind you about this problem with duplicate deploys.

hey alisa,

can you explain the problem you are experiencing in a different way? I am having some trouble following along. Are there any build logs or errors, screenshots that you can share?
Is the behaviour you are describing blocking you from deploying?

Hello, @perry !
We have several problems:

  1. For example, a developer pushes some changes to MR. Netlify should run a new deploy. But sometimes it runs not one deploy, but 3 or even 5 deploy simultaneously. It doesn’t break deploy process, but it wastes our build minutes
  2. If we have a MR to master and somebody approves this MR, then Netlify runs a new deploy after approving even if MR doesn’t have any changes.

Hope now it sounds clearer.

How to Ignore Builds - Optimize your Netlify Build Times and [Support Guide] How can I optimize my Netlify build time? have some tips on how to ignore certain types of commits that might be useful if the builds you don’t want are triggered by commits.

With Gitlab specifically, Disable auto building when creating and editing MRs - #4 by luke has some tips on how to configure their webhook settings to result in fewer Netlify builds, this might be useful if the builds you don’t want are triggered by events from Gitlab rather than actual commits.

2 Likes

Hello, @philw
I tried this solution for my problem:

[build]
  ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ."

It works fine for merge request approves, but I still don’t understand why one commit leads to 3-5 deploys in Netlify.

Hey there, @alisakova :wave:

Thanks so much for following up here. Can you please share the URL to your site as well as your most recent deploy log? This is a specific case we would need to look into further.

@hillary Hello! Sure, but can I do it privately? Can’t share it here.

You can post that information publicly or you can private message (PM) that to one of our support staff. I’ve confirmed that PMs are enabled for your forum login. Please keep in mind that only one person can see the PM and this will likely mean a slower reply than posting the information publicly. Please feel free to reply to however you prefer though.

Hey there, @alisakova :wave:

Sorry about the delay, I was offline when you sent me that DM with information. I have shared it with my team and we will continue to look into this.

1 Like

Hi @alisakova

Seems like you probably have multiple configurations targeting our service at GitLab. Could you check the GitLab settings for that repo (under Settings → Webhooks, and scrolling down to the bottom) to see if there are multiple instances of Netlify hooks?

If you don’t see multiple hooks there, could you send me that same screenshot from your browser so I can see what you see there to try to figure out some other reason it could be happening? Thank you :slight_smile:

2 Likes

Hello!
Thank you for the tip, I found a lot of webhooks for netlify there. I deleted most of them, hope it will work!

2 Likes

Thanks for letting us know. Should you encounter this obstacle in the future, just follow up on this thread with a screenshot from your browser.

Happy building :rocket: