2 ms·
That's crazy. Monorepo definitely makes more sense. Though I always wonder - how do Google, Microsoft, Facebook etc. deal with developing code near the root of
by IshKebab 3y ago
That's crazy. Monorepo definitely makes more sense.
Though I always wonder - how do Google, Microsoft, Facebook etc. deal with developing code near the root of their dependency tree? Utility libraries for example. Technically you're going to have every change you make there building all the code and running all the tests, which is obviously unworkable. What do they do?
- kleton 3y agoVery conservatively, with automation for large scale changes. Google and Facebook do run all the tests, but Facebook has way fewer tests.
- IshKebab 3y agoDo they not have "internal" releases for these root components that are not depended on by everything, so you aren't having to wait 2 days and use a gazillion hours of computer for every single change though?
- alexhornby 3y agoIf you change a core lib CI will build and test relevant code, which will be a lot, but it will scale over a massive CI plant. Still best to run unit tests locally first of course!
- IshKebab 3y agoAre you speaking from experience or is this a guess?
- spankalee 3y agoFirst, you prune tests to only those affected by the change. There's basically nothing (other than the build system itself) at the root of all code because of the huge number of languages and platforms in the repo. But you still have library code that's depended on so much that you can't easily run all the tests for each change. So you run a train system so that you can run tests for a whole bunch of changes (those on the same train) at once. Developers have to schedule changes to get on the next train. Other code analyzes the failures from the train to try to apportion blame correctly. Then, because getting on trains can be cumbersome and tests you care about can fail because of other changes, you build random test sampling and smoke test subsets so that you can get some immediate results to attach to a review, etc. It roughly works, as well as anything can at that scale.
- IshKebab 3y agoAre you speaking from experience or is this just a guess? Merge trains/queues don't really help with the problem I'm describing - they just prevent race conditions between commits. You still need to run all the tests for each PR/MR first before joining the queue/train.
- aylmao 3y ago1. Types, tests, all the build-time analysis you can rely on 2. Gradual migrations. You run two versions for a while and make it easy for certain codebases and/or users to be switched between the new and the old as necessary. 3. Sometimes you just don't touch that stuff, slowly build new things with new technology and hope eventually the old thing will fall in use enough that you'll be able to delete it.