Transition to structured errors for RawBlame (step 2)
What does this MR do and why?
Contributes to #425441 (closed)
Problem
A wrapper for Gitaly error was added in the previous step: Transition to structured errors for RawBlame (s... (!132885 - merged). It unblocked the Gitaly version update, but it was not the best solution.
Since then a new version of Gitaly has been released and Rails now has access to structured content of RawBlame errors.
Solution
- Explicitly handle structured errors and raise
ArgumentError
for invalid input parameters. - Add missing tests
How to set up and validate locally
It should be no behavioural difference between previous and new version of the code.
- Visit http://127.0.0.1:3000/api/v4/projects/2/repository/files/README.md/blame?ref=master&range%5Bstart%5D=999&range%5Bend%5D=1000
- You should see an empty array in the response
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.