Opening a pull request
You finish a change on its own branch and open a pull request (PR): a request to merge it into main, the shared code. The PR shows the diff, the lines you added (+), and starts the automated checks (CI).
This PR does one thing: a function, passed(score), plus its test, in six lines. Small PRs get careful reviews. Google's review guide calls about 100 lines usually reasonable and 1,000 lines usually too large.
The review
You request a review. Code review means another engineer reads a change before it merges. It catches bugs early, spreads knowledge of the code across the team, and keeps the style consistent.
The reviewer reads the diff with questions in mind. Correctness: does it do what it says? Clarity: is it easy to read? Tests: do they cover the edges? Security: can bad input do harm? Performance: is it fast enough?
Line 2 says 50 or more passes, but 50 > 50 is False, so a score of exactly 50 fails. The reviewer comments on line 3: kind and specific, with the reason and a fix: “50 should pass. Use >= here?”
CI is green: the tests check 80 and 20 but never the edge, 50, where the bug hides. A second comment asks for that test. Then the reviewer chooses “Request changes”: the PR waits for an update.
Responding
The author answers each comment, changes line 3 to score >= 50 and adds assert passed(50). Pushing the new commit updates the same PR, and the two comments are marked resolved. Disagreeing politely, with a reason, is fine too.
Every push to the PR runs CI again. Now all three asserts pass, including passed(50), the edge case the first tests missed. The checks prove the code does what the tests say; the review asks whether the tests say enough.
Approve and merge
The reviewer reads the new commit, sees both comments answered, and approves. The review lamp turns green. Both engineers now know this code, and anyone can read the discussion in the PR later.
The main branch is protected: a PR merges only with the required approval and passing checks. Both lamps are green, so the lock opens and the change joins main, reviewed and tested.
What happens
;; step 1/10 · open-pr PR #42 Add passed() branch add-passed → main diff the lines this change adds (+) or removes (-) + def passed(score): + # 50 or more passes + return score > 50 + def test_passed(): + assert passed(80) + assert not passed(20) CI tests run: 2 asserts pass
Which approvals and checks are required is a repository setting (on GitHub, a branch protection rule). Many teams require one approval; some require two, or a code owner. Google's guide is a rule of thumb, not a law: it says the right size is up to the reviewer's judgment. A PR that renames one thing across 500 files can be easy to review.