Skip to content

Create Site recommended values should match those from web UI #42

@Jamesclark32

Description

@Jamesclark32

Current Outcome

Currently the CLI sites:create process calculates recommended values for Database Name and Database Username by stripping out any . characters from the provided Domain.

The recommendation calculations for these same values in the web UI includes a more complex find/replace process which will remove special characters beyond .s. This process also enforces maximum lengths for the values, which prevent these recommended values from being too long for mysql limitations. This processing happens within frontend javascript code.

Desired Outcome

Ideally these processes would return the exact same values.

Having these calculations happen in the same language would help ensure they would always reach the same result given the same value.

Additionally, if these processes could lean on the same point of calculation we would be left with a less brittle system as any future updates to this process would automatically change behavior at both points of user interaction.

I've not noticed any other discrepancies in recommendations between the two processes. However, this would be a good opportunity to carefully audit all others and ensure everything else matches.

Steps to Reproduce

  1. Step through an Add Site process in the web UI. Use a lengthy subdomain with special characters, such as this-is-a-very-long-subdomain.yoursite.com. Observer the recommended Database Name and Database Username values.
  2. Step through the sites:create process using the CLI, reusing the same subdomain. Observer the recommended Database Name and Database Username values.
  3. Note the differences between the two.

Related

Acceptance Criteria

  • The CLI recommendations for Database Name and Database Username values should strip the same characters from the domain as the web UI currently does.
  • The CLI recommendations for Database Name and Database Username values should limit value lengths to match those of the current web UI solution.
  • If possible, the point of calculation used by both of these processes should be the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Scope: CLIType: BugFixes broken functionality that prevents something from being achieved.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions