Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Monorepo: How We Started to Save Our Developers Time

21 views

Published on

The development of multiple repositories is not always an easy task. If you want to offer a high-quality and evolving application, sooner or later, there is a need to make the same changes in several packages. This can be a simple change in the documentation of a few packages or the adoption of new coding standards. During the development of Shopsys Framework, we have come to the point where thousands of hours were allocated for development across multiple repositories and for development of new packages. And it was this moment when we decided to choose the way of monorepo. Upgrade several packages to a new version of PHPUnit? Why not! Change of method in API used across multiple packages? Super easy! Of course, monorepo is not for everyone. We will show you, why it can be useful to use monorepo and what was the way to the monorepo in Shopsys Framework.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Monorepo: How We Started to Save Our Developers Time

  1. 1. Svaťa Šimara MONOREPO How We Started to Save Our Developers Time Framework Developer
  2. 2. Shopsys Framework www.shopsys.czYour Success in e-commerce • Open source • Platform for building online stores • From devs to devs
  3. 3. Shopsys Framework www.shopsys.czYour Success in e-commerce • Started with monolith • Separated useful tools – Smoke testing – Coding standards – Migrations – … • Ended up with 14 git repositories
  4. 4. Do You have to maintain multiple repositories? www.shopsys.czYour Success in e-commerce
  5. 5. Problem #1 Make change in all repositories www.shopsys.czYour Success in e-commerce • Add a sentence into all readmes • Change 14 files • Make 14 commits • Create 14 pull requests • Send to code review!
  6. 6. Problem #1 Make change in all repositories www.shopsys.czYour Success in e-commerce • „You have a typo” • 14 fixes? • 14 fix commits? • 14 second code reviews?
  7. 7. TODO: https://c.pxhere.com/photos/6f/fd/boy_ child_sad_alone_sit_want_to_be_alone_c ry_hide_face-493051.jpg!d You are exhausted www.shopsys.czYour Success in e-commerce
  8. 8. Problem #2 API change www.shopsys.czYour Success in e-commerce • Dependent packages • API change
  9. 9. Problem #2 API change www.shopsys.czYour Success in e-commerce /using_tool.php /tool.php Smoke Tests Coding Standards
  10. 10. Problem #2 API change www.shopsys.czYour Success in e-commerce /using_tool.php /tool.php Smoke Tests Coding Standards
  11. 11. Problem #2 API change www.shopsys.czYour Success in e-commerce /using_tool.php /tool.php Smoke Tests Coding Standards • 2 pull requests • Difficult code review • 2 merges
  12. 12. Problem #2 API change www.shopsys.czYour Success in e-commerce /using_tool.php /tool.php Smoke tests Coding Standards /using_tool_too.php Migrations FAILFAIL
  13. 13. TODO: https://www.maxpixel.net/static/photo/ 1x/Alone-Exhausted-Burnout-Lonely- Loneliness-384083.jpg www.shopsys.czYour Success in e-commerce
  14. 14. Problem #3 Experimental feature www.shopsys.czYour Success in e-commerce • Dependent packages • Experimental change
  15. 15. Problem #3 Experimental feature www.shopsys.czYour Success in e-commerce Smoke Tests Coding Standards
  16. 16. Problem #3 Experimental feature www.shopsys.czYour Success in e-commerce /experiment.php Smoke Tests Coding Standards
  17. 17. Problem #3 Experimental feature www.shopsys.czYour Success in e-commerce /experiment.php Smoke Tests Coding Standards • Experimental branch deployment
  18. 18. Problem #3 Experimental feature www.shopsys.czYour Success in e-commerce /experiment.php Smoke Tests Coding Standards • Experimental branch deployment • Change dependency to experimental feature
  19. 19. Problem #3 Experimental feature www.shopsys.czYour Success in e-commerce /using_experiment.php /experiment.php Smoke Tests Coding Standards • Experimental branch deployment • Change dependency to experimental feature • Try the experiment
  20. 20. Problem #3 Experimental feature www.shopsys.czYour Success in e-commerce /using_experiment.php /experiment.php Smoke Tests Coding Standards
  21. 21. Problem #3 Experimental feature www.shopsys.czYour Success in e-commerce /using_experiment.php /experiment.php Smoke Tests Coding Standards • Experimental branch deployment again • Try the experiment again
  22. 22. TODO: https://get.pxhere.com/photo/dog-relax-rest-hound- lazy-sleep-animals-tired-beagle-harrier-dog-breed-doze- chill-out-sleeps-exhausted-camacho-street-dog-dog-like- mammal-carnivoran-dog-breed-group-beagle-harrier- american-foxhound-basset-art-sien-normand-english- foxhound-treeing-walker-coonhound-estonian-hound- amitava-saha-grand-anglo-fran-ais-tricolore-1413136.jpg www.shopsys.czYour Success in e-commerce
  23. 23. Problem #4 Dependency upgrade www.shopsys.czYour Success in e-commerce • Dependent packages • Uses the same library • Update it
  24. 24. Problem #4 Dependency upgrade Your Success in e-commerce Smoke Tests Coding Standards Symfony Finder 2.0 2.0 www.shopsys.cz
  25. 25. Problem #4 Dependency upgrade Your Success in e-commerce Smoke Tests Coding Standards Symfony Finder 2.0 3.0 www.shopsys.cz
  26. 26. Problem #4 Dependency upgrade Your Success in e-commerce Smoke Tests Coding Standards Symfony Finder 2.0 3.0 CONFLICTCONFLICT www.shopsys.cz
  27. 27. Problem #4 Dependency upgrade Your Success in e-commerce Smoke Tests Coding Standards Symfony Finder 2.0 2.0 www.shopsys.cz
  28. 28. Problem #4 Dependency upgrade Your Success in e-commerce Smoke Tests Coding Standards Symfony Finder 2.0 3.0 www.shopsys.cz
  29. 29. Problem #4 Dependency upgrade Your Success in e-commerce Smoke Tests Coding Standards Symfony Finder 3.0 3.0 www.shopsys.cz
  30. 30. https://cdn.pixabay.com /photo/2017/05/16/14/55 /rage- 2317995_960_720.jpg www.shopsys.czYour Success in e-commerce
  31. 31. Solution One repository www.shopsys.czYour Success in e-commerce
  32. 32. www.shopsys.czYour Success in e-commerce
  33. 33. Monorepo www.shopsys.czYour Success in e-commerce /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations
  34. 34. Monorepo www.shopsys.czYour Success in e-commerce /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations Monorepo
  35. 35. Monorepo www.shopsys.czYour Success in e-commerce /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations Monorepo Smoke Tests Coding Standards Migrations
  36. 36. Monorepo www.shopsys.czYour Success in e-commerce /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php
  37. 37. Monorepo www.shopsys.czYour Success in e-commerce /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php
  38. 38. Monorepo www.shopsys.czYour Success in e-commerce /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php BUILDBUILD
  39. 39. Monorepo www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php
  40. 40. Monorepo Split www.shopsys.czYour Success in e-commerce Smoke Tests Coding Standards Migrations Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php
  41. 41. Monorepo Split www.shopsys.czYour Success in e-commerce /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php
  42. 42. Monorepo Split www.shopsys.czYour Success in e-commerce /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php
  43. 43. Monorepo Split www.shopsys.czYour Success in e-commerce /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php SPLITSPLIT
  44. 44. Solution #1 Make change in all repositories www.shopsys.czYour Success in e-commerce • Add a sentence into all relevant readmes
  45. 45. Solution #1 Make change in all repositories www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php
  46. 46. Solution #1 Make change in all repositories www.shopsys.czYour Success in e-commerce • 1 commit • 1 pull request • Send to code review! • „You have a typo there” • 1 fix! 1 fix commit! 1 second code review! • 1 happy developer
  47. 47. Solution #1 Make change in all repositories www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations
  48. 48. Solution #2 API change www.shopsys.czYour Success in e-commerce • Dependent packages • API change
  49. 49. Solution #2 API change www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php
  50. 50. Solution #2 API change www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php
  51. 51. Solution #2 API change www.shopsys.czYour Success in e-commerce • 1 pull request • 1 complete code review • Code review can reveal problems
  52. 52. Solution #2 API change www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php
  53. 53. Solution #2 API change www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php
  54. 54. Solution #2 API change www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations
  55. 55. Solution #3 Experimental feature www.shopsys.czYour Success in e-commerce • Dependent packages • Experimental change
  56. 56. Solution #3 Experimental feature www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php
  57. 57. Solution #3 Experimental feature www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /using_ex.php /coding-standards /readme.md /tool.php /experiment.php
  58. 58. Solution #3 Experimental feature www.shopsys.czYour Success in e-commerce • No experimental deployment • 1 code review • 1 test • Deploy all at once
  59. 59. Solution #3 Experimental feature www.shopsys.czYour Success in e-commerce /readme.md /using_tool.php /using_ex.php /readme.md /tool.php /experiment.php Smoke Tests Coding Standards Monorepo /smoke-tests /readme.md /using_tool.php /using_ex.php /coding-standards /readme.md /tool.php /experiment.php
  60. 60. Solution #4 Dependency upgrade www.shopsys.czYour Success in e-commerce • Dependent packages • Uses the same library • Update it
  61. 61. Solution #4 Dependency upgrade www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php Symfony Finder 2.0
  62. 62. Solution #4 Dependency upgrade www.shopsys.czYour Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php Symfony Finder 3.0
  63. 63. Solution #4 Dependency upgrade www.shopsys.czYour Success in e-commerce • 1 code review • 1 deploy • Team of happy developers
  64. 64. Solution #4 Dependency upgrade Your Success in e-commerce Monorepo /smoke-tests /readme.md /using_tool.php /coding-standards /readme.md /tool.php /migrations /readme.md /using_tool.php /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations www.shopsys.cz
  65. 65. Solution #4 Dependency upgrade Your Success in e-commerce /readme.md /using_tool.php /readme.md /tool.php Smoke Tests Coding Standards /readme.md /using_tool.php Migrations Symfony Finder 3.0 www.shopsys.cz
  66. 66. Monorepo www.shopsys.czYour Success in e-commerce
  67. 67. Monorepo www.shopsys.czYour Success in e-commerce • Solved repetitive problems • Eased code review • Saved a lot a lot of time
  68. 68. Monorepo www.shopsys.czYour Success in e-commerce shopsys/monorepo­tools • Daily used tool • Split & Build • Fast • Doesn’t change commit hashes • Doesn’t change original repositories
  69. 69. Thank you! github.com/shopsys shopsys.com/u/mono Your Success in e-commerce Svaťa Šimara Framework Developer shopsys/monorepo­tools Daily used tool Split & Build Fast Doesn’t change commit hashes Doesn’t change original repositories

×