Skip to content

Conversation CommitService::CommitsByMessage

Feature Flag: gitaly_commits_by_message

Stages:

Blocked on:

Issues

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.

Edited by Andrew Newdigate
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information