Pull Requests and the Definition of Done

5.Done Means Done

A

In this chapter

We'll learn how work is checked and finished on a team — writing a good pull request, giving and receiving code review, and the Definition of Done — explained with a tidy-your-room argument everyone remembers from childhood, and ship group booking.

12–14 min

The Problem in Real Life

Anna moves her card to Done and tells John: "Group checkout is done!" He asks four questions. "Has someone reviewed it? Are there tests for every acceptance criterion? Is it on staging? Has Samantha tried it?" The answers are: no, some, no, no.

He moves the card back to In Progress — kindly. "It's not your fault. You just haven't seen our list yet. On a team, 'done' isn't a feeling. It's a checklist."

J

Done means done. Not 'done except for the tests'.

John

"Done on My Laptop" vs. Done for the Whole Team

Changes need a second pair of eyes

Code nobody else has read hides bugs, security holes and confusing parts.

Reviews can feel personal

Comments on your code can sting. Teams need a kind, useful way to give and receive them.

Everyone's "done" is different

Without a shared definition, half-finished work piles up and surprises appear at release.

Pull Requests, Code Review and the Definition of Done

The tidy room analogy: a child says, "I've tidied my room!" A parent walks in: the clothes are under the bed, and the toys are in the wardrobe. To the child, that was done. To the parent, it wasn't. The argument isn't really about the room — it's that they never agreed what "done" means. Software teams fix this with two habits: a review (the parent looking) and a written Definition of Done (the checklist they both agreed on).

  • Pull request — asking for your change to be merged: a pull request (PR — called a merge request on GitLab, Act 15) asks the team to merge your branch into main. It shows the exact changes, runs automated checks, and is where review happens. A good PR has a clear title, a description (what changed and why, with a link to the story), how to test it, and screenshots for anything visual.
  • Small PRs — easy to read, easy to trust: a PR changing 200 lines gets a careful review in 20 minutes. A PR changing 3,000 lines gets a tired "looks good to me". Split work into small PRs, each one complete and safe on its own.
  • Code review — what reviewers look for: correctness (does it do what the story says, including edge cases?), tests (is every acceptance criterion tested?), readability (will the next person understand it? Act 07), security (secrets, user input, permissions — Act 16, Act 22), and fit (does it follow the project's patterns?).
  • Giving review comments — be kind and specific: comment on the code, not the person. Explain why, and suggest a fix: "This loop runs a database query for every seat — 60 queries for one booking. Could we fetch them in one query?" Mark small things as optional ("nit:"), and praise good work too.
  • Receiving review comments — it's about the code: every comment is free help from a colleague. Say thanks, ask if something's unclear, fix it or explain your reasoning politely. Everyone's code gets comments — including John's.
  • Definition of Done — the agreed checklist: the Definition of Done (DoD) is a short, written list the whole team agrees on. A card can only move to Done when every item is true. It's the same for every card, so "done" means the same thing to everyone.
Table — BlueTicket's Definition of Done
ItemWhy it's there
Every acceptance criterion metWe built what the story promised
Tests for each criterion; all tests passIt works now and stays working (Act 17)
PR reviewed and approved (two for payments)A second pair of eyes
All automated checks passBuild, lint and tests are green
Documentation updated if neededThe next person isn't lost (Act 16)
Deployed to staging and checkedWorks outside a laptop
Product Owner accepted itIt's what the business actually wanted
Table — Review comments: unhelpful vs. helpful
UnhelpfulHelpful
This is wrong.This runs one query per seat (60 for one booking). Could we fetch all seats in one query?
Why did you do it like this?I'm not sure why we sort here — is it needed for the email? A comment would help.
Bad name.nit: groupSize might be clearer than n here.
(nothing about good parts)Nice — the transaction around the seat hold is exactly right.
The description of PR #318
## Group booking for colleges (#318)
Story: As a college coordinator, I want to book 10–60 seats in one order,
so that I can pay for the whole group at once.
### What changed
- New group_bookings table and POST /api/group-bookings endpoint
- Group checkout screen (screenshot below)
- Seat hold now covers all seats in one transaction
### How to test
1. On staging, open any show and choose 30 seats
2. Check out with the test payment card
3. Expect one payment and one confirmation email listing all 30 seats
4. Try 61 seats: expect "Groups can book up to 60 seats"
### Checklist
- [x] Tests for every acceptance criterion
- [x] README updated (new environment variable: GROUP_MAX_SEATS)

BlueTicket's Definition of Done: (1) every acceptance criterion is met; (2) tests written for each criterion, and all tests pass; (3) the PR is reviewed and approved by at least one teammate (two for payment code); (4) all automated checks pass; (5) documentation updated if needed (Act 16's README); (6) deployed to staging and checked there; (7) the Product Owner has tried it and accepted it.

PR #318: Anna splits her work into three smaller PRs. The biggest, #318 Group booking for colleges, gets two review comments: the 60-queries loop, and a missing test for the 61-seats rule. She fixes both. Two approvals. All checks passed. It goes to staging, Samantha books a test group of 30 seats, and accepts it. Now the card moves to Done — for real.

The close: group booking ships in two sprints, on time for festival season, as v2.4.0. At the sprint review, Northgate's coordinator watches Anna demo it herself: 45 seats, one payment, the 15% discount, student names added later. Within a week, eleven colleges have used it. Samantha pins a printout of the first group confirmation to the office wall.

Key Takeaway

A pull request asks to merge your branch, with a clear description and how to test it; keep PRs small so reviews are careful. Reviewers check correctness, tests, readability, security and fit, and comment kindly and specifically on the code, not the person. The Definition of Done is the team's agreed checklist — like agreeing what a tidy room means — and a card is done only when every item is true.

Why This Matters

Pull requests and code review are where you'll learn the most in your first year — from reading others' code and from the comments on yours. Writing clear PRs and handling feedback well make you easy to work with. And a shared Definition of Done is what lets a team say "it's done" and have everyone, including the business, believe it.

Group booking is live, and Anna demoed it herself. Samantha already has the next idea — and this time, John asks Anna to turn it into stories on her own.