Skip to content
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

Fix: Sluggify the database name #89

Merged
merged 9 commits into from
Mar 18, 2024

Conversation

shawnhooper
Copy link
Contributor

Fixes #88

@shawnhooper shawnhooper changed the title Sluggify the database name Fix: Sluggify the database name Mar 17, 2024
@mehrancodes
Copy link
Owner

I also added the new function to the RemoveDatabaseUser class. Did a couple of tests using other characters (FORGE_DB_NAME=abc+11@database) to ensure we are safe but we got forge validation error:

  FAIL    ---> The name must only contain letters, numbers, and underscores.
  FAIL    ---> The user field must only contain letters, numbers, dashes, and underscores.

I have added a regex rule to the db_name to ensure we throw err before the site gets created with crash. This allows us to keep the current behavior when db_name not provided.

@mehrancodes
Copy link
Owner

I tried to load the validation messages from the resources/lang/en/validation but Harbor loads messages from default vendor path. We may need some time to fix this, but for now I have specified db_name.regex err message while doing validation.

@mehrancodes
Copy link
Owner

It's time to merge if we're all good. I'd love to hear what you think!

@shawnhooper
Copy link
Contributor Author

This looks good to me @mehrancodes, I'd say merge it.

I do look forward to having some automated tests in this project... a task for another day.

@mehrancodes mehrancodes merged commit a277776 into mehrancodes:main Mar 18, 2024
1 check passed
@mehrancodes
Copy link
Owner

mehrancodes commented Mar 18, 2024

That's great to hear! I appreciate it! It's now merged and released.

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.

FORGE_DB_NAME breaks if passed a branch name with a hypen
2 participants