nitrictech / cli

Nitric CLI. Manage and run Nitric apps locally and deploy to any cloud.
https://nitric.io
Apache License 2.0
26 stars 10 forks source link

Validate invalid resource names #787

Closed jyecusch closed 1 month ago

jyecusch commented 1 month ago

Bug Report

Issue

Most cloud resource can't be deployed with spaces in their names. Currently, we don't validate this in the CLI, which means incorrect names can sometime fail to be detected until a nitric up command is run.

Let's catch these earlier, including during start and run with error descriptions that help with resolving the issue.

Alternative

An alternative is to normalize the names before deployment. For example topic("My Resource") might be normalized to "my-resource'. The challenge here is dealing with different names that normalize to the same value e.g. an app with resources topic("User Events") and topic("user-events") - the first would match the second after normalization. The developer may not have intended these to be the same resource. A clear solution to this problem would be needed before implementing normalization.

tjholm commented 1 month ago

Implemented in: https://github.com/nitrictech/cli/pull/799

davemooreuws commented 1 month ago

This was released. Closing.