Skip to content

Add CommitNotFound error

Eric Ju requested to merge ej-5671-wait-for-git-log-to-finish into master

What does this MR do and why?

With gitaly!6589 (merged) and gitaly!6590 (merged), the FindCommits RPC in gitaly would throw a grpc error with code NotFound if it can't find any commits.

This MR prepares Rail to consume the NotFound error by:

  • wrap FindCommits error properly into a CommitNotFound error to differentiate Repo not foundand Commits in that repo not found
  • git/repository.rb 's log method would return empty array if a CommitNotFound happens.

How to set up and validate locally

Before the new proto definition MR gitaly!6589 (merged) is merged.

  1. we don't have proto gem published, so we will need to build it on local follow the steps in GDK here

  2. run rail tests in GDK for example

    cd <your gdk root>
    bundle exec rspec ./spec/models/project_wiki_spec.rb

After the new proto definition MR is merged and proto-gem is published, just run gdk test on local

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes gitaly#5735 (closed)

Edited by Eric Ju

Merge request reports