Conversation CommitService::CommitsByMessage
Feature Flag: gitaly_commits_by_message
Stages:
-
RPC Design: Create Issue https://gitlab.com/gitlab-org/gitaly/issues/441 -
Server Implementation: Create Issue https://gitlab.com/gitlab-org/gitaly/issues/442 https://gitlab.com/gitlab-org/gitaly/merge_requests/263 -
Client Implementation: Create Issue https://gitlab.com/gitlab-org/gitaly/issues/443 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13268 -
Acceptance Testing: https://gitlab.com/gitlab-org/gitaly/issues/459 https://gitlab.com/gitlab-org/gitaly/issues/573
Blocked on:
Issues
- https://gitlab.com/gitlab-org/gitaly/issues/486 https://gitlab.com/gitlab-org/gitaly/merge_requests/303
RPC Endpoints:
CommitService::CommitsByMessage
Known Client Routes:
- Known client endpoints
app/models/Repository#find_commits_by_message
service CommitService {
rpc CommitsByMessage(CommitsByMessageRequest) returns (stream CommitsByMessageResponse) {}
}
message CommitsByMessageRequest {
Repository repository = 1;
bytes revision = 2;
// Must be >= 0
int32 offset = 3;
// Must be >= 0
int32 limit = 4;
// Must be non-empty
string query = 5;
}
// One 'page' of the paginated response of CommitsByMessage
CommitsByMessageResponse {
repeated GitCommit commits = 1;
}
Note: in the current implementation the last line is:
git_log_results.map { |c| commit(c.chomp) }.compact
What happens here is that gitlab-ce is looking up commits by ID. This will give bad performance in the Gitaly scenario. Instead of returning the commit ID's as strings, we should return GitCommit Gitaly messages and turn them into Gitlab::Git::Commit instances. These can be fed into app/models/Repository#commit.