Trunk-Based
Development
Rafael Petry
Porque Odeio
Branches
Rafael Petry
Feature
Branching
http://martinfowler.com/bliki/FeatureBranch.html
http://martinfowler.com/bliki/FeatureBranch.html
merge   HELL
Conflito Sintático
class Person
  def initialize(name)
    @name = name
<<<<<<< HEAD
    @first_name = name.split.first
=======
    logger.debug "Registrado usuário #{name}"
>>>>>>> test
  end
end
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
Feature
Toggles
<% 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 by
Abstraction
“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     Event
                            DB



AnotherController
SomeController     Event
                            DB



AnotherController           SVC
SomeController     Event
                            DB



AnotherController           SVC
SomeController     Event
                            DB



AnotherController           SVC
SomeController        Event
                                   DB



AnotherController   EventService   SVC
Produção


 SomeController                   Event
                                              DB



AnotherController              EventService   SVC

                     Teste
SomeController        Event
                                   DB



AnotherController   EventService   SVC
SomeController



AnotherController                             EventService              SVC



                  http://www.slideshare.net/dtsato/refatorao-em-larga-escala
Exceções
Spikes
Free Software
http://github.com
Obrigado!
Rafael Petry
rafaelpetry@thoughtworks.com
@rafaelpetry

Porque Odeio Branches