SlideShare a Scribd company logo
#DOH17#DOH17
dall'idea al deploy
un lungo viaggio che passa per
GitFlow e SemVer
Mauro Servienti
@mauroservienti
@mauroservienti
#DOH17
3
Organizer & sponsors
GetLatestVersion.it
@mauroservienti
4
DevOps è prima di tutto una
forma mentis.
Gli strumenti sono una conseguenza
@mauroservienti
#DOH17
backlog
La gestione delle «idee»
«In progress»
@mauroservienti
#DOH17
develop
feature/super-segreta
feature/meno-segreta
master
release/1.0.0
@mauroservienti
#DOH17
Assiomi
•develop è sempre rilasciabile come beta
•master è sempre rilasciabile in produzione
@mauroservienti
#DOH17
Supponiamo che…
• Progetto vuoto: v0.0.0
• Feature A: v0.1.0
• Release: v0.1.0
• Feature B e Feature C in parallelo: v?
• Il lavoro in parallelo complica il tener traccia
• Della versione
• Di cosa si è rilasciato
• Della retro-compatibilità
• Con patch e hotfix si complica ancora di più
Introduzione a GitVersion
@mauroservienti
#DOH17
GitVersion
• Assegnare un numero di release è un task da macchina
• non da umano senziente
• Cosa ci impedisce di guardare alla history e
• fare dei ragionamenti sullo stato attuale?
• generare un numero di versione sensato?
• develop -> unstable/beta
• master -> stable/release
• Disponibile come:
• Task di MSBuild
• Library
• Command line
Cosa fa GitVersion per noi
@mauroservienti
#DOH17
gestione della release
develop
feature/super-segreta
feature/meno-segreta
master
release/1.0.0
@mauroservienti
#DOH17
gestione delle nuove feature
• feature/xyz
• Anche nome branch che volete voli
• Pull Request
develop
feature/super-segreta
<intermezzo>
Piccola divagazione
@mauroservienti
#DOH17
Pull Request e Review
• Nulla di diverso dal branch-per-feature tradizionale
• Un sistema basato sui concetti di GitHub introduce
• Pull Request
• Review
• Il nostro flusso diventa quindi:
• Branch -> Lavoro -> Push -> PR -> Review -> Merge
@mauroservienti
#DOH17
PR -> review -> merge
You cannot merge your own PR
• Importantissime in un processo attento alla qualità
• Le review sono la base della condivisione del sapere
• Siccome ci piace automatizzare:
• Introduzione delle build automatiche sulle PR
• Simili ad un gated check-in (per certi versi)
</intermezzo>
Torniamo a noi…
@mauroservienti
#DOH17
gestione delle hotfix/patch
develop
master
hotfix/1.1.1
bug
@mauroservienti
#DOH17
gestione delle hotfix/patch nel passato
develop
master
support/1.0
bug
hotfix/1.0.1
@mauroservienti
#DOH17
Perché siamo così
ossessionati dal
numero di versione?
@mauroservienti
#DOH17
Semantic Versioning
È vitale che una libreria
comunichi le tipologie di
cambiamento tra una
versione e l’altra
@mauroservienti
#DOH17
SemVer: Major.Minor.Patch
• Il numero di versione ha una semantica ben precisa
• Major: la nuova versione contiene breaking changes
• Minor: nuove feature retro-compatibili
• Patch: bug fixing retro-compatibile
• Fondamentale per permettere a chi vi usa di capire cosa succederà
• Soprattutto se aggiorna senza ricompilare, come per le hotfix…
@mauroservienti
#DOH17
senza ricompilare…breaking changes
• Voi usate un mio assembly che contiene:
void Foo() -> int Foo()
enum Bar{ Coffee, Tea } -> enum Bar{ Coffee, Cappuccino, Tea }
void FooBar() -> void FooBar( int arg: 10 )
@mauroservienti
#DOH17
ApprovalTests (salvaci tu)
• Rompe la build se:
• ci sono breaking changes
• non rispettiamo SemVer
• OSS: //github.com/approvals/ApprovalTests.Net
• Tanto semplice quanto scrivere un test:
@mauroservienti
#DOH17
//apicomparer.particular.net/compare/rabbitmq.client/3.4.guatda.com/cmx.p3...3.5.7
@mauroservienti
#DOH17
Riassumendo
• Se non avete un processo basato su CI non avete un processo
• Continuous Integration è la base della serenità
• GitFlow vi da la possibilità di gestire tutti gli scenari
• Automatizzate tutto l’automatizzabile
• Le persone sono fatte per pensare non per eseguire
• Semantic Versioning è semplicemente buona educazione
• Spingetevi alla paranoia se ne avete bisogno
• ApprovalTests + ApiComparer
#DOH17#DOH17
Mauro Servienti
Solution Architect @ Particular Software
makers of NServiceBus
mauro.servienti@particular.neti
@mauroservienti
//github.com/mauroservienti
#DOH17#DOH17
Grazie!

More Related Content

PDF
Git branching model
PDF
Continous integration e jenkins
PDF
Una nuova ricetta per lo sviluppo in WordPress
PPTX
Introduzione a git
PPTX
Works with ASP.NET Core on Linux and Mac
PDF
WPext a better and more extended WordPress
ODP
Migrare da TYPO3 4.5 a TYPO3 6.x
PDF
Introduzione a Git
Git branching model
Continous integration e jenkins
Una nuova ricetta per lo sviluppo in WordPress
Introduzione a git
Works with ASP.NET Core on Linux and Mac
WPext a better and more extended WordPress
Migrare da TYPO3 4.5 a TYPO3 6.x
Introduzione a Git

Similar to Dall'idea al deploy un lungo viaggio che passa per git flow e semver (20)

PPTX
Xamarin DevOps
PDF
Development process
PPTX
Containerized Liferay
PDF
Exploring VS Code
PDF
Anatomia di un progetto open-source
PPTX
Il "rilascio" con Octopus Deploy (visto dagli occhi di un dev)
KEY
Corso Python Deltapromo - Lezione 3
PDF
Introduzione a Git e GitLab
PPTX
Game matching with SignalR
PDF
Game matching with SignalR
PPT
PDF
Linux & Tools: per la piccola azienda e i freelance
PPTX
Visual Studio Release Management - una nuova Weltanschauung o un'evoluzione n...
PPTX
Azure dev ops meetup one
PPTX
Hybrid DevOps Stack
PPTX
Wpc2019 - Distruggere DevOps, la storia di un vero team
PDF
L’Open Source è davvero gratis?
PDF
Enabling DevOps for Machine Learning with Azure Pipelines
PPTX
Introduzione a Drupal 7 - 14/03/2013
PPT
Html5 e css3 nei miei progetti: cosa ho fatto
Xamarin DevOps
Development process
Containerized Liferay
Exploring VS Code
Anatomia di un progetto open-source
Il "rilascio" con Octopus Deploy (visto dagli occhi di un dev)
Corso Python Deltapromo - Lezione 3
Introduzione a Git e GitLab
Game matching with SignalR
Game matching with SignalR
Linux & Tools: per la piccola azienda e i freelance
Visual Studio Release Management - una nuova Weltanschauung o un'evoluzione n...
Azure dev ops meetup one
Hybrid DevOps Stack
Wpc2019 - Distruggere DevOps, la storia di un vero team
L’Open Source è davvero gratis?
Enabling DevOps for Machine Learning with Azure Pipelines
Introduzione a Drupal 7 - 14/03/2013
Html5 e css3 nei miei progetti: cosa ho fatto
Ad

More from Mauro Servienti (20)

PPTX
Welcome to the (state) machine @ ExploreDDD 2019
PPTX
Designing a ui for microservices @ .NET Day Switzerland 2019
PPTX
Welcome to the (state) machine @ Xe One Day Enterprise Applications
PPTX
All our aggregates are wrong @ NDC Copenhagen 2019
PPTX
Be like water, my friend @ Agile for Innovation 2019
PPTX
Microservices architecture is it the right choice to design long-living syste...
PPTX
Titles, abstracts, and bio matter... oh my! @ Global Diversity CFP Day 2019
PPTX
Living organizations, particular software @ do IT Better Parma
PPTX
Welcome to the (state) machine @ Crafted Software
PPTX
PO is dead, long live the PO - Italian Agile Day 2018
PPTX
Design a UI for your Microservices @ Do IT Better
PPTX
Microservices and pineapple on pizza what do they have in common - dos and ...
PPTX
All our aggregates are wrong (ExploreDDD 2018)
PPTX
Designing a ui for microservices
PPTX
Po is dead, long live the po
PPTX
Shipping code is not the problem, deciding what to ship it is!
PPTX
GraphQL - Where are you from? Where are you going?
PPTX
Progettare una UI per i Microservices
PPTX
The road to a Service Oriented Architecture is paved with messages
PPTX
La via verso SOA è lastricata di messaggi
Welcome to the (state) machine @ ExploreDDD 2019
Designing a ui for microservices @ .NET Day Switzerland 2019
Welcome to the (state) machine @ Xe One Day Enterprise Applications
All our aggregates are wrong @ NDC Copenhagen 2019
Be like water, my friend @ Agile for Innovation 2019
Microservices architecture is it the right choice to design long-living syste...
Titles, abstracts, and bio matter... oh my! @ Global Diversity CFP Day 2019
Living organizations, particular software @ do IT Better Parma
Welcome to the (state) machine @ Crafted Software
PO is dead, long live the PO - Italian Agile Day 2018
Design a UI for your Microservices @ Do IT Better
Microservices and pineapple on pizza what do they have in common - dos and ...
All our aggregates are wrong (ExploreDDD 2018)
Designing a ui for microservices
Po is dead, long live the po
Shipping code is not the problem, deciding what to ship it is!
GraphQL - Where are you from? Where are you going?
Progettare una UI per i Microservices
The road to a Service Oriented Architecture is paved with messages
La via verso SOA è lastricata di messaggi
Ad

Dall'idea al deploy un lungo viaggio che passa per git flow e semver