+ All Categories
Home > Technology > Dev with github enterprise

Dev with github enterprise

Date post: 13-Jan-2015
Category:
Upload: hiroshi-wada
View: 727 times
Download: 0 times
Share this document with a friend
Description:
10 min talk at ATP
Popular Tags:
25
Dev with Github Ent. Lesson Learned Hiroshi Wada 10 min talk @ ATP - Jul 9, 2013
Transcript
Page 1: Dev with github enterprise

Dev with Github Ent.Lesson Learned

Hiroshi Wada10 min talk @ ATP - Jul 9, 2013

Page 2: Dev with github enterprise

Projects and the dev environments

Web app: Ajax, REST, Spring, Puppet, AWS, ...5-6 ppl, 1 yr 3500+ commitsForge (git), Jenkins, JIRA, FishEye, and Crucible

Command line app: plain Java, VMware, ...4 ppl, 4mo1100+ commitsGithub Enterprise, and Jenkins

Page 3: Dev with github enterprise

Our bad agile days

Push commits to master when you like

Add a tag in commit comments to track by JIRAe.g., "YDR-225 New exception in handler"

Pick up commits and create a review request

Big feature - branch and forget

Page 4: Dev with github enterprise

Problem: hard to review code

Pain of using JIRA, Fisheyes and CrucibleIndividual tools are nice - lack of workflow

Heavily depend on manual effortForget to write "YDR-XXX"No force to create a review

We're lazy. This never work.

Page 5: Dev with github enterprise

Problem: commit granularity

One JIRA issue =>One big commit containing all changes?or series of small commits?

Easy to review a series of commite.g. skip a refactoring making lots changes

But series of commits could be "contaminated"

YDR-XRefactoring

YDR-XAdd func

Merge Y and X

YDR-XFix a bug

YDR-YChange XXX

Page 6: Dev with github enterprise

Problem: Merge hell

Page 7: Dev with github enterprise

Problem: Merge hell

Page 8: Dev with github enterprise

Problem: Merge hell

Page 9: Dev with github enterprise

Problem: Cherry pick?

Hard to find which commits to cherry pickWhich commits addressing what issue?Commits could be "contaminated"

Cherry pick often did not workConflict - mostlyNo conflict - Can I trust?

Page 10: Dev with github enterprise

We need to fix it - but w/ little effort

Trunk-based development *No big branch

Branch-by-issueClear isolation of issues

Enterprise GithubSimple workflow by pull request

* paulhammant.com/2013/04/05/what-is-trunk-based-development/

Page 11: Dev with github enterprise

Our current workflow

1. Identify an issue small enough to finish in minutes to few days by one person

2. Record it and get the issue number

Page 12: Dev with github enterprise

Our current workflow

1. Identify an issue small enough to finish in minutes to few days by one person

2. Record it and get the issue number

Page 13: Dev with github enterprise

Our current workflow

1. Identify an issue small enough to finish in minutes to few days by one person

2. Record it and get the issue number

3. Create a branch and push commits

Page 14: Dev with github enterprise

Our current workflow

1. Identify an issue small enough to finish in minutes to few days by one person

2. Record it and get the issue number

3. Create a branch and push commits

Page 15: Dev with github enterprise

Our current workflow

1. Identify an issue small enough to finish in minutes to few days by one person

2. Record it and get the issue number

3. Create a branch and push commits

4. Send a pull request to initiate the review

Page 16: Dev with github enterprise

Our current workflow

1. Identify an issue small enough to finish in minutes to few days by one person

2. Record it and get the issue number

3. Create a branch and push commits

4. Send a pull request

Page 17: Dev with github enterprise

Our current workflow

1. Identify an issue small enough to finish in minutes to few days by one person

2. Record it and get the issue number

3. Create a branch and push commits

4. Send a pull request to initiate the review

5. Merge

Page 18: Dev with github enterprise

Who resolve conflicts?

Mostly no conflict thanks to short turn-around

Branch owner resolve conflicts by rebase before sending a pull request

Reviewer can just hit the "merge" button

Reviewer's job Branch owner's job

merge commit w/ conflicts merge commit w/o conflicts

Page 19: Dev with github enterprise

Rewrite the history

Ok to rewrite the history in remote (`push -f`) until sending a pull request - if you work alone

Allow us for working at night/weekend :)

Only adding commits after a pull requestRebase alters commit ids -> bad

commit id = SHA1(parent commit id, content)Commits get unreachable so as comments

i.e., no comment before a pull request

Page 20: Dev with github enterprise

After merging (1/3)

Fix issues (if raised) in the topic branch then merge (pull request) into master again

Mostly happen right after the first mergeNo *new* conflict to solve

Page 21: Dev with github enterprise

After merging (2/3)

If Master diverts largelyMerge master to the topic branch, orCreate a new issue & branch

Do same when master diverts while reviewing (i.e., after a pull request)

Page 22: Dev with github enterprise

After merging (3/3)

Delete the branch after few days

list of merged branches

Page 23: Dev with github enterprise

Tip: Make commit ids the single truth

Puppetize the whole deploymentGet a consistent test env in minutesFull stack, monitoring, ...Not the AWS resources yet

Don't rely on other versioningsInt. tests on CI => test scriptsRelease workflow => scripts

Page 24: Dev with github enterprise

Other Tips

Command line is your best friendEveryday git commands are just ~10

Hipchat !Aggregate all youneed (and not)

Nagios

Github

Nonsense :)

Discussion

Page 25: Dev with github enterprise

autosetuprebase = alwaysNo merge commits within one branch

Show status on consolee.g., github.com/olivierverdier/zsh-git-prompt*MUST* for those switching branches often

git fetch -pRemove tracking branches no longer exist


Recommended