buildkite / feedback

Got feedback? Please let us know!
https://buildkite.com
25 stars 24 forks source link

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

Open amitsaha opened 5 years ago

amitsaha commented 5 years ago

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": "a@b.com"
  },
  "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?

lox commented 5 years ago

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.

amitsaha commented 5 years ago

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?

lox commented 5 years ago

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?

amitsaha commented 5 years ago

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

lox commented 5 years ago

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 commented 5 years ago

Ah. Misread what you wrote.

amitsaha commented 5 years ago

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?

ca-johnson commented 4 years ago

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

tovbinm commented 2 years ago

Are there any updates on this?