PlatformCode Review

Code Review

Threaded inline comments to arbitrary depth. One-click suggested changes. Review checklists. Review analytics.

Code review on Drok is designed for teams that treat review as an engineering discipline, not an administrative checkbox. Every feature exists because it reduces the time between "ready for review" and "merged" without reducing the quality of the review itself.

Merge Requests

Merge requests are Drok's equivalent of pull requests. The terminology is deliberate — a merge request describes what will happen (a merge), not what is being requested (a pull). The semantics are otherwise identical.

Creating a Merge Request

drok mr create \
  --title "Implement token refresh" \
  --description "Adds automatic token refresh with configurable TTL" \
  --source feature/token-refresh \
  --target main \
  --reviewer @alice @bob \
  --label backend security

Or push a branch and create the merge request from the web interface. Drok displays a prompt to create a merge request whenever you push a new branch.

Merge Request States

StateDescription
OpenActive and accepting review
MergedSuccessfully merged into target branch
ClosedClosed without merging
DraftWork in progress — reviewers are not notified

Draft merge requests can be converted to ready-for-review with a single click or:

drok mr ready 42

Inline Comments

Comments are attached to specific lines of specific files at specific commits. They are not attached to line numbers in the abstract — they track the actual content.

Threading

Inline comments support threading to arbitrary depth. A reply to a comment is structurally nested beneath it. A reply to a reply is nested further. There is no artificial depth limit.

Threads can be resolved independently. Resolving a thread collapses it visually but does not delete it — resolved threads remain accessible and searchable.

Suggested Changes

Any inline comment can include a code suggestion:

```suggestion
fn refresh_token(ttl: Duration) -> Result<Token, AuthError> {
    let token = generate_token()?;
    token.set_expiry(Instant::now() + ttl);
    Ok(token)
}
```

The merge request author can apply a suggested change with a single click. Applied suggestions generate a commit attributed to the suggester as co-author.

Multi-Line Comments

Select a range of lines to attach a comment to the entire block. The comment annotation spans the full selection and remains anchored even if surrounding code changes.

Review Workflow

Review States

Reviewers submit their review with one of three states:

StateMeaning
ApproveThe changes are acceptable for merge
Request ChangesThe changes require modification before merge
CommentGeneral feedback without approval or rejection

Review Checklists

Define review checklists per repository to ensure consistent review quality:

# .drok/review-checklist.yml
checklist:
  - title: "Tests"
    items:
      - "New functionality has corresponding test coverage"
      - "Existing tests pass without modification"
      - "Edge cases are covered"
  - title: "Security"
    items:
      - "No secrets or credentials in code"
      - "Input validation is present at boundaries"
      - "SQL queries use parameterized statements"
  - title: "Documentation"
    items:
      - "Public APIs have documentation comments"
      - "Breaking changes are noted in the description"

When a review checklist is configured, reviewers see the checklist items alongside the diff. Each item can be checked off individually, and the merge request displays overall checklist completion.

Required Reviews

Configure the number of required approvals before a merge request can be merged:

drok branch-protection set main \
  --required-approvals 2 \
  --dismiss-stale-approvals \
  --require-review-from-codeowners

Stale approval dismissal means that new pushes to the source branch reset existing approvals, requiring re-review of the updated code.

Diff Views

Unified and Split

Toggle between unified diff (single column, additions and deletions interleaved) and split diff (two columns, old on left, new on right) with a single keypress or click.

Syntax-Aware Diffs

Diffs are syntax-highlighted using Tree-sitter, matching the file browser's highlighting. Additionally, Drok performs intra-line diff highlighting — within a changed line, the specific characters that changed are highlighted distinctly from the rest of the line.

Whitespace Handling

Toggle whitespace visibility in diffs:

  • Show all whitespace changes — Default behavior
  • Ignore whitespace changes — Hides lines where only whitespace changed
  • Ignore amount of whitespace — Shows lines but does not highlight whitespace-only differences

Image Diffs

When image files are modified, Drok displays:

  • Side-by-side — Old and new images displayed adjacently
  • Onion skin — Overlay with adjustable opacity slider
  • Swipe — Draggable divider revealing old/new on either side

Review Analytics

Drok tracks review metrics per repository and per team:

  • Time to first review — Duration from merge request creation to first review comment
  • Time to merge — Duration from creation to merge
  • Review iterations — Number of review rounds before approval
  • Reviewer workload — Distribution of review assignments across team members
  • Checklist compliance — Percentage of checklist items completed per merge request

Analytics are available on the repository dashboard and can be exported via the API for integration with external reporting tools.

Merge Strategies

Drok supports three merge strategies:

StrategyDescription
Merge commitCreates a merge commit preserving the full branch history
Squash and mergeCombines all commits into a single commit on the target branch
Rebase and mergeReplays commits on top of the target branch without a merge commit

The default strategy is configurable per repository. Individual merge requests can override the default if the repository settings permit it.

Notifications

Review participants receive notifications for:

  • New comments on merge requests they authored or are reviewing
  • Review submissions (approve, request changes, comment)
  • Merge request state changes (ready for review, merged, closed)
  • Mentions in comments (@username)

Notifications are delivered via the web interface, email, and webhooks. Notification preferences are configurable per user and per repository.