Duplicated deploys and duplicated webhooks

Hi Jay!

We don’t provide any guarantees like that. Specifically:

  • we do TRY to start a deployment with every hook sent (which you can re-configure at GitLab differently than our default, so I won’t say “per commit” but instead “per notification received”), but if there is a bug or outage, it could fail to happen (fail to start, fail to complete, fail to be queued to start later).
  • we do NOT try to block you from double or quintuple deploys. We trust that you will configure things well and if you ask us to build twice, we build twice. If you queue up a few deploys on the same site and branch, we WILL skip the middle ones - but not the first and last, so in your case - we built the first and last.

So, how can you be sure you won’t build extra, or that you’ve built at least once? No direct feature here for that, but some suggestions:

  1. the usual reason for the duplicated deploys is misconfiguration at GitLab - you have duplicate webhooks. Mind checking the config, here to see if you have >1?
  2. you could use the ignore script to try to prevent a second build from running: File-based configuration | Netlify Docs

How would you accomplish #2? Kind of the swiss army knife - our API! [Support Guide] Understanding and using Netlify's API has more details, but some specific things that may help:

  1. you can (in your ignore script) query (via API) if a site is already building on a given branch, and choose to cancel the second build
  2. you can choose to use build hooks that you trigger instead of relying on your git provider: Build hooks | Netlify Docs

Hope that gives you enough options to come up with a solution that works for you.