Support expected_old_oid in user_commit_files
What does this MR do and why?
Resolves #384017 (closed)
Feature flag rollout issue: #479424 (closed)
This MR passes a target_sha
to gitaly as expected_old_id
to handle race conditions between different clients. The expected_old_oid
verifies that the latest sha of the target branch has not changed since beginning the request to commit files.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Smoke tests
-
Successfully create a snippet -
Successfully create a wiki -
Successfully update the previous wiki -
Using the web IDE, edit a file and commit the changes to a new branch -
Using the web IDE, edit a file and commit the changes to an existing branch
Functional tests
With the feature flag ON:
-
Hardcode an invalid sha ( 8749d49930866a4871fa086adbd7d2057fcc3ebb
) here and try to commit a change from the web IDE. The commit should not succeed, and you should not receive a 500. -
Hardcode a sha that is a valid sha in the repository, but is not the latest sha of the branch. Try to commit a change from the web IDE. The commit should not succeed, and you should not receive a 500.
With the feature flag OFF:
-
Hardcode an invalid sha ( 8749d49930866a4871fa086adbd7d2057fcc3ebb
) here and try to commit a change from the web IDE. Your commit should succeed.
Numbered steps to set up and validate the change are strongly suggested.
Edited by Fred Reinink