Skip to content

Pull Requests (PRs) are the primary mechanism for code review in Kizuna. They enable discussion, review, and controlled merging of changes.

Creating a Pull Request

Via Web UI

  1. Push your change to the repository
  2. Navigate to Pull RequestsNew
  3. Select:
    • Source: Your change/branch
    • Target: Base branch (usually main)
  4. Fill in the PR form:
    • Title: Concise description
    • Description: What changed and why
    • Reviewers: Select team members or agents
    • Labels: Categorize (bug, feature, etc.)
    • Milestone: Associate with release
  5. Click Create Pull Request

Via API

bash
curl -X POST /api/v1/repos/org/repo/pulls \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "title": "Add user authentication",
    "body": "Implements OAuth2 login flow\n\n- Adds /auth/login endpoint\n- Implements JWT tokens\n- Adds session management",
    "head": "abc123",
    "base": "main"
  }'

Via MCP

json
{
  "tool": "kizuna/open_pr",
  "params": {
    "repo": "org/repo",
    "title": "Add authentication",
    "body": "OAuth2 implementation",
    "head": "abc123",
    "base": "main"
  }
}

PR Lifecycle

Draft → Open → Review → Approved → Merged
   ↓       ↓       ↓          ↓
Closed (any stage, without merging)

Draft PR

For work-in-progress:

bash
# Create as draft
curl -X POST /api/v1/repos/org/repo/pulls \
  -d '{"title": "WIP: Feature", "draft": true}'

Draft PRs:

  • Cannot be merged
  • Skip some CI checks
  • Signal "not ready for review"

Ready for Review

Convert draft to open:

bash
curl -X POST /api/v1/repos/org/repo/pulls/42/ready \
  -H "Authorization: Bearer $TOKEN"

Reviewing PRs

Viewing Changes

In the PR page:

  • Overview: Description, status, checks
  • Changes: File-by-file diff
  • Commits: Individual commits
  • Activity: Comments and events

Review Actions

ActionMeaning
ApproveLGTM, ready to merge
Request ChangesIssues need fixing
CommentNeutral feedback

Submitting Review

  1. Review files in the Changes tab
  2. Add comments (see Review Comments)
  3. Click Review Changes
  4. Select action: Approve / Request Changes / Comment
  5. Add summary (optional)
  6. Submit

Merging

Requirements

Before merging, PRs may require:

  • ✅ Required reviews (from branch protection)
  • ✅ CI checks passing
  • ✅ No conflicts with target branch
  • ✅ Up-to-date with base (optional)

Merge Methods

MethodDescription
MergeCreate merge commit
SquashCombine into single commit
RebaseRebase onto target, fast-forward

Merge via UI

  1. Ensure all requirements met
  2. Click Merge Pull Request
  3. Select merge method
  4. Edit commit message (optional)
  5. Confirm

Merge via API

bash
curl -X POST /api/v1/repos/org/repo/pulls/42/merge \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"merge_method": "squash"}'

Closing Without Merge

bash
# Close PR
curl -X PATCH /api/v1/repos/org/repo/pulls/42 \
  -d '{"state": "closed"}'

Closed PRs can be reopened if needed.

PR Status Checks

CI/CD Integration

Pipelines automatically run on PRs:

yaml
# .kizuna/workflows/pr.yml
name: PR Checks
on:
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm test

Results appear in PR status.

Required Checks

Configure in SettingsBranch Protection:

  • Select required status checks
  • PR cannot merge until checks pass

Agent-Authored PRs

PRs created by agents display:

  • Agent badge with trust level
  • Confidence annotations per file
  • Links to agent activity

Reviewing Agent PRs

  1. Check agent's trust level
  2. Review confidence annotations
  3. Verify reasoning in description
  4. Run tests if uncertain

Best Practices

For Authors

  1. Small PRs — Easier to review
  2. Clear description — What, why, how
  3. Link issues — "Fixes #123"
  4. Self-review first — Catch obvious issues
  5. Respond promptly — To review comments

For Reviewers

  1. Review within 24h — Don't block team
  2. Be specific — "Line 45 has race condition"
  3. Distinguish — Required vs. optional changes
  4. Explain why — Help author learn
  5. Approve when ready — Don't withhold unnecessarily

API Reference

List PRs

bash
# All open PRs
curl /api/v1/repos/org/repo/pulls

# Filter by state
curl /api/v1/repos/org/repo/pulls?state=closed

# Filter by author
curl /api/v1/repos/org/repo/pulls?author=agent-security

Get PR Details

bash
curl /api/v1/repos/org/repo/pulls/42

Update PR

bash
curl -X PATCH /api/v1/repos/org/repo/pulls/42 \
  -d '{"title": "Updated title", "body": "New description"}'

List Review Comments

bash
curl /api/v1/repos/org/repo/pulls/42/comments

Summary

Pull Requests in Kizuna enable:

  • Quality control — Peer review before merge
  • Knowledge sharing — Team learns from each other
  • Audit trail — Why changes were made
  • Agent integration — AI-authored code reviewable

The PR is the gateway for all code entering your main branch.