(e)git + tycho + gerrit + mylyn = #win @ eclipse day toulouse 2012

35
Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24 th, , 2012 (E)Git + Tycho + Gerrit + Mylyn _______ = #WIN * * mostly

Upload: benjamin-cabe

Post on 03-Sep-2014

1.220 views

Category:

Technology


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

• (E)Git • + Tycho • + Gerrit • + Mylyn • _______ • = #WIN*

• * mostly

Page 2: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

What you will learn

§ A better way to go than good ol’ CVS/SVN + PDE Build

§ How Git can improve your development workflow

§ How continuous integration coupled with code review can save you time

§ Where to look for to get started

Page 3: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ How to actually setup Gerrit, Hudson § How to write better code J

… and what you will not!

Page 4: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ No central repository § Fast § Branching/Merging made easier

§  easy to experiment new ideas

§  easy to isolate features

DVCSs in a nutshell

Page 5: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ Created by Linus Torvalds in 2005 § Need for a fast, distributed, corruption-proof

SCM to manage the Linux kernel codebase

Page 6: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ Staging area § Hooks

§  sending an e-mail

§  rejecting a push if e.g. header files are missing

§  smart management of binary files

§ Stashing, cherry-picking, bisecting, … § Advanced merge strategies § File renaming

§ GitHub! and also bitbucket, Gitorious, …

Git cool features

Page 7: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ Useful read: http://nvie.com/posts/a-successful-git-branching-model/

Git workflow

Page 8: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ gitx § SourceTree () § GitHub () § TortoiseGit § EGit

Git tools

Page 9: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ gitx § SourceTree () § GitHub () § TortoiseGit § EGit

Git tools

Page 10: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

Git tools – gitx

Page 11: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ gitx § SourceTree () § GitHub () § TortoiseGit § EGit

Git tools

Page 12: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

Git tools – SourceTree

Page 13: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ gitx § SourceTree () § GitHub () § TortoiseGit § EGit

Git tools

Page 14: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

Git tools – Github

Page 15: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ gitx § SourceTree () § GitHub () § TortoiseGit § EGit

Git tools

Page 16: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

Git tools – TortoiseGit

Page 17: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ gitx § SourceTree () § GitHub () § TortoiseGit § EGit

Git tools

Page 18: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ Team provider for Git § Git perspective § Integration with the Project Explorer § Synchronize § History

§ Integration with Mylyn

EGit

Page 19: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

DEMO!

• EGit

Page 20: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ A way to build, test and release Eclipse/OSGi artifacts with Maven

§ Tycho feature list: §  Build OSGi bundles / Eclipse plugins

§  Execute tests within the OSGi runtime

§  Build Eclipse Features

§  Build p2 repositories

§  RCP applications a.k.a. Products

§  …

§ Integrates with the rest of the Maven ecosystem

Tycho

Page 21: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ What is Maven? A build system! § Tycho is a set of Maven plugins § How is it different from other Maven plugins?

§  It reuses the PDE metadata to configure the build

§  It alters the standard Maven resolution logic to support OSGi dependencies (MANIFEST.MF, feature.xml, etc.)

§  It adds to Maven the ability to read p2 repository

Relationship with Maven

Page 22: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ What is p2? An OSGi-based provisioning system for OSGi!

§ Tycho reads and downloads dependencies from p2 repositories.

§ Tycho produces p2 repositories § Internally, tycho embeds parts of p2 in order

to perform the dependency resolution § Maven + p2 = Tycho! J

Relationship with p2

Page 23: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

DEMO!

• Tycho

Page 24: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ When one developer writes code, another developer is asked to review that code

§ A careful line-by-line critique § Happens in a non-threatening context § Goal is cooperation, not fault-finding § Integral part of coding process § Otherwise this will happen:

§  Debugging someone elses broken code

§  Involuntary code review: Not so good; emotions may flare

http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf

Code review?

Page 25: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ Developped by Google (for Android) § Based on Git

§ Web-based code review tool acting as a Git repository managing pending patches before they are merged into a blessed repository

Gerrit

Page 26: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

Interacting with a Git repository

Working Tree

Local repository

Remote repository

push

fetch

pull

commit

Page 27: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

Interacting with a Gerrit repository

Working Tree

Local repository

Blessed repository

fetch

pull

Gerrit push

for review

commit sync

Page 28: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

Gerrit workflow

Page 29: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

DEMO!

• Gerrit

Page 30: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ Mylyn is a task and application lifecycle management (ALM) framework

§ Task-focused interface à realign the IDE so as you only see relevant code/information

§ Huge ecosystem of plug-ins to integrate with ALM and collaboration tools

Mylyn

Page 31: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

Mylyn

Page 32: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

DEMO!

• Mylyn

Page 33: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

Gerrit + Tycho + Jenkins/Hudson – DEMO!

Page 34: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

§ Git can really help you § Tycho is stable*, powerful, and extensible § Mylyn rocks. Well integrated with JDT, CDT,

EGit, Hudson/Jenkins, Gerrit… § Code review with Gerrit is the icing on the

cake (if you have someone to help you set it up J)

* http://wiki.eclipse.org/CBI

In a nutshell

Page 35: (E)Git + Tycho + Gerrit + Mylyn = #WIN @ Eclipse Day Toulouse 2012

Copyright © 2012 Sierra Wireless. All Right reserved. Made available under the Eclipse Public License v1.0. Eclipse Day Toulouse May 24th,, 2012

Questions? … Thank you! J

Benjamin Cabé @kartben http://blog.benjamin-cabe.com