Skip to content

GitLab Under the Hood Merging and Editing Through the Web Interface

riyad edited this page Oct 29, 2012 · 2 revisions

GitLab has some features that require it to manipulate Git repositories on its own. If you want to know how it is done, read on.

Satellites

In order to do direct repository manipulation, GitLab has its own clones of your projects called satellites. They are kept in the tmp/repo_satellites directory of your GitLab installation. Satellites were first introduced for allowing users to accept merge requests through the web interface and for GitLab to do the merge for them. That's also why the task that (re)creates the satellites is still (as of v3.0) called gitlab:app:enable_automerge.

Before each action, a satellite will be locked for the duration of each action. It will be prepared for the following action by resetting all uncommitted changes and fetching the latest commits from Gitolite. After that, the currently logged in user is set to author the following action. Then finally, the desired action is carried out.

You can see how satellites work in lib/gitlab/satellite/satellite.rb. Any action that is performed in satellites is derived from lib/gitlab/satellite/action.rb (e.g. merge_action.rb for automerges).

What are they used for?

All actions performed on satellites reside in lib/gitlab/satellite.

As of v3.0 they are used for

  • accepting merge requests (automerge) and
  • editing files

through the web interface.

Clone this wiki locally