Skip to content

Validate the project name when it's entered, fixes #514, fixes #86 - #1147

Merged
rfay merged 3 commits into
ddev:masterfrom
rfay:20180929_validate_projectname
Oct 10, 2018
Merged

rfay merged 3 commits into
ddev:masterfrom
rfay:20180929_validate_projectname

Conversation

@rfay

@rfay rfay commented Sep 30, 2018 •

Copy link
Copy Markdown
Member

The Problem/Issue/Bug:

OP #514 - It's a standard problem new users have that they will enter a project name like "my project", which spaces or other problems that result in an invalid url.

We should finally validate it.

#86 also requests sanitization of hostnames; however this PR merely insists that the user choose an appropriate hostname.

How this PR Solves The Problem:

The project name is validated at the point of request. If it doesn't work, a correct project name is insisted on.

Manual Testing Instructions:

  • Try ddev config with invalid hostnames like "an invalid hostname" or "an_invalid_hostname".
  • Try ddev config in a directory which would be invalid
  • Try ddev config --projectname="invalid hostname" etc

Automated Testing Overview:

Related Issue Link(s):

Release/Deployment notes:

@rfay rfay added this to the v1.3.0 milestone Sep 30, 2018
@rfay rfay self-assigned this Sep 30, 2018
@rfay
rfay requested a review from andrewfrench September 30, 2018 01:38
@rfay rfay changed the title Validate the project name when it's entered, fixes #514 Validate the project name when it's entered, fixes #514, fixes #86 Oct 2, 2018
@rfay
rfay force-pushed the 20180929_validate_projectname branch 2 times, most recently from a7cea6f to b9cac94 Compare October 6, 2018 23:41
@rfay
rfay force-pushed the 20180929_validate_projectname branch from b9cac94 to 9a29efa Compare October 9, 2018 20:40

@andrewfrench andrewfrench left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works really well, I wasn't able to break it interactively or with flag inputs and the code changes look good to me.

@rfay
rfay merged commit bdfd80d into ddev:master Oct 10, 2018
@rfay
rfay deleted the 20180929_validate_projectname branch October 10, 2018 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants