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

106
Multiple projects, different goals, one thing in common: the codebase! Carlos Lopes @carlosaml

Upload: carlos-lopes

Post on 30-Oct-2014

1.394 views

Category:

Technology


1 download

DESCRIPTION

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

TRANSCRIPT

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

Multiple projects, different goals, one thing in

common: the codebase!

Carlos Lopes@carlosaml

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

why?

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

blog.crisp.se

Page 4: Multiple projects, different goals, one thing in common: the codebase!
Page 5: Multiple projects, different goals, one thing in common: the codebase!
Page 6: Multiple projects, different goals, one thing in common: the codebase!

Jon Wolter

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

ok

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

a little story

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

an online store(of whatever)

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

10

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

11

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

12

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

13

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

14

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

15

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

16

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

17

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

18

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

19

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

21

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

22

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

23

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

24

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

what’s next?

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

26

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

27

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

28

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

29

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

30

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

now what?

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

32

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

34

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

HOWEVER

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

38

Page 39: Multiple projects, different goals, one thing in common: the codebase!
Page 40: Multiple projects, different goals, one thing in common: the codebase!
Page 41: Multiple projects, different goals, one thing in common: the codebase!
Page 42: Multiple projects, different goals, one thing in common: the codebase!
Page 43: Multiple projects, different goals, one thing in common: the codebase!

43

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

merge hell

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

45

a LOT going on for at least months...

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

46

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

47

big scary merge before a big scary release

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

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! }

}

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

semantic conflict

class BlaBlaBla {

! public void something(Bla bla) {<<<<<<< HEAD! ! bla = bla.plus(14);=======! ! bla = bla.minus(7);>>>>>>> change! ! //other stuff! }

}

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

integration conflicts

main.jsp: <%@include file="hello.jspf" %>

trunk:

new-file.jsp:

<%@include file="hello.jspf" %>

agivenbranch:

hello.jspf => hey.jspf

main.jsp:

<%@include file="hey.jspf" %>

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

and so forth

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

regressions

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

however...

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

the loyalty program team learnt something...

Page 55: Multiple projects, different goals, one thing in common: the codebase!
Page 56: Multiple projects, different goals, one thing in common: the codebase!
Page 57: Multiple projects, different goals, one thing in common: the codebase!

merge monkey

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

59

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

60

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

continuous integration?

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

62

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

63

how many pipelines for this?

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

and how effective would they even be?

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

65

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

66still need to “integrate”

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

67

big scary merge

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

promiscuous integration

martinfowler.com/bliki/FeatureBranch.html

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

69

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

how about refactoring?

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

undeployable code

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

72

only trunk was releasableat any given time

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

$$$$$

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

ok, so what do we do?

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

“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

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

“The bigger the apparent reason to branch, the more you

shouldn’t branch.”

Jez Humble / David Farley

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

“Don't separate differing concerns by using a VCS, use an

abstraction instead.”

Stacy Curl

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

solutions?

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

branch bysource controlabstraction

paulhammant.com/blog/branch_by_abstraction.html

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

trunk-based development

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

trunk-based development

shopping cart?

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

trunk-based development

shopping cart?

loyalty program?

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

if (myFeatureIsOn) {doSomething();}

martinfowler.com/bliki/FeatureToggle.html

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

featuretoggles/flags/bits

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

Paul Hammant

iterative

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

Paul Hammant

big bang

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

enables refactoringgowebbaby.com/magento-responsive-design/

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

91

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

93

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

always releasable

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

95

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

testcoverage

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

branching patterns

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

98

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

99

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

100

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

101

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

102

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

“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

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

questions?