Geo - Consolidate the Git repo hooks in Repository model

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

A Geo engineering must survey and modify the code to guarantee that all possible updates to Git repositories are triggering a call to a Repository Replicator geo_handle_after_create or geo_handle_after_update. The problem is that we currently place hooks ad-hoc around the GitLab codebase, and it is easy to miss a place. It is also easy to be unaware of other devs adding code that requires us to add a new hook.

Proposal

  • We should place our hooks at a lower level, e.g., app/models/repository.rb or lib/gitlab/git/repository.rb.
  • We should use a feature flag like geo_centralize_repository_event_hooks, since it is a "broad" change.
Edited by 🤖 GitLab Bot 🤖