Two software engineers at Meta, Katherine and Dustin, discuss the challenges and benefits of shipping code at Meta. They cover topics such as monorepos, pre-commit code review, and CI infrastructure. They also talk about the life of a diff, writing bots to write code, finding reviewers, and maintaining stability. The episode provides insights into Meta's code development process and the importance of code review and testing.
Meta utilizes a mono repository, enabling easy code sharing and efficient API upgrading.
Meta has a code mod service for automating large-scale changes and ensuring consistency.
Code review is integral at Meta, fostering code quality, learning, and collaboration.
Deep dives
Code Shipping Culture and Repository Size
The podcast episode explores the culture of code shipping at Meta and how they handle changes in their massive repository. One of the main challenges they face is the unique culture and size of their engineering team, which consists of tens of thousands of engineers and millions of lines of code. Despite the size, they have implemented processes such as code review and testing to ensure code quality. They also use automation tools like code mods to make large-scale changes more efficient and manageable. Additionally, they have a release process that includes staged rollouts and internal dogfooding to catch bugs and ensure product quality. The episode highlights the importance of trust, responsibility, and collaboration in maintaining a healthy codebase.
Using a Mono Repo for Code Sharing
Meta utilizes a mono repository, which houses all their code in one place. This enables easy code sharing across different platforms and teams. They mentioned that having a mono repo allows for efficient API upgrading, as they can update APIs across the entire codebase. It also promotes code reusability and simplifies the process of making changes to shared code or libraries. While there can be challenges with managing a mono repo, such as indexing and searching through a large number of files, Meta has a strong source control team that supports fast operations within the mono repo. Overall, the mono repo structure benefits Meta by providing a unified codebase and facilitating code sharing across the organization.
Automation and Code Mod Service
The podcast episode discusses Meta's automation and code mod service. They have a service where developers can write code mods, which automate changes to specific files in the codebase. This service assists in making large-scale changes across the repository more efficient and manageable. It also helps with syncing files between repositories. The code mod service significantly reduces manual effort and aids developers in making changes and improvements to the codebase. Additionally, the automation provided by code mods ensures consistency and adherence to best practices throughout the codebase.
The Importance of Code Review
Code review is an integral part of Meta's culture and development process. They emphasize the significance of having a second set of eyes review code changes. Code review not only ensures code quality but also fosters learning and growth among developers. Meta has a comprehensive code review tool that enables effective collaboration and feedback within the development team. The tool includes features like in-line comments, highlighting changes, and AI-powered suggestions for improvement. The review process also involves creating test plans to verify code changes and ensure they work as intended. Code review plays a vital role in maintaining the quality and stability of Meta's codebase.
Ensuring Codebase Health and Quality
The podcast episode highlights the measures Meta takes to ensure the health and quality of their codebase. They have a release process that involves staged rollouts, starting with employees and then a small percentage of the wider population. This allows for thorough testing and bug reporting before wider public releases. Meta also relies on automated tools, such as linting, to catch potential issues and ensure code consistency. They leverage ML-based algorithms to recommend appropriate reviewers for code changes. The expectation is that developers take responsibility for their code and write meaningful test plans to verify their changes. Overall, Meta's continuous efforts to maintain codebase health and quality help them deliver reliable and bug-free products.
For episode 55, Pascal speaks with Katherine and returning guest Dustin, two software engineers at Meta about how to ship code at Meta. Why do we have a monorepo? Why and how do we do pre-commit code review? What does our CI infrastructure look like? Get the answers to these questions and many more in this episode of the Meta Tech Podcast.