Special characters in project name/path prevent users from using the container registry
Problem to solve
As a developer, when I've named my group, project or branch using special characters, I need to be able to use the GitLab Container Registry, so that I share and publish my docker images/tags.
- Currently, if a user has special characters in either their group or project name and clicks on the 'Registry' section of their project, they will receive a 500 error and no explanation why.
- If a user has a branch name that includes special characters and attempts to build an image from GitLab's CI/CD product, it will also fail on connection.
- The root cause of this is that we validate registry paths against a Docker Distribution repository path regexp. And the below special characters result in an invalid path.
- Leading underscore
- Trailing hyphen/dash
- Double hyphen/dash
Although Developers are the main focus of this issue, this impacts reporters as well, as they have permission to view the Registry and will receive an unexplained 500 error when trying to navigate to the Container Registry.
This issue has been raised several times, but we have not solved it. See the below related issues for other instances of the same problem.
Update the error page for the Container Registry in the case where users can't connect to the Docker registry due to special characters in the path. The error page should include copy that explains the issue and provides a clear call-to-action and guidance on how to remediate the issue.
We also will update our documentation to note that special characters in the group, project or branch name will break the Container Registry's link to Docker.
"We're sorry, we are having trouble connecting to Docker. This could be due to an issue with your project name or path. Please note that special characters, such as:
- A leading underscore:
- A trailing hyphen or dash:
- A double hyphen or dash:
Permissions and Security
There are no permissions issues that are related to this.
- We should add a note to the documentation that groups, project or branch names with the identified special characters will prevent you from accessing the Container Registry.
- Ensure that this change does not break any existing projects
- Test all variations of special characters at both the project and the group level
- Ensure that group name does not impact the corrected project path
What does success look like, and how can we measure that?
Success looks like users that are having problems with their existing projects can navigate to the documentation and see that special characters in their path will prevent them from using the product.
Links / references
Sentry: https://sentry.gitlab.net/gitlab/gitlabcom/issues/142564/ /label feature