Exercise — Write an actionable review comment
Core time: about 5 minutes. Write in your own notes; do not paste outside code or secrets into this course.
Choose the right classification
| Label | Use it when… | Typical merge effect |
|---|---|---|
| Blocking | a requirement, invariant, security boundary, or necessary evidence is not satisfied; | resolve before merge |
| Question | important context is missing and the excerpt does not establish the answer; | clarify before deciding |
| Suggestion | an improvement is worthwhile but current behavior can still satisfy the contract; | non-blocking unless team policy says otherwise |
| Nit | a minor consistency or presentation issue has negligible risk; | clearly non-blocking |
The six-part comment frame
- Classification: blocking, question, suggestion, or nit.
- Location: line, branch, or requirement.
- Observation: what the proposed code does, without guessing intent.
- Evidence: requirement, test, or reproducible condition.
- Impact: what could fail, leak, or remain ambiguous.
- Request: the smallest control and proof that would resolve the concern.
Solved example — sensitive logging
Blocking — request log: The new log statement writes the full email and
Authorizationheader, which conflicts with R6 and may persist a bearer token. Please remove the authorization value entirely, use the approved non-identifying event fields, and add a test or captured-log assertion showing that neither credentials nor the full email are emitted.
Notice that the comment names the location, observed data, requirement, credible impact, requested control, and evidence. It does not repeat a real token.
Your task — capacity branch
Write one comment that addresses both the <= boundary and the concurrent-request risk. Keep it specific enough that the author knows what “done” means.
Weak version: “This has a race condition. Please fix.”
Open the model comment after you draft yours
Blocking — capacity branch: When
registration_count == capacity, the<=condition still enters the insert path. The read/increment/save sequence is also not atomic, so two requests can both observe one remaining place and exceed R3. Please enforce the capacity check and registration write in one database-protected operation, then add full-capacity and simultaneous-request tests that fail if the final count exceeds capacity.
Self-check
- I classified the finding and named its location.
- I described observed behavior rather than the author’s intention.
- I linked the finding to R3 or an equivalent explicit invariant.
- I explained both the boundary error and concurrency risk.
- I requested a control and observable tests, not merely “fix it.”
- I included no real credential, customer record, or external code.
Interpretation: 5–6 points is actionable; 3–4 needs another pass; 0–2 should be rewritten around evidence and an explicit request. This is practice feedback, not a credential.