diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /app/services/projects/create_service.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'app/services/projects/create_service.rb')
-rw-r--r-- | app/services/projects/create_service.rb | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index a01db4b498c..08f569662a8 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -127,7 +127,7 @@ module Projects access_level: group_access_level) end - if Feature.enabled?(:specialized_project_authorization_workers) + if Feature.enabled?(:specialized_project_authorization_workers, default_enabled: :yaml) AuthorizedProjectUpdate::ProjectCreateWorker.perform_async(@project.id) # AuthorizedProjectsWorker uses an exclusive lease per user but # specialized workers might have synchronization issues. Until we @@ -210,16 +210,22 @@ module Projects end def set_project_name_from_path - # Set project name from path - if @project.name.present? && @project.path.present? - # if both name and path set - everything is ok - elsif @project.path.present? + # if both name and path set - everything is ok + return if @project.name.present? && @project.path.present? + + if @project.path.present? # Set project name from path @project.name = @project.path.dup elsif @project.name.present? # For compatibility - set path from name - # TODO: remove this in 8.0 - @project.path = @project.name.dup.parameterize + @project.path = @project.name.dup + + # TODO: Retained for backwards compatibility. Remove in API v5. + # When removed, validation errors will get bubbled up automatically. + # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52725 + unless @project.path.match?(Gitlab::PathRegex.project_path_format_regex) + @project.path = @project.path.parameterize + end end end |