Closed Bug 1013833 Opened 10 years ago Closed 10 years ago

Work out a code review process for Metrics work

Categories

(Mozilla Foundation :: Metrics, task, P2)

x86
macOS

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adam, Assigned: adam)

Details

(Whiteboard: [June27])

Now that some of these apps I've been building are moving into production use, I need to define a process for getting new code reviewed before it’s shipped to production.
Whiteboard: [June13]
Whiteboard: [June13] → [June27]
I'm happy to look at stuff, is the development happening on Github?

In general, if things are developed feature-by-feature, what I'd do is create an issue and a new branch related to that issue. When it's ready for review, send a pull request in from the new branch to the master branch, and then ping me (@brianloveswords) in the comments and I can check it out.

In this case I'd imagine there's some code that's already in master that needs a look, so just point me at the repos and I can check them out over the next week.
Oh I implied this, but I want to elaborate:

Doing the whole "don't commit to master; always make feature branches and send PRs to yourself" is something I highly recommend. I maintain a lot of NPM modules, and most of them don't have co-maintainers (which is something I should fix) and this is a strategy I use on all of those. 

Writing code and reviewing code are two different modes of thinking and by making a PR instead of committing everything straight to master, you give yourself the opportunity to look at your own code in "review mode". I've caught a lot of bugs/bad designs just by giving myself another opportunity to look at my own code with that different perspective.
+1 to what Brian said about PR's and branches.

We've talked about doing reviews across teams on-demand for different projects in the past, but nothing ever stuck (AFAICT). Hitting mofo-dev with a request isn't a bad start (like you did :) ). There are always keeners like Brian who are willing to help.
Thanks both, this is awesome.

(In reply to Brian Brennan [:brianloveswords] from comment #1)
> I'm happy to look at stuff, is the development happening on Github?

yep :)

> In general, if things are developed feature-by-feature, what I'd do is
> create an issue and a new branch related to that issue. When it's ready for
> review, send a pull request in from the new branch to the master branch, and
> then ping me (@brianloveswords) in the comments and I can check it out.

Thanks, I will make sure to do this.

> In this case I'd imagine there's some code that's already in master that
> needs a look, so just point me at the repos and I can check them out over
> the next week.

This has been through a security review, but a general code review would be greatly appreciated:
https://github.com/mozilla/adhoctribution/
(Thank you both again!)
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
(In reply to Brian Brennan [:brianloveswords] from comment #2)
> Writing code and reviewing code are two different modes of thinking and by
> making a PR instead of committing everything straight to master, you give
> yourself the opportunity to look at your own code in "review mode". I've
> caught a lot of bugs/bad designs just by giving myself another opportunity
> to look at my own code with that different perspective.

Nice, I agree, though I personally tend to do it only with a subset of my changes. It also forces me to explain the rationale for my changes in the PR and/or the commit logs, which is great documentation for the future.

It's also actually best practice #4 in "11 proven practices for more effective, efficient peer code review", one of the very few articles on doing code review I could find on the internet:

http://www.ibm.com/developerworks/rational/library/11-proven-practices-for-peer-review/

Definitely worth a read, IMO!
You need to log in before you can comment on or make changes to this bug.