Open dustmop opened 4 years ago
Reversing the fix for this issue: https://github.com/qri-io/qri/issues/1116.
Related: https://github.com/qri-io/qri/issues/1153 and https://github.com/qri-io/qri/issues/1132
Related issue that can be fixed at the same time. It's not possible to infer a name using a file that contains unicode:
> qri save --body=здравствуйте.csv
invalid name: dataset name must start with a letter, and only contain letters, numbers, and underscore. Maximum length is 144 characters
The recently added
dsref
package should be the central location for parsing usernames and dataset names. In both cases we should only allow names that start with a lower case letter, then follow with one or more of (lower case letter, number, underscore, dash).We also need to enforce this naming scheme everywhere. Here are some places I found that are behaving incorrectly:
qri setup
doesn't validate that the provided username is validqri save
will successfully create a dataset with an invalid username, but logbook will return the error "log: not found"qri save --body my-body.csv
incorrectly turns "-" into "_" because package varName doesn't match dsrerfqri checkout
also creates a directory name from the dataset name using varNameDesktop also needs to have parity with these checks