Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Organization name is lower-cased #424

Open
greenled opened this issue Dec 18, 2024 · 2 comments
Open

[Bug]: Organization name is lower-cased #424

greenled opened this issue Dec 18, 2024 · 2 comments
Labels

Comments

@greenled
Copy link

greenled commented Dec 18, 2024

Contact details

https://forum.buildkite.community/u/greenled/summary

What happened?

I tried to use this tool create a pipeline for a repo in my organization (gridX). After running bk pipeline create I got a 404 error from Buildkite API with the message No organization found. The organization name is gridX (uppercase "X"), but the HTTP call was made using using gridx (lowercase "x").

I tried calling the API directly with the same token and the correct casing 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.

I double-checked the correct case was used when running bk config add.

Version

3.4.1

What environment are you seeing the problem on?

Local Development

Relevant log output

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
@greenled greenled added the bug label Dec 18, 2024
@greenled
Copy link
Author

I noticed viper is used for configuration management. The organization name is used as a configuration key but viper doesn't support case-sensitive keys 😭. As a result, organization name is lower-cased by viper before writing the config file, and lower-cased again when reading the config file.

@PriyaSudip
Copy link
Contributor

Thanks for raising this @greenled! We will take a look and work on it accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants