Add CommitNotFound error
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 found
andCommits 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.
-
we don't have proto gem published, so we will need to build it on local follow the steps in GDK here
-
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.
-
I have evaluated the MR acceptance checklist for this MR.
Closes gitaly#5735 (closed)
Edited by Eric Ju