Code Collaboration With Git & Stash (and Bamboo)

Post on 21-Oct-2014

2,467 views 2 download

Tags:

description

 

transcript

Code Collaborationwith

Git + Stash + Bamb!

Sven Peters

@svenpethttp://svenpet.com

Happy Ambassador

Lonesome Cowboy

The trouble startswith the team

It's not your code

It's your teams code

C

DE

T GETHERget help

Bringing code together

Sharing code with others

Protecting your code

C

DE

T GETHER

Your coding workflow!

Bringing code together

C

DE

T GETHER

Branching is cool!

Are you

crazy?

MERGE

HELL

Branching is cool!

DVCS rocks

GitMercurial

A branch for every issue

Branches have short lives

~ 2 days

What about Continuous Integration ?

Builds set up for the main branch

plan branches

This is not Continuous Integration

Auto merge branches

master

change

feature branch

push changes

Option #1

Auto merge branches

feature branch

change

master

push changes

Option #2

Alright, maybe it is :(

Bamboo

C

DE

T GETHER

Sharing code with others

I've written that code. It's faster

when I just fix it.

Do you have such a team member?

I can't tell you how this works.

It's too complicated.

This is a very sensitive area... You can easily

break things

I want to protectmy job!

Do you have such a team member?

Do you have such a team member?

Firehim!

learn

better quality

feel better

blame

Why do you want to discuss your code changes?

Discuss your code changes

they get merged!before

use Pu$ Requests

use Pu$ Requests

what do you think?

create

use Pu$ Requests

what do you think?

invite

use Pu$ Requests

what do you think?

discuss & approve

use Pu$ Requests

what do you think?

merge

use Pu$ Requests

I know @Ben has already written an algorithm for that

involve

Dem Time

on Codeis great !

Share and Collaborate

on Codeshould be easy and fast

Share and Collaborate

Simple Workflow

Pull Request

Branch

Merge

Simple Workflow

Pull Request

Branch

Merge

No Roles

C

DE

T GETHER

Protecting your code

C

DE

T GETHER

Make sure....

Pull Request

Branch

Merge

No RolesSimple Workflow

Pull Request

Branch

Merge

No RolesSimple Workflow

Pull Request

Branch

Merge

Some RolesSimple Workflow

Branch Permissions

Making surethat the right people can merge codeinto the right branches

#1

Pull Request

Merge

minimum two a'rovals

Review Rules

Pull Request

Merge

Review Rules

Making surethat the somebody reviewed the code

#2

Pull Request

Merge

Build Rules

Pull Request

Merge

Build Rules

Making surethat the build stays green after a merge

#3

Project Permissions

ProjectWonderland Project

Fairytale

Making surethat the right people have access

#4

to the code they need

Security DevSpeed

The Repo GuardBeware

Can I get a new Repository?

Please!

Can I get a new Repository?

I'll do in 3 days

Create Repository

Making surethat the development team can move fast

#5

Your coding workflow!

Teams are different

so are their workflows

Feature BranchWorkflow

ForkWorkflow

ForkWhat is a ?

Makes a copy of a repository on the server

No direct pushing to the original remote repository

Synch changes from the original remote repository

automatic synch can be activated in Stash

ForkWhy a in the enterprise?

tweaking libraries

innovation spikes

protecting components

reduce noise

interaction with contractors

instead of branch permi(ions

Some people need more

Features1.

Features2

Feature 1:

Stash Add-ons

Feature 2:

Write a hook!

Protect unmerged branch hook

you must merge before you delete a branch

Write a hook!

Unaprove Reviewer hook

new code in a pu$ request must be reviewed!

Write a hook!

Branch from green build hook

never branch from a red build

HooksAdd-Ons

or download one

see code

see issue details

see build status

Code On!

svenpet.com/slides

@svenpethttp://svenpet.com