Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead...
Transcript of Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead...
![Page 1: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/1.jpg)
Push better software with Pull Requests Rob Moore Lead Consultant, Readify [email protected] @robdmoore
![Page 2: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/2.jpg)
Page
What even is a Pull Request anyway?
2
![Page 3: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/3.jpg)
Page 3
Pull Request Github.com/Org/Repo
Local Repository
Github.com/Rob/Repo Fork!
Clone
![Page 4: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/4.jpg)
Page 4
Pull Request Github.com/Org/Repo
Local Repository
Github.com/Rob/Repo Fork!
Push changes into Fork
Pull Request
![Page 5: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/5.jpg)
Page
Let’s see a Pull Request in action!
5
![Page 6: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/6.jpg)
Page
Pull Requests: the bedrock of modern OSS development
6
![Page 7: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/7.jpg)
Page
› Random third parties › Easy and effective › Contextual conversations › Keep track of core team
7
Contributors
![Page 8: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/8.jpg)
Page
Maintainers › Easier/more contributions › Contextual conversations › Get code ready to merge › Fosters collaborative community › Review all code
8
![Page 9: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/9.jpg)
Page Coordinate distributed WIP 9
master featurex rob/featurex
Make Branch
Open Pull Request
*Commit*
Branch
*Commit* Open Pull Request
Branch
Open Pull Request
Merge once OK
matt/featurex
*Commit*
![Page 10: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/10.jpg)
Page
Lowers barrier of entry for everyone
10
![Page 11: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/11.jpg)
Page
Pull Requests and commercial software: strange acquaintances or comfy bedfellows?
11
![Page 12: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/12.jpg)
Page
What’s the point? We don’t need PRs right? We have: › Closed source › Everyone with access to the repo › We are collocated › We have existing code review processes
12
![Page 13: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/13.jpg)
Page
Increase quality through code reviews
13
![Page 14: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/14.jpg)
Page
Increase quality by reducing technical debt
14
![Page 15: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/15.jpg)
Page
Increase quality by reducing build failures
15
![Page 16: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/16.jpg)
Page
Support new developers
16
Upskill juniors
![Page 17: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/17.jpg)
Page
Remote work / context switching
17
![Page 18: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/18.jpg)
Page
Easily separate changes
18
git checkout master git checkout –b bugz git commit –am “Fixing bug” git push origin bugz *Create Pull Request*
git checkout –b featurew git commit –am “Added feature X” git commit –am “Refactored y” *Find bug*
git checkout featurew *Continue work*
![Page 19: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/19.jpg)
Page
Reduce feedback cycles
19
![Page 20: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/20.jpg)
Page
Use OSS model to scale
20
Product A Core Team
Product B Core Team
Product A Codebase
Product B Codebase
Pull Request
![Page 21: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/21.jpg)
Page
The most effective change I’ve introduced that has improved code quality!
21
![Page 22: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/22.jpg)
Page
It can’t be a silver bullet right? … right?
22
![Page 23: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/23.jpg)
Page
Bikeshedding
23
![Page 24: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/24.jpg)
Page
“Just because you are capable of building a bikeshed does
not mean you should stop others from building one just
because you do not like the color they plan to paint it … you
need not argue about every little feature just because you
know enough to do so … the amount of noise generated by
a change is inversely proportional to the complexity of the
change.”
24
Poul-Henning Kamp, 1999
![Page 25: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/25.jpg)
Page
Balancing pickiness
› Particularly picky people might be avoided
› Minor changes stop important work getting merged
25
![Page 26: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/26.jpg)
Page
Less efficient communication
26
![Page 27: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/27.jpg)
Page
Lack of respect
27
code smell
awful rubbish
bad practice
smelly
why would you do that? irresponsible
![Page 28: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/28.jpg)
Page
Lack of cohesion › No core team › Lot’s of conflicts › PRs might get merged with little inspection › Devs might merge their own PRs › Competing priorities: ignoring review comments
28
![Page 29: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/29.jpg)
Page
Big PRs › Longer to get up › Harder to review › More likely to be wrong › Harder to integrate
29
![Page 30: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/30.jpg)
Page Page 30
Bad diff UIs
![Page 31: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/31.jpg)
Page
There are things to be wary of, but
in general they can be dealt with
and PRs often help visualise them
31
![Page 32: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/32.jpg)
Page
You’ve got me convinced – what tips do you have?
32
![Page 33: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/33.jpg)
Page
Invest in the future › Commit hygiene › Retain metadata when merging › Keep PRs focussed › Good branch/PR name and PR description
33
![Page 34: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/34.jpg)
Page
PR Hygeine › Small › Frequent › Delete remote branches when merged
34
![Page 35: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/35.jpg)
Page
Collaborate mindfully › Subscribe to notifications › Regularly review and merge PRs › Prefer one PR per person › Integrate early or via separate PR
35
![Page 36: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/36.jpg)
Page
Act as a team › Be nice › Avoid emotive phrases › Call out awesome work › Ask questions when you aren’t sure › Don’t interrupt people if your PR isn’t urgent › Discuss major work before raising a PR
36
![Page 37: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/37.jpg)
Page
Have fun!
37
![Page 38: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/38.jpg)
Page 38
![Page 39: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/39.jpg)
Page 39
![Page 40: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/40.jpg)
Page 40
![Page 41: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/41.jpg)
Page
These tips will help make PRs work smoothly
41
![Page 42: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/42.jpg)
Page
So what should I do when I go back to work on Thursday?
42
![Page 43: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/43.jpg)
Page
Getting started › Use Git J › Find someone that knows Git well › In the first couple of weeks have someone push hard to regularly review and merge PRs to get the team in a flow then after that let the team self organise into their own rhythm from there
› When there is inevitably pain from large PRs let it happen and then after the fact be retrospective
43
![Page 44: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/44.jpg)
Page
Tools › GitHub › GitHub Enterprise › Bitbucket › Stash › GitLab
44
› Build notifications – Stash and GitHub
› GitVersion – detect pull requests and version appropriately
![Page 45: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/45.jpg)
Page
Be respectful Have fun Keep PRs small
45
![Page 47: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/47.jpg)
Page
Further Reading › http://robdmoore.id.au/blog/2013/12/01/using-pull-requests-for-
commercialprivateproprietary-development/
› https://help.github.com/articles/using-pull-requests
› https://confluence.atlassian.com/display/BITBUCKET/Work+with+pull+requests
› https://confluence.atlassian.com/display/STASH/Using+pull+requests+in+Stash
› http://scottchacon.com/2011/08/31/github-flow.html
› https://github.com/blog/1124-how-we-use-pull-requests-to-build-github
› http://blog.codeship.io/2013/08/22/the-codeship-workflow-part-2-pull-requests-and-code-review.html
› http://cesiumjs.org/2013/10/08/GitHub-Pull-Request-Workflows/ 47
![Page 48: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/48.jpg)
Page
Pull Requests and Mainline Development and Continuous Delivery oh my!?
48
![Page 49: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/49.jpg)
Page
PRs and mainline development
49
![Page 50: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/50.jpg)
Page
“PRs should represent a ‘set of changes you want to merge into master’ rather than ‘a complete feature ready to be integrated’. As such they are directly compatible with mainline development.”
50
Rob Moore, 2014
![Page 51: Push better software with PullRequests · Push better software with PullRequests Rob Moore Lead Consultant, Readify rob.moore@readify.net @robdmoore](https://reader036.fdocuments.us/reader036/viewer/2022062604/5f77383268ef603a41235d79/html5/thumbnails/51.jpg)
Page
PR as a CD pipeline step › PRs increase confidence › Build PRs to get even more confidence › Ensure reviewers are thinking about effect on prod
51