Tech Stacks - Source Control
Source Control: git or hg?
Modern code repos usually live in either git
or Mercurial (hg
).
- git
- https://www.git-scm.com/
- written in C
- Google stores most of its code in its own system ("Piper"), but some Android, Chrome, Cloud related repos live in
git
.
- hg
- https://www.mercurial-scm.org/
- written in Python
- better support for larger repos.
- used by Facebook
Gitlab
Persistent storage for the stateful components:
- PostgreSQL (GitLab data)
- Redis (session data)
- MinIO (AWS S3-type object storage) MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Amazon S3 cloud storage service. For storing unstructured data such as photos, videos, log files, backups, and container / VM images.
- Gitaly (git repo data): Git RPC service for handling all Git calls made by GitLab. Requests => Gitaly =>
.git
repos.- Before Gitaly: all requests direct calls to
.git
directory stored on NFS mounts connected to the GitLab server. Gitaly removed direct access to the.git
directory.
- Before Gitaly: all requests direct calls to
- GitLab Shell: handles git SSH sessions for GitLab and modifies the list of authorized keys. GitLab Shell is not a Unix shell. GitLab Shell is used for tasks such as for
git clone
,git push
etc executed via SSH.
https://docs.gitlab.com/ee/development/architecture.html
In k8s, a gitlab deployed in the admin cluster can be used for IaC.
Code repo structure
- single repo or not?
- single branch or not?
Code Search
You probably need a good way to search and browse your code. E.g. git
itself manages the code, while GitHub provides a good UI to view the code.
Code Review
Gerrit (https://www.gerritcodereview.com/) is a widely used code review tool. Originated from Google, and now also being used for Google's git repos.