Slide 1

Slide 1 text

A Monolith Repository vs Many Repositories F A B I E N P O T E N C I E R @ F A B P O T

Slide 2

Slide 2 text

A Monorepo vs Manyrepos F A B I E N P O T E N C I E R @ F A B P O T

Slide 3

Slide 3 text

The monorepo https://github.com/symfony/symfony Bridge/ 5 sub-projects Bundle/ 5 sub-projects Component/ 33 independent sub-projects like Asset, Cache, CssSelector, Finder, Form, HttpKernel, Ldap, Routing, Security, Serializer, Templating, Translation, Yaml, ... 43 projects, 25 000 commits, and 400 000 LOC

Slide 4

Slide 4 text

The monorepo Agent PHP extension Signify Chrome Extension PHP SDK Player Docs Book Go C C JavaScript PHP PHP ReST ReST

Slide 5

Slide 5 text

Development vs Distribution

Slide 6

Slide 6 text

Monolith Repository ≠ Tightly coupled code

Slide 7

Slide 7 text

Monorepos are
 awesome Make large
 backward incompatible changes easily...
 especially if they span
 different parts of the project

Slide 8

Slide 8 text

Monorepos are
 awesome Old APIs can be removed with confidence

Slide 9

Slide 9 text

Monorepos are
 awesome Change an API endpoint code
 and all its usages in all projects
 in one pull request

Slide 10

Slide 10 text

Monorepos are
 awesome Code review are easier
 no manual coordination between multiple repos

Slide 11

Slide 11 text

Monorepos are
 awesome Easy continuous integration for changes spanning several projects

Slide 12

Slide 12 text

Monorepos are
 awesome Productivity increases

Slide 13

Slide 13 text

Monorepos are
 awesome No switch from one repo to the next
 depending on which part of the codebase
 you are working on

Slide 14

Slide 14 text

Monorepos are
 awesome Collaboration between teams becomes natural

Slide 15

Slide 15 text

Monorepos are
 awesome Developers can fix bugs in all projects
 Noone owns code

Slide 16

Slide 16 text

Monorepos are
 awesome Less management, everything is centralized

Slide 17

Slide 17 text

Monorepos are
 awesome Dependency management is a non-issue, no need for version constraints for internal code

Slide 18

Slide 18 text

Manyrepos are
 awesome

Slide 19

Slide 19 text

Manyrepos are
 awesome Clean boundaries between projects for free

Slide 20

Slide 20 text

Manyrepos are
 awesome Code more reusable in other contexts

Slide 21

Slide 21 text

Manyrepos are
 awesome Access control is easy

Slide 22

Slide 22 text

Manyrepos are
 awesome Continuous integration might be simpler as well

Slide 23

Slide 23 text

Working with
 a monorepo and
 manyrepos?

Slide 24

Slide 24 text

Manyrepos - 43 https://github.com/symfony/asset https://github.com/symfony/console ... https://github.com/symfony/* A monorepo - 1 https://github.com/symfony/symfony

Slide 25

Slide 25 text

symfony/symfony src/Symfony/Component/Console CHANGELOG.md Command/ Exception/ LICENSE ... symfony/console CHANGELOG.md Command/ Exception/ LICENSE ...

Slide 26

Slide 26 text

git log --oneline origin/2.0 src/Symfony/Component/Console 3be3dde [Console] Fixed comment dc2cc6b [Console] fixed input bug when the value of an option is empty (closes #6649, closes #6689) 151f2c1 Revert "merged branch egeloen/f-2.0-terminal-width (PR #6571)" 5157693 merged branch egeloen/f-2.0-terminal-width (PR #6571) f299bd0 [Console] Make getTerminalWith & getTerminalHeight public df5c171 updated license year 2fc41a1 [Console] fixed unitialized properties (closes #5935) 9aec4c8 Show correct class name InputArgument in error message 762649f shows correct class name InputOption in error message git log --oneline origin/2.0 da9d86b [Console] Fixed comment 5aaf6a3 [Console] fixed input bug when the value of an option is empty (closes #6649, closes #6689) efa6379 Revert "merged branch egeloen/f-2.0-terminal-width (PR #6571)" c9511da merged branch egeloen/f-2.0-terminal-width (PR #6571) 47e1ce7 [Console] Make getTerminalWith & getTerminalHeight public f3168bf updated license year fc6e023 [Console] fixed unitialized properties (closes #5935) 29e0ef3 Show correct class name InputArgument in error message 03cec88 shows correct class name InputOption in error message

Slide 27

Slide 27 text

tree 55adb57 symfony/symfony f299bd0 git ls-tree origin/2.0 src/Symfony/Component/Console

Slide 28

Slide 28 text

symfony/symfony f299bd0 git ls-tree origin/2.0 src/Symfony/Component/Console symfony/console 47e1ce7 git cat-file -p origin/2.0 tree 55adb57

Slide 29

Slide 29 text

symfony/console 47e1ce7 symfony/symfony f299bd0 55adb57 a463ed5 ade4572 4f33efa 978ac3e

Slide 30

Slide 30 text

source of thruth "read-only" Code changes Access control Tags CI / CD ... ? ... repo repo repo repo repo Manyrepos Read-time sync commits, tags, ... Monorepo PR moves

Slide 31

Slide 31 text

Splitting
 a monorepo
 to manyrepos git subtree split

Slide 32

Slide 32 text

... at scale git subtree split 1 monorepo 43 manyrepos 5 maintained versions 220 maintained branches

Slide 33

Slide 33 text

split.sh, a rewrite in Go + libgit2 Initial split From hours+ to < 1 minute Incremental splits From minutes+ to < 10ms

Slide 34

Slide 34 text

split.sh a toolkit to manage mono/many repos

Slide 35

Slide 35 text

split.sh Pull requests are automatically moved
 from the manyrepos to the monorepo

Slide 36

Slide 36 text

split.sh CI/CD can happen
 from the monorepo
 and/or the manyrepos

Slide 37

Slide 37 text

split.sh Contractors can have access
 to some manyrepos only

Slide 38

Slide 38 text

split.sh and much more...

Slide 39

Slide 39 text

split.sh for Agent PHP extension Signify Chrome Extension PHP SDK Player Docs Book Website Go C C JavaScript PHP PHP ReST ReST PHP/Symfony Open-Source Open-Source A contractor works on this part only Independant releases Deployed together

Slide 40

Slide 40 text

Soon to be released as Open-Source Interested?
 Email me at [email protected] Thank you!