feedback icon indicating copy to clipboard operation
feedback copied to clipboard

Build create: Unable to set the author of the build via the REST API

Open amitsaha opened this issue 7 years ago • 9 comments

I am using a custom client to create a build via the API. My payload looks as follows:

{
  "commit": "798746cc840c1270eb5e66c840ec4584add8c1d6",
  "branch": "test1",
  "message": "A commit message",
  "author": {
    "name": "Amit Saha",
    "email": "[email protected]"
  },
  "env": {
    "MY_ENV_VAR": ""
  },
  "meta_data": {
    "some build data": "",
    "other build data": false
  }
}

However, the UI still shows the API token creator as the build creator.

Any idea what I am doing wrong?

amitsaha avatar Jul 23 '18 00:07 amitsaha

Ok, so it looks like the Author that you provide must be a valid user in the organization, otherwise we fall back to the token owner.

lox avatar Jul 25 '18 02:07 lox

Ah right, thanks. But isn't that logic a bit awkward? The commit author doesn't necessarily have to be the one who pushed the commit and hence created the build.

Alternatively, is there another field to communicate whose commit triggered the build?

amitsaha avatar Jul 25 '18 02:07 amitsaha

Perhaps I didn't explain myself well, you can provide any author you like, provided they are a user in your Buildkite org. Is the author you are specifying not part of your org?

lox avatar Jul 25 '18 02:07 lox

Right, i should have been a bit more descriptive. No, not all authors are members of the organization.

amitsaha avatar Jul 25 '18 02:07 amitsaha

Hmmm 🤔So the author you are providing is in your org and it's still using the token creator? That's unexpected. Mind shooting me details in the support ticket of the build and I will look?

lox avatar Jul 25 '18 03:07 lox

Ah. Misread what you wrote.

lox avatar Jul 25 '18 03:07 lox

Nah, it makes sense. My custom client has been triggering builds by the same commit author who is not a member of the org. Given that scenario, is there any other way to show commit information for these commits without falling back to the token creator?

amitsaha avatar Jul 25 '18 03:07 amitsaha

I am also having this issue - in the context where we make the API call to trigger a build, the reconciliation between username and actual org email/name is only best-effort (and some users aren't part of the buildkite org at all).

It would be great if we were allowed to use arbitrary author names instead of falling back to the token creator

ca-johnson avatar Jul 25 '19 23:07 ca-johnson

Are there any updates on this?

tovbinm avatar Aug 02 '21 21:08 tovbinm