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

Explain why an application name is not valid #12058

Merged
merged 3 commits into from Sep 29, 2020

Conversation

SimonRichardson
Copy link
Member

Description of change

The following changes are rather trivial, but the idea is to explain to
the user why an application name isn't valid. It attempts to do this in
plain English where possible.

Rather than falling back to just telling the user about an unexpected
character, it first explains that uppercase characters aren't valid,
then numbers aren't allowed after hyphens. Then if there is something
else wrong, explain which character is at fault.

Hopefully, this will explain the real issue to the user when attempting
to interacting with juju.

QA steps

$ juju bootstrap lxd test

$ juju deploy redis redis-01
ERROR invalid application name "redis-1", unexpected number(s) found after hyphen

$ juju deploy redis Redis
ERROR invalid application name "Redis", unexpected uppercase character

$ juju deploy redis red£is
ERROR invalid application name "red£is", unexpected character £

Bug reference

https://bugs.launchpad.net/juju/+bug/1891418

The following changes are rather trivial, but the idea is to explain to
the user why an application name isn't valid. It attempts to do this in
plain english where possible.

Rather than falling back to just telling the user about an unexpected
character, it first explains that uppercase characters aren't valid,
then numbers aren't allowed after hypens. Then if there is something
else wrong, explain which character is at fault.

Hopefully this will explain the real issue to the user when attempting
to interacting with juju.
The feedback from the original commit was to move this out of juju. This
does that, yet keeps the same tests in deploy to ensure we cover that.
Although not ideal, they're more integration tests that unit tests, but
we are where we are.
@SimonRichardson
Copy link
Member Author

$$merge$$

The go mod tidy was out of sync so this fixes that.
@jujubot jujubot merged commit b238fba into juju:develop Sep 29, 2020
@SimonRichardson SimonRichardson deleted the validate-application-name branch July 12, 2021 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants