Skip to content

WIP: Add sync functionality from web IDE to the repository inside the build

The Web IDE File Sync service allows performing operations over a git repository.

This service runs a Websocket server and exposes two main endpoints: files and repository. The Websocket communication is implemented using Socket.io and the Go port library go-socket.io.

Through the files endpoint, the following operations can be performed:

  • GET: reads and returns a file from the repository:
  • DELETE: deletes a file from the repository:
  • PATCH: applies a multi-file unified git diff to the repository:

This operation does a best-effort applying the patch. This means that, even if one of the diffs inside the patch file fails to apply, it will try to apply the rest of them. The returned response, will store an error for each of the failed diffs that it couldn't apply.

Note: Although it is totally possible to use a patch to remove files, it is recommended to use the DELETE endpoint. The reason behind this is that, when removing a file, the whole content of the file is inside the patch. Therefore, using the DELETE endpoint will be faster.

The repository endpoint exposes the following actions:

  • DELETE: resets the working tree of the repository and cleans any untracked file.

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/10230 and https://gitlab.com/gitlab-org/gitlab-ee/issues/5276

Merge request reports