Where a folder split leaks#
Take a change that renames a JSON field from amount to amount_cents. Reviewer A takes api/ and sees a consistent rename. Reviewer B takes web/ and sees a consistent rename, except for one export screen that still reads amount. That screen is unchanged, so it is not in the diff. Neither reviewer has a line to comment on.
This can be shown in a dozen lines:
const api = () => ({ amount_cents: 1250 }); // changed, reviewer A
const list = (r) => (r.amount_cents / 100).toFixed(2); // changed, reviewer B
const exportRow = (r) => (r.amount / 100).toFixed(2); // unchanged, in no diff
console.log(list(api()), exportRow(api()));
Node prints 12.50 NaN. Every changed line is right.
Choose the split#
| Change | Split by | Who owns the seam |
|---|---|---|
| Independent packages, no shared interface changed | Folder | Nobody needed. Confirm with a search for shared imports |
| API or schema change with several callers | Producer, and consumers | The consumer reviewer, who searches all callers and not only changed ones |
| Migration with application code | Data states over time | One person walks old code with new schema, then new code with old schema |
| Security-sensitive flow across layers | Question: authorization, input, logging | Whoever takes authorization follows one request end to end |
| Generated code and its source | Generator input, and a regeneration check | The person who regenerates and compares |
If the seam needs as much context as either half, split the pull request instead.
Write the assignment in the pull request#
Ana:
api/and the schema, at77d0c2e. Ben: all readers ofamount, changed or not. Ben owns the search. Neither of us has reviewedinfra/.
Then make the search checkable. Put the command and its result in the comment:
git grep -n '\bamount\b' 77d0c2e -- '*.ts' '*.sql'
A grep proves little in both directions. It misses names that are built at run time, other repositories and stored reports, and it matches unrelated fields. List what it could not reach, such as another repository, and ask its owner.
Combine the two results#
An approval covers the pull request as a whole. GitHub has no notion of approving half, so the first approval can let the change merge while the other half is unread. Either hold approval until both reviewers have written their result, or require two approvals. With code owners, any one owner's approval satisfies an entry, so check that the split and the ownership rules agree.
Worked example#
This example is fictional. Two reviewers split the rename above by folder and both approve. The export then shows NaN. On the next such change they split by producer and consumer. Ben's search returns nine readers, seven of them in the diff. The two unchanged ones are the export screen and a monthly report. He asks for both in the same change, and adds that a partner's integration cannot be searched from here. Its owner becomes the third person in the decision.
If one of you must stop early, hand over coverage by question. Return to handing over evidence.