Skip to content

Add geo/git_repositories/:gl_repository/head REST API resource

Ian Baum requested to merge add-geo-head-api-call into master

What does this MR do and why?

Add geo/git_repositories/:gl_repository/head REST API resource

  • Will be used to ensure a Geo secondary repository has the current HEAD commit of the primary repository

Related to #415179 (closed)

How to set up and validate locally

  1. Install in a Geo instance
  2. For testing purposes, require_gitlab_workhorse! should be commented out from ee/lib/ee/api/geo.rb on the secondary node
  3. Create a repository with some files, and make sure it is replicated to the secondary
  4. Query primary API. The response should be HEAD commit sha, and nil
  5. Query secondary API. The response should be HEAD commit sha, and true
  6. Stop sidekiq on the secondary
  7. Commit a change to the primary repository
  8. Query primary API. The response should be new HEAD commit, and nil
  9. Query secondary API. The response should be new HEAD commit and false
  10. Start sidekiq on the secondary node and wait for the project to replicate
  11. Query the secondary API. The response should be the new HEAD commit and true.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Ian Baum

Merge request reports