Bazel is an open-source build and test tool derived from Google's internal build tool Blaze. Bazel offers a human readable, high-level build language for describing projects. By leveraging dependency analysis and caching, Bazel is able to produce incremental builds in which only the affected resources are rebuilt or tested.

Peterson notes that as more and more tests were added within Dropbox's monorepo, running the entire test suite became too time consuming. By leveraging Bazel's dependency graph, Dropbox was able to "greatly reduce the number of tests executed on most commits while still being correct". This was coupled with rolling up commits into groupings on which the identified tests would be run.

InfoQ chatted with Peterson about his experiences in integrating Bazel at Dropbox.

InfoQ: You indicate that Dropbox server-side resides in a monorepo, what led to this decision?

Benjamin Peterson: We previously had more repositories, and we decided to move away from that for many reasons. Large-scale changes required manually submitting a code review to each affected repository affected. Sharing code was painful, so people tended to copy instead. Changes in one repository could break the tests of another. Each repository tended to develop its own "ecosystem" with a custom coding style, shared code, linters, and policies. We did a large repository consolidation 5 or 6 years ago. I'm sure the pain points I've described would be much more severe at our size today.

InfoQ: Some argue that the solution to tests taking too long to run within a large repo would be to split out the repo into polyrepos based on service/library boundaries, each running an independent CI pipeline. Was this an option explored at Dropbox before adopting Bazel?

Bazel is an open-source build and test tool derived from Google's internal build tool Blaze. Bazel offers a human readable, high-level build language for describing projects. By leveraging dependency analysis and caching, Bazel is able to produce incremental builds in which only the affected resources are rebuilt or tested.

Peterson notes that as more and more tests were added within Dropbox's monorepo, running the entire test suite became too time consuming. By leveraging Bazel's dependency graph, Dropbox was able to "greatly reduce the number of tests executed on most commits while still being correct". This was coupled with rolling up commits into groupings on which the identified tests would be run.

InfoQ chatted with Peterson about his experiences in integrating Bazel at Dropbox.

InfoQ: You indicate that Dropbox server-side resides in a monorepo, what led to this decision?

Benjamin Peterson: We previously had more repositories, and we decided to move away from that for many reasons. Large-scale changes required manually submitting a code review to each affected repository affected. Sharing code was painful, so people tended to copy instead. Changes in one repository could break the tests of another. Each repository tended to develop its own "ecosystem" with a custom coding style, shared code, linters, and policies. We did a large repository consolidation 5 or 6 years ago. I'm sure the pain points I've described would be much more severe at our size today.

InfoQ: Some argue that the solution to tests taking too long to run within a large repo would be to split out the repo into polyrepos based on service/library boundaries, each running an independent CI pipeline. Was this an option explored at Dropbox before adopting Bazel?


组织机构



指导单位:

国务院学位委员会学科评议组(网络空间安全组)

教育部高等学校网络空间安全专业教学指导委员会


主办单位:

中国航天系统科学与工程研究院

海南大学


承办单位:

《网络空间安全科学学报》

海南大学网络空间安全学院(密码学院)


协办单位:

中国宇航学会计算机应用专委会

中国图象图形学学会数字媒体取证与安全专委会

中国计算机学会计算机安全专委会