Drone

Drone CLI partially case sensitive

Drone cli 1.0.7 seems to be case insesitive on OS X and partially case sensitive on linux and this is causing unexpected problems.

Example 1:
Our github organisation is written in upper case (FOO) but with cli we need to give the organisation name as lower case for the cli to work (drone deploy foo/repo-name…). Same behaviour on OS X and linux.

Example 2:
Some repositories have upper case letters or words (FOO-bar) and on OS X cli can be used while writing everything in lower case (drone deploy foo/foo-bar…) but with linux the cli doesn’t work at all, it just replies with client error 404: {"message":"Not Found"} to all permutations of the command.

Drone cli 1.0.7 seems to be case insesitive on OS X and partially case sensitive on linux and this is causing unexpected problems.

The CLI is definitely not case-sensitive. The Drone database may be case-sensitive depending on whether or not you are using MySQL or Postgres or SQLite. Specifically MySQL string matching is case-insensitive.

Even if the database was case-sensitive it doesn’t explain why drone CLI behaves differently on OS X vs linux.

I’ll give a few more examples, I tried the commands on Linux and witnessed the OS X CLI usage.

Github organisation: FOO
Git repo: BAZ-bar
Other repo: bar

Linux, case-sensitive: drone build promote FOO/bar 1 <- doesn’t work
Linux, organisation lower case: drone build promote foo/bar 1 <- promotes the build (this could very well be a database related)

Linux, case-sensitive: drone build promote FOO/BAZ-bar 1 <- doesn’t work
Linux, lower case repo: drone build promote FOO/baz-bar 1 <- doesn’t work
Linux, all lower case: drone build promote foo/baz-bar 1 <- doesn’t work

OS X: drone build promote foo/baz-bar 1 <- promotes the build completely igoring case-sensitivity while the exact same parameters don’t work on linux CLI client

There is no code in the CLI or the SDK that modifies the case of strings. However, if you feel certain this is the root cause I would invite you to send a pull request to github.com/drone/drone-cli or github.com/drone/drone-go which are the two relevant repositories.

We managed to resolve the issue.

Just in case someone else is struggling with something similar, double check the user/group rights of all your repositories, I didn’t quite catch what was the problem but once we granted more rights to all projects drone started working properly.

There’s probably room for improvement regarding that drone only returned client error 404: {"message":"Not Found"} instead of telling anything useful.