Netlify triggers build on any Bitbucket pull request edit

  • We need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.

Can discuss in private if needed.

  • Build problems? Link or paste the FULL build log & build settings screenshot

It’s more with triggering the build.

I’ve recently noticed that any change to a pull request in Bitbucket seems to trigger builds in Netlify. This includes non-code changes, such as edits to the PR description.

I’m not using webhooks directly.

I’m using a custom ignore script (which does at least cancel the build, but it needs to instantiate the build container to get this far).

Is this a bug, or a feature that can be switched off?

Although it’s not a critical issue, the build queue quickly gets stacked up with builds from a monorepo when making simple text edits and causes unnecessary waiting for anyone else making actual changes.

I’m not aware of any scenario (for any site) where the description of the PR in Bitbucket (as opposed to code) would actually affect the build output.

Hi, @robations. This detail is technically incorrect (if one is being pedantic about it):

I’m not using webhooks directly.

All builds at Netlify from repositories hosted at Bitbucket are triggered by webhooks configured at Bitbucket. This means webhooks are definitely being used here.

The solution will be to go into the Bitbucket configuration for that webhook to change when it is triggered. If there are other questions about this, please let us know.

Hi Luke, thanks for your reply.

What I mean is that I’ve not set up any webhooks myself. I presume these are used behind the scenes between BB and Netlify.

The projects are connected using the Bitbucket repo integration, which automatically triggers builds on pull requests. In fact, I now see that (as part of the integration), Netlify has created a webhook within BB with the following params:

From my POV, Netlify has either requested too many params here (in which case I can edit), or it’s misinterpreting the responses to trigger builds unnecessarily.

Any thoughts?

Rob.

Hi Rob,

In that screenshot, it looks like under Pull Requests “Updated” is checked, which would explain why you’re seeing builds triggered when you update a PR. Can you try unchecking that box? Similarly, you can uncheck any of the other options to narrow down when the build is triggered.

@sid.m Thanks, have adjusted and will see if that improves things.

Part of my point is that Netlify set those options (as far as I know) so I was expecting Netlify to handle these update messages meaningfully.

If this is a systematic problem you might have some percentage of unnecessary builds across your platform, increasing costs and carbon footprint etc. But I don’t want to labour the point!

I’m also wondering if this hook was manually added so long ago no one can remember it. Before Netlify had an automated integration for Bitbucket.

Could this be the case? Would explain confusion above. I’ll might try disabling it and see if the builds still work.

Hi, @robations. Sometimes it is quite helpful to “labour the point” and I believe it was helpful in this cases.

I just tested making a new site linked to a Bitbucket repository and I get the same default permissions that you shared in your screenshot:

This means that there hasn’t been a change. This is the same it has always been.

That said, many of those defaults do appear to be unnecessary. We’ll get a feature request filed to revisit the default triggers for the automatically created webhooks when linking a Bitbucket repo to a site at Netlify.

Thanks for taking the extra time to clarify your point. It is definitely a valid point in my opinion as well.

Also, please do feel free to manually edit those triggers as you see fit. You won’t break anything at Netlify and that will allow you to better limit when new builds are triggered.

1 Like