diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-07-26 11:05:24 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-07-26 15:47:29 +0300 |
commit | e7fa825668f2c57885d29f8ea77bd8a92102c0e0 (patch) | |
tree | c05d367bf04ebe10fff48b7262ccf6356b5f5a45 /proto/repository-service.proto | |
parent | 0663898ba5ba01894c7cbbdc38609edc02ed320b (diff) |
repository: Implement new `SetFullPath()` RPC
Since quite some time, we have tried to get rid of calls which modify
the on-disk gitconfig file. For one these include calls which add or
remove remotes, which are soon to be removed from Gitaly now that Rails
doesn't call them anymore. On the other hand, this also includes calls
which modify the gitconfig directly. There are currently two upstream
callers of those RPCs:
- The first usecase is to set up JWT credentials for `FetchRemote()`
calls. Those credentials are passed via HTTP headers, which is in
fact already supported by `FetchRemote` without having to manually
write them into the gitconfig. Those are thus easy to replace.
- The second usecase is to set "gitlab.fullpath": this key simply
records the repository's path in GitLab such that it's easy to see
for admins what repository this is. This has been implemented to
bridge the gap between the old storage layout and our new hashed
storages.
This commit addresses the second usecase by introducing a new RPC
`SetFullPath()`. Instead of allowing callers to modify the gitconfig
arbitrarily, this will only allow callers to explicitly set
"gitlab.fullpath". With this in place, we can eventually remove
`AddConfig()` and `RemoveConfig()` given that they're not required
anymore.
Changelog: added
Diffstat (limited to 'proto/repository-service.proto')
-rw-r--r-- | proto/repository-service.proto | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/proto/repository-service.proto b/proto/repository-service.proto index f38a20126..e7801e691 100644 --- a/proto/repository-service.proto +++ b/proto/repository-service.proto @@ -239,6 +239,16 @@ service RepositoryService { op: MUTATOR }; } + + // SetFullPath writes the "gitlab.fullpath" configuration into the + // repository's gitconfig. This is mainly to help debugging purposes in case + // an admin inspects the repository's gitconfig such that he can easily see + // what the repository name is. + rpc SetFullPath(SetFullPathRequest) returns (SetFullPathResponse) { + option (op_type) = { + op: MUTATOR + }; + } } message RepositoryExistsRequest { @@ -739,3 +749,14 @@ message OptimizeRepositoryRequest { } message OptimizeRepositoryResponse{} + +// SetFullPathRequest is a request for the SetFullPath RPC. +message SetFullPathRequest { + // Repository is the repository whose gitconfig should be written to. + Repository repository = 1 [(target_repository)=true]; + // Path is the path that shall be written into the "gitlab.fullpath" config key. + string path = 2; +} + +// SetFullPathResponse is a response fqor the SetFullPath RPC. +message SetFullPathResponse {} |