Gitlab:Git::Repository#submodule_url_for
Feature flag gitaly_submodule_url_for
Stages:
-
~"Client Implementation": https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12479 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12629 -
~"Acceptance Testing": #367 (closed)
RPC Endpoints:
Endpoint::Name
Known Client Routes:
- Known client endpoints
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/git/repository.rb
The current implementation of #submodule_url_for
does more work than it has to. I think we can implement this function as follows. To find the submodule URL for revision ref
and path path
:
- fetch
ref:path
with Gitaly CommitService.TreeEntry - if not found or not of type 'commit', return nil
- fetch
ref:.gitmodules
with Gitaly CommitService.TreeEntry - run contents of .gitmodules through Gitlab::Git::GitmodulesParser
It's not ideal to make 2 RPC calls but it's a start and it cheaply allows us to delete two methods once the migration is complete:
- Gitlab:Git::Repository#submodules
- Gitlab:Git::Repository#fill_submodule_ids
Implementation: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12629
Edited by Alejandro Rodríguez