Multiple projects, different goals, one thing in common: the codebase!

2,412 views

Published on

Trunk-based development talk given at Agile India 2014 in Bangalore.

Published in: Technology
1 Comment
3 Likes
Statistics
Notes
No Downloads
Views
Total views
2,412
On SlideShare
0
From Embeds
0
Number of Embeds
217
Actions
Shares
0
Downloads
59
Comments
1
Likes
3
Embeds 0
No embeds

No notes for slide

Multiple projects, different goals, one thing in common: the codebase!

  1. 1. Multiple projects, different goals, one thing in common: the codebase! Carlos Lopes @carlosaml
  2. 2. why?
  3. 3. blog.crisp.se
  4. 4. Jon Wolter
  5. 5. ok
  6. 6. a little story
  7. 7. an online store (of whatever)
  8. 8. 10
  9. 9. 11
  10. 10. 12
  11. 11. 13
  12. 12. 14
  13. 13. 15
  14. 14. 16
  15. 15. 17
  16. 16. 18
  17. 17. 19
  18. 18. 21
  19. 19. 22
  20. 20. 23
  21. 21. 24
  22. 22. what’s next?
  23. 23. 26
  24. 24. 27
  25. 25. 28
  26. 26. 29
  27. 27. 30
  28. 28. now what?
  29. 29. 32
  30. 30. 34
  31. 31. HOWEVER
  32. 32. 38
  33. 33. 43
  34. 34. merge hell
  35. 35. a LOT going on for at least months... 45
  36. 36. 46
  37. 37. big scary merge before a big scary release 47
  38. 38. syntactic conflict class BlaBlaBla { <<<<<<< HEAD ! public void bla(Bla oldBla, New newBla) { ! ! oldBla.bla(); ! ! newBla.newBla(); ======= ! public void bla(Bla oldBla, Other otherBla) { ! ! oldBla.bla(); ! ! otherBla.otherBla(); >>>>>>> other commit ! } }
  39. 39. semantic conflict class BlaBlaBla { ! public void something(Bla bla) { <<<<<<< HEAD ! ! bla = bla.plus(14); ======= ! ! bla = bla.minus(7); >>>>>>> change ! ! //other stuff ! } }
  40. 40. integration conflicts main.jsp: <%@include file="hello.jspf" %> trunk: agivenbranch: new-file.jsp: hello.jspf => hey.jspf <%@include main.jsp: file="hello.jspf" %> <%@include file="hey.jspf" %>
  41. 41. and so forth
  42. 42. regressions
  43. 43. however...
  44. 44. the loyalty program team learnt something...
  45. 45. merge monkey
  46. 46. 59
  47. 47. 60
  48. 48. continuous integration?
  49. 49. 62
  50. 50. how many pipelines for this? 63
  51. 51. and how effective would they even be?
  52. 52. 65
  53. 53. still need to “integrate” 66
  54. 54. big scary merge 67
  55. 55. promiscuous integration martinfowler.com/bliki/FeatureBranch.html
  56. 56. 69
  57. 57. how about refactoring?
  58. 58. undeployable code
  59. 59. only trunk was releasable at any given time 72
  60. 60. $$$$$
  61. 61. ok, so what do we do?
  62. 62. “Feature branching is a poor man's modular architecture, instead of building systems with the ability to easy swap in and out features at runtime/ deploytime they couple themselves to the source control providing this mechanism through manual merging.” Dan Bodart
  63. 63. “The bigger the apparent reason to branch, the more you shouldn’t branch.” Jez Humble / David Farley
  64. 64. “Don't separate differing concerns by using a VCS, use an abstraction instead.” Stacy Curl
  65. 65. solutions?
  66. 66. branch by source control abstraction paulhammant.com/blog/branch_by_abstraction.html
  67. 67. trunk-based development
  68. 68. trunk-based development shopping cart?
  69. 69. trunk-based development shopping cart? loyalty program?
  70. 70. if (myFeatureIsOn) { doSomething(); } martinfowler.com/bliki/FeatureToggle.html
  71. 71. feature toggles/flags/bits
  72. 72. martinfowler.com/bliki/BranchByAbstraction.html
  73. 73. iterative Paul Hammant
  74. 74. big bang Paul Hammant
  75. 75. enables refactoring gowebbaby.com/magento-responsive-design/
  76. 76. 91
  77. 77. 93
  78. 78. always releasable
  79. 79. 95
  80. 80. test coverage
  81. 81. branching patterns
  82. 82. 98
  83. 83. 99
  84. 84. 100
  85. 85. 101
  86. 86. 102
  87. 87. paulhammant.com/2013/03/13/facebook-tbd-take-2/
  88. 88. “Feature branching is a poor man's modular architecture, instead of building systems with the ability to easy swap in and out features at runtime/ deploytime they couple themselves to the source control providing this mechanism through manual merging.” Dan Bodart
  89. 89. questions?

×