What does this MR do and why?
Fixes #349047 (closed)
Add a new validation that checks whether the project path conforms to
[a-z0-9]+([._-][a-z0-9]+)*(/[a-z0-9]+([._-][a-z0-9]+)*)*. This restricts special characters at the start or the end of the project path and also restricts consecutive special characters in the project path. The regex used in this MR has been simplified as the project path cannot contain the forward-slash
The validation only runs when the project path is updated or added. It will not run when any other project fields are updated or the project is read or deleted.
Note: This new validation is behind a feature flag.
Screenshots or screen recordings
How to set up and validate locally
- Enable the feature flag
- Menu -> Projects -> Create new project
- Create a new project with the Project slug having
.at the start or end (or containing 2 or more consecutive such characters in between).
- Validation error is thrown.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
I have evaluated the MR acceptance checklist for this MR.