Message abstraction level
For https://gitlab.com/gitlab-org/gitaly/issues/127 I'm developing a new FindLocalBranches
rpc call, that for efficiency has to return a good amount of data about branches. In Rugged, this data is abstracted under several layers. I was wondering if for this type of cases, we should replicate these abstractions in our messages, with something like:
message FindLocalBranchesResponse {
repeated Branch branches = 1;
}
message Branch {
bytes name = 1;
Commit head = 2;
}
message Commit {
string id = 1
bytes message = 2
CommitAuthor author = 3
}
message CommitAuthor {
string date = 1
// ...
}
Or be more plain with something like:
message FindLocalBranchesResponse {
repeated Branch branches = 1;
}
message Branch {
bytes name = 1;
string commitId = 2;
bytes commitMessage = 3;
string commitAuthorDate = 4;
// ...
}
Also, since our guideline is to have granular messages, should the name of intermediary message be specific to each RPC call (i.e. FindLocalBranchesBranch
instead of Branch
)?
/cc @gl-gitaly