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
Validate project name in "ddev config" #514
Comments
Updating to reflect that I believe this is 100% actionable with no additional AC defined, but if @cweagans doesn't believe that to be the case we should kick back with an incubate label and get this more fleshed out. |
The UI is currently using RFC 2396 Section 3.2.2 rules to validate project names. Standard can be found: Regex in use is: |
I was looking at this again. Go has a built in way to validate URLs, but we also agreed that we were standardizing on "project" instead of "site". I'm assuming that's still the case, so what would you like to do here? Leave the messaging the same and just validate that whatever we get is a valid hostname? |
I edited the OP, let me know if that's clear enough @cweagans |
@rfay I'm sorry, I'm not being clear. If we're using project name instead of site name, it's not obvious that this input is going to be validated like a URL. As a user, how am I supposed to know what to enter here the first time? Yeah, the error message will correct me, but how can we make this clear the first time a user is going through this process? |
Thanks, @rfay, for the clarification. I'm tracking and onboard. Basically, whatever is submitted as a project name + the additional .ddev.local (or whatever if we ultimately change that as per #416 should validate. Ideally the validation from the Go library matches what @andrew-c-tran is using on the front-end. As for expectation setting, it sounds like we're wanting to provide helper text to the end-user so that they know what is acceptable and why. There are two approaches. We could add an additional sentence before or after validation fails OR we could simply strip out invalid characters and suggest that along with text explaining why. I don't have a specific recommendation of verbiage, but wanted to confirm if that is the issue that @cweagans is surfacing. |
Updated the milestone to reflect when this might be appropriate to address. Of course, if we're blocked on upcoming runway, this can be cherry-picked and completed ahead of that. |
I've just stumbled upon this one too. The term "project name" is confusing. |
Related is our standardization around standardizing around "project" over "app" and "site" #526 |
Oh, I got snagged by this in a demo today. I was trying to be clever, but not thinking. Thankfully I could run In this issue, I see a more clever solution is on the roadmap for a 1.x release in the future. I notice the prompt for docroot is preceded by a sentence explaining what it is. In the short term, could the Project name possibly have a short sentence explaining the naming convention? Would you accept a PR adding a message about this naming convention?
An example that includes a description.
|
This just tripped me up today as I used a project name with spaces in (being none the wiser from the config questions). Can't believe its still not resolved since last October. |
another thing which is related and hit us few times already, is the uppercase project name like "Myproject". |
Randy, I dont have an exaple at hand unfortunatelly. I remember we have troubles with this some months ago. If i remember correctly in some places in yaml the upprecsse name was used. |
Thanks. I'll be looking for that. I don't think it's directly related to this one, but will keep my eyes open. |
What happened (or feature request):
Edit:
The project name in ddev config must be a valid hostname, so a valid URL can be constructed.
If you enter a "project name" in ddev config which has spaces for example, it won't complain, but when you do a
ddev start
Failed to start: nope not here.ddev.local is not a valid hostname. Please enter a site name in your configuration that will allow for a valid hostname. See https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_hostnames for valid hostname requirements
So we're validating on start, but we need to validate at config.
What you expected to happen:
How to reproduce this:
Version: Please include the output of
ddev version
,docker version
and the project's .ddev/config.yaml.Anything else do we need to know:
Related source links or issues:
The text was updated successfully, but these errors were encountered: