balena-io / balena-cli

The official balena CLI tool.
Apache License 2.0
453 stars 139 forks source link

Confusing case requirements #2581

Open chrisys opened 1 year ago

chrisys commented 1 year ago
Screenshot 2023-01-13 at 09 46 54

It seems the CLI is case sensitive when pushing - i.e. 'balena push BarnFin' works whilst 'balena push barnfin' does not, which isn't necessarily an issue, but then the first like of the info says 'building for barnfin' which is in direct conflict with the message above.

I'd suggest first we stick to either case sensitive or not, and then also provide a hint to the user if the application isn't found. We just say 'nope' when we could say 'did you mean BarnFin?' or even 'note: slugs/fleet names are case sensitive'

myarmolinsky commented 1 year ago

The SDK treats slugs as case-insensitive so the command should not be case-sensitive

myarmolinsky commented 1 year ago

The SDK treats slugs as case-insensitive so the command should not be case-sensitive

Actually while this is true, you passed an app name, not a slug. Slugs are treated as case-insensitive but app names are sent through a different method which apparently does care about the case-sensitivity. Need to figure out why we care about the case for app name

myarmolinsky commented 1 year ago

Apparently we've got some confusing UX in the dashboard related to this... Here's me trying to create a fleet with the name asdas in an org that already has a fleet with the name asdas: image As you can see, validation tells the user that the name is case-insensitive. So if I enter asdaS instead, the error goes away. However, trying to submit results in the following: image

So according to the API, app names are case-insensitive: if you have asdas, you cannot have asdaS. So the dashboard should validate with disregard for case.

We have some confusing UX from the API too though: image

So although application names are treated case-insensitively, we still disallow getting application names with case-insensitivity ...

myarmolinsky commented 1 year ago

Opened a zulip thread here: https://balena.zulipchat.com/#narrow/stream/346007-balena-io.2FbalenaCloud/topic/app.20name.20case-sensitivity