Hi! I think I found a bug in the CLI tool. It seems organization names in the API are case-sensitive, but the CLI tool is not (forces all-lowercase organization names).
I tried to use it to create a pipeline for a repo in my organization gridX
. After running bk pipeline create
I got this error:
Pipeline created:
Error: POST https://api.buildkite.com/v2/organizations/gridx/pipelines: 404 No organization found
Usage:
bk pipeline create
Flags:
-h, --help help for create
Notice the organization name is gridX
, but the HTTP call is using gridx
.
I tried calling the API with the same token and the correct name and it worked:
curl -H "Authorization: Bearer TOKEN" -X GET "https://api.buildkite.com/v2/organizations/gridX"
Then tried the same call with the lowercase version and got a 404
:
curl -H "Authorization: Bearer TOKEN" -X GET "https://api.buildkite.com/v2/organizations/gridX"
{
"message": "No organization found"
}
I checked ~/.config/bk.yaml
(I’m using Ubuntu) and the name there is all-lowercase as well. I tried changing it to gridX
, but got the same error after running bk pipeline create
again.
Could you please look into this?
P.S.
The Pipeline created:
line before the error is a bit misleading.