Skip to content

repository: allow CreateRepository to take default_branch

John Cai requested to merge jc-create-repo-default-branch into master

In GitLab rails, there is code to ensure that the default branch on a new repository is set. This is currently done with an extra WriteRef call. This is done in a racy way, which causes problems with transaction voting. To fix this, we can simplify the logic altogether and avoid adding another roundtrip, add a parameter in CreateRepositoryRequest to pass a default_branch.

There was a bug that was uncovered once we switched WriteRef to be transactional. Turns out Rails was calling WriteRef in a racy way, in the middle of a UserCommitFiles operation. This will allow us to remove all of the racy calls to WriteRef in rails and improve performance by reducing a gRPC call.

Changelog: changed

replaces: !3582 (closed)

Edited by John Cai

Merge request reports