Download - Dev with github enterprise
![Page 1: Dev with github enterprise](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/1.jpg)
Dev with Github Ent.Lesson Learned
Hiroshi Wada10 min talk @ ATP - Jul 9, 2013
![Page 2: Dev with github enterprise](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/2.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/3.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/4.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/5.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/6.jpg)
Problem: Merge hell
![Page 7: Dev with github enterprise](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/7.jpg)
Problem: Merge hell
![Page 8: Dev with github enterprise](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/8.jpg)
Problem: Merge hell
![Page 9: Dev with github enterprise](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/9.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/10.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/11.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/12.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/13.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/14.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/15.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/16.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/17.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/18.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/19.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/20.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/21.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/22.jpg)
After merging (3/3)
Delete the branch after few days
list of merged branches
![Page 23: Dev with github enterprise](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/23.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/24.jpg)
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](https://reader031.vdocument.in/reader031/viewer/2022020115/54b53a054a7959c8678b456e/html5/thumbnails/25.jpg)
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