Expose committer not just author to conditionals

I want to be able filter out certain bot generated commits from triggering builds via the GitHub integration. Unfortunately it isn’t enough to be able to filter on commit author, because I still need builds to trigger after rebases which leave the bot commits on top. To this end, I’d like

build.committer.email
build.committer.id
build.committer.name
build.commiter.teams

to be exposed based on the commiter of the HEAD commit in addition to the author fields, which would be sufficient for me to do the filtering that I need.

Hey melzuser :wave:

Welcome to buildkite community! That’s an intresting use case you have there!

While we are looking into it, one thing that I have on top of my head is to levarage the use of Skipping builds | Buildkite Documentation feature, along with use of conditionals, provided your bot generated commits have a standard pattern that you can use to omit the builds out. Let us know if that works : )

Cheers !
Athreya

The only new relevant section is the “Ignore a commit” section and that suffers from the same issue with rebases that I was describing when trying to ignore with a conditional on the commit author.

Hey @melzuser!

Thanks for the follow up. I’m taking a look through the GitHub documentation and see now mention that the ID is even passed through via the webhook. Are you seeing otherwise?

Response when GETting a commit: REST API endpoints for commits - GitHub Docs

Webhook event payloads (sent from GitHub to Buildkite, for example): Webhook events and payloads - GitHub Docs

And looking through the webhook of a build that I created, I don’t see the id present:

CleanShot 2024-07-16 at 10.29.23

Cheers!

@benmc I just assumed there would be the name info for the committer as the author and I didn’t bother to check. I don’t really need the id. The name, email, and username is fine!

@melzuser thanks for the speedy reply!

I’m glad that the existing fields will suffice for now, hopefully GH expand their support/data soon!

Am I wrong that even though it’s in the webhook, there’s no way to filter on it currently?

Hi @melzuser ,

The build.committer information may be available in the webhook payload, however it is not translated into a build variable unlike with build.author. Thus it is not possible to filter steps within the build with this value.

Cheers!

Right, that’s what I thought. I was just verifying. Is that something that you’re likely to add?

Hey @melzuser,

One possible solution would be to add custom tags or labels to bot-generated commits on the GitHub side. These tags can then be used in your build filtering logic to exclude those commits from triggering builds. This approach allows you to manage and filter commits more effectively based on the tags you assign.

Docs: GitHub | Buildkite Documentation

Thanks!

I’d rather now use tags or labels or any other solution that requires stateful changes to the repo.

Hey @melzuser :wave:

Thanks for the update and keep us posted if any questions you have in future :)