- Status: accepted
- Deciders: devs, devops
- Date: 25.05.2020
We need to maintain the quality of the codebase, minimize the time between introducing quality degradation and discovering it and make sure we have deployable artefacts at all times. In the context of a monorepo we need to do this efficiently in order to make this process scale for an ever-growing number of projects in the repository.
code integration- this is a process that checks the integrity/quality of the code - static code analysis, code formatting, compilation, running automated tests, etc. The process is usually in the form of one or more scripts and uses tools local to the repository with minimum external dependencies.
artefact building- this is a process that packages artefacts, labels them and usually publishes them to a central artefact repository so that they can be used by the deployment process. This process makes sense to be executed only after
code integrationprocess finishes successfully.
continuous integration- the practice of running the
code integration processtriggered by events such as
We also run the
- pushing new revisions of the code to the code repository
- opening a Pull Request
- fixed schedule
artefact buildingprocess after a successful
code integrationprocess to have artefacts ready for deployment at all times.
continuous integration platform(CI platform from here on) - it is a platform (self-hosted or SaaS) that provides integrations to make it easy to run your
continuous integrationand publish the results
- The code integration process needs to be independent from CI platform integration
- Easier troubleshooting and development of the process
- Easier migration to a different CI platform
- Easier experimentation
- Easier to run as part of the development process
- Needs more knowledge and experience
- We use Docker as much as possible to implement the steps in the integration process
- Platform independence
- Needs expertise in Dockerfile and Docker in general
- We only build the code affected by the change but re-tag all unchanged code artefacts
- Be able to release a consistent version of all necessary services. The Docker images for all services in the monorepo should have the same Docker image tag available for a commit hash
- Supports the monorepo benefits and ideology
- Can be tricky, especially for artefacts that are not Docker images(currently we do not plan to have those)
- We support only Linux as a target operating system when we cannot use Docker
- Same as the OS we use in our production environment, which minimizes the chances of failure because of OS differences
- We minimize the effort and complexity of supporting different operating systems
- Linux tooling works on all major other OSs today - macOS and Windows
- Devs that use non-Linux OS might need to install additional software and customizations
We only considered hosted solutions at this time to minimize the number of systems we need to maintain. Migrating to a different platform should not be a big or risky endeavour. They are merely convenient integrations with the code repository, cache hosting and notifications.
- GitHub Actions
- Well integrated with our code which is in GitHub
- Due to the integration we do not need to provide
- Well documented
- Supports self-hosted runners
- Well priced (free, not sure if there is a limit)
- Relatively new
- Circle CI
- Supports self-hosted runners
- Not sure if parallelization is supported on open-source projects
- It will cost us (they have a free tier but with a limit which seems we will likely reach)
- AWS CodeBuild
- Scalable builds
- Best security model when part of our AWS account structure
- Reasonably priced?
- UI is kind of bad
- Number 1 CI platform on GitHub at the time of this writing
- Easy customization of which parts of the CI process to run depending on branching patterns and pull requests
- Good integration of code health with the pull request process
- As a GitHub open-source project, we have an unlimited number of "compute"-minutes that come as a part of the package
- Supports parallelisation of the process which can be pretty important in the context of monorepo
- Support using own runners which can be helpful to maximize speed, minimize costs and increase security.