Fix Design Management repositories for Mercurial projects
Design Management features are using inner Git repositories with LFS for storage and versionning.
Acording to code comments, these repositories are supposed not to be "user-facing", meaning most probably that they can't be pulled or pushed to directly.
As with Snippets, it is probably wise just to let them be as expected by GitLab, i.e just Git repositories, but that's not what Heptapod currently does (to be confirmed):
Extract from app/models/design_management/repository.rb
:
module DesignManagement
class Repository < ::Repository
extend ::Gitlab::Utils::Override
# We define static git attributes for the design repository as this
# repository is entirely GitLab-managed rather than user-facing.
#
# Enable all uploaded files to be stored in LFS.
MANAGED_GIT_ATTRIBUTES = <<~GA.freeze
/#{DesignManagement.designs_directory}/* filter=lfs diff=lfs merge=lfs -text
GA
def initialize(project)
full_path = project.full_path + Gitlab::GlRepository::DESIGN.path_suffix
disk_path = project.disk_path + Gitlab::GlRepository::DESIGN.path_suffix
super(full_path, project, shard: project.repository_storage, disk_path: disk_path, repo_type: Gitlab::GlRepository::DESIGN)
end
So, the container
(second argument in super
) is the Project, which in case of Mercurial projects (native or not) will actually create Mercurial repositories. To fix that we'd need
- a special case in
Repository#initialize_raw_repository
or inGitlab::VCS.repository_class
- to implement
vcs_type
(->git
) andmercurial?
(->false
) directly onDesignManagement::Repository
and check that we never callrepository.container.vcs_type
directly and same withmercurial?