Prepare Rails for UserCommitFiles structured errors
What does this MR do and why?
Prepare Rails for UserCommitFiles structured errors
Add structured error handling for reference_update errors in the user_commit_files method. When expected_old_oid validation fails in Gitaly, this provides users with clearer error messages instead of the cryptic "reference update: exit status 128" error. This change prepares Rails for the upcoming Gitaly structured errors implementation that will fix confusing error messages when using expected_old_oid with valid SHAs that aren't the current branch tip.
References
This change prepares Rails for the Gitaly structured errors implementation in gitaly!8088 as per gitaly#6292.
The Gitaly MR can be merged following the release of this Rails change, similar to the process used for UserUpdateSubmodule structured errors in !204189 (merged).
How to set up and validate locally
This MR adds preparatory error handling that will be activated once the corresponding Gitaly changes are deployed. The new error handling path can be tested by:
- Ensuring tests pass:
bundle exec rspec spec/lib/gitlab/gitaly_client/operation_service_spec.rb - Verifying the new
ReferenceUpdateErrortest case validates proper error message formatting