Geo SSF: Repository sync should update HEAD ref
Problem
Some snippet repositories can fail verification even after successful resyncs because HEAD
ref on the secondary isn't exactly the same as it is on the primary (it may not even exist at all on the secondary).
See #333462 (closed) for gory details.
Proposal
We need to do similar to https://gitlab.com/gitlab-org/gitlab/-/blob/8c924b4743031b4bb656df344751f9e0b74157db/ee/app/services/geo/repository_sync_service.rb#L57 in FrameworkRepositorySyncService
. We should do this generically for Repository
since this will be needed for many Repository types. And the only Project
-specific part is when change_head
enqueues ProjectCacheWorker
.
Here is a WIP commit aiming at doing the above ccaacdb6
Edited by Michael Kozono