Porque Odeio Branches

Preview:

DESCRIPTION

Slides da palestra no Café Ágil da ThoughtWorks e Tá Safo em Belém, 10/08/2012. Outros links interessantes: http://www.youtube.com/watch?v=xzstASOvqNc http://continuousdelivery.com/2011/05/make-large-scale-changes-incrementally-with-branch-by-abstraction/

Citation preview

Trunk-BasedDevelopmentRafael Petry

Rafael Petry

Porque OdeioBranches

FeatureBranching

http://martinfowler.com/bliki/FeatureBranch.html

http://martinfowler.com/bliki/FeatureBranch.html

merge HELL

Conflito Sintáticoclass Person def initialize(name) @name = name<<<<<<< HEAD @first_name = name.split.first======= logger.debug "Registrado usuário #{name}">>>>>>> test endend

Conflito Semântico

“Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly.”

Martin Fowler

“The bigger the apparent reason to branch, the more you shouldn’t branch.”

Jez Humble and David Farley

FeatureToggles

<% if feature?(:new_awesome_feature) %> <li><%= link_to “Clique!!!”, new_feature_url %></li><% end %>

if feature?(:new_awesome_feature) # faz algo fantástico!else # faz o que era feito antes...end

http://code.flickr.com/blog/2009/12/02/flipping-out/

Branch byAbstraction

“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

SomeController

AnotherController

Event DB

SomeController

AnotherController

Event DB

SVC

SomeController

AnotherController

Event DB

SVC

SomeController

AnotherController

Event DB

SVC

SomeController

AnotherController

Event DB

SVCEventService

SomeController

AnotherController

Event DB

SVCEventService

Produção

Teste

SomeController

AnotherController

Event DB

SVCEventService

SomeController

AnotherController SVCEventService

http://www.slideshare.net/dtsato/refatorao-em-larga-escala

Exceções

Spikes

Free Software

http://github.com

Obrigado!Rafael Petryrafaelpetry@thoughtworks.com@rafaelpetry