Skip to content

6 · PRs, Code Review & Team Git ​

27. 10. 2026 · Slides (EN) · Slides (CZ)

Materials for this seminar accumulate here: the setup, the templates, the homework.

The rule from today: nothing merges into main without a teammate's approval. Approve means "I could explain this change and fix it myself."

Agent review: the rules ​

Use it. Copilot review on GitHub, or your own agent on the diff. It's good at obvious bugs, missing checks and typos; it doesn't know your story or why your team builds things the way it does.

  1. Author runs it first, as part of self-review. Fix or answer what it finds before you ask a teammate.
  2. Every comment gets an answer: fixed, or why not. Agent comments too.
  3. A human approves. An agent can comment; it can't approve.
  4. Teach it your rules: .github/copilot-instructions.md or CLAUDE.md.

Step 1 · Team setup ​

Protect main ​

Already have a ruleset? Check it matches. Otherwise, on one laptop, everyone watching:

  1. Team repo → Settings → Rules → Rulesets → New ruleset → New branch ruleset
  2. Name: Protect main · Enforcement status: Active
  3. Target branches: Add target → Include default branch
  4. Rules: tick Restrict deletions, Require a pull request before merging, Block force pushes
  5. Under Require a pull request before merging → Show additional settings: Required approvals 1, tick Dismiss stale pull request approvals when new commits are pushed
  6. Leave the bypass list empty. Leave any status checks you already have.
  7. Optional: tick Automatically request Copilot code review.

Your first PR through it ​

One branch, one PR, reviewed by the whole team on one screen:

  • README up to date: what the app is (one or two sentences + live URL) · how to run it locally · who's on the team · how you work: branches, and every PR needs a teammate's approval
  • .github/pull_request_template.md with this content:
markdown
## What
<!-- What changes for the user, in one or two sentences -->

## Why
<!-- Link the story or issue -->

## How to test
1.

## Screenshots
<!-- If the UI changed -->

## Checklist
- [ ] I read my own Files changed, top to bottom
- [ ] I ran an agent review and answered its comments
- [ ] I can explain every change

Step 2 · Open a PR ​

From the branch you're working on. Before you request a teammate:

  1. Read your own Files changed. Stray console.log? A file you never meant to touch?
  2. Run an agent review. On GitHub: Reviewers → Copilot. Or paste this to your agent:
text
Review the changes on this branch against main. Check them against our CLAUDE.md
and the story in the PR description. List problems as blocking / suggestion / nit,
each with file and line and why it matters. Don't change any code.
  1. Fix or answer what it found. Fill in the template. Then request a teammate.

Branch is huge? Say in the description which part to review. Next time, smaller: one story slice per PR.

Step 3 · Review round ​

Review the next person's PR (alphabetical, the last reviews the first).

What to look for, in order:

  1. Does it do the job? What the story asked. Run it if it touches the UI.
  2. Is it safe? Checks on the server, not only in React · "me" from the session, never the body or the URL · validated on both sides, server errors shown on the field.
  3. Can I explain it? If not, that's a question, not a pass.
  4. Style, last, and only what a linter can't catch.

How to write it: start every comment with a label: blocking: question: suggestion: nit: praise: (Conventional Comments). About the code, never the person. Ask, don't order. Say why.

✗ "This is wrong." ✓ "blocking: anyone can edit anyone's quack via PATCH /quacks/:id. Could the service check the owner like deleteQuack does?"

Your review: at least 2 comments, one of them a question:, and a one-line summary with Approve or Request changes.

Getting reviewed: reply to every comment ("fixed in abc123", or why not). The reviewer resolves the thread. Two rounds and still stuck: talk across the table.

Done means ​

Everyone finishes:

  • main is protected
  • the README PR is merged through an approval
  • you opened one PR and reviewed one
  • every comment on your PR has an answer, agent comments too

Already done?

  • Review by running your teammate's branch, not only reading the diff.
  • Take a PR the agent wrote end to end, and answer every review question without asking the agent.

Homework ​

The rule holds from today: every PR in your team repo gets a teammate's approval. Post in the Seminars channel on Teams by Sunday midnight:

text
Team repo: <link>
My PR: <link>
PR I reviewed: <link>
Best comment I got: <link to the comment>