Pull Requests
A Pull Request (PR) in GuideMode represents a code change that’s being reviewed before merging. PRs are synced from code hosting providers (GitHub, GitLab, Bitbucket) and are central to measuring code review efficiency and deployment velocity.
Overview
Section titled “Overview”Pull Requests in GuideMode:
- Track PR metadata - titles, descriptions, branches, and timestamps
- Monitor review workflow from creation to merge
- Sync aggregate metrics - lines added/deleted, files changed, commit counts
- Link to issues for delivery tracking
- Connect to deployments for lead time calculations
- Power DORA metrics like cycle time
PR States
Section titled “PR States”Pull requests move through a well-defined lifecycle:
| State | Description | Common Scenarios |
|---|---|---|
draft | Work in progress, not ready for review | Early feedback, CI checks |
open | Ready for review | Standard review flow |
merged | Code merged to target branch | Successful delivery |
closed | PR closed without merging | Rejected, superseded, abandoned |
Key Fields
Section titled “Key Fields”Core Fields
Section titled “Core Fields”| Field | Type | Description |
|---|---|---|
title | string | PR title/summary |
body | string | PR description |
url | string | Web URL to PR |
state | enum | ’open’, ‘closed’, ‘merged’, ‘draft’ |
number | integer | PR number |
isDraft | boolean | Whether PR is a draft |
Branch Information
Section titled “Branch Information”| Field | Description |
|---|---|
headBranch | Source branch (feature branch) |
baseBranch | Target branch (main, develop, etc.) |
headSha | Latest commit SHA on source |
baseSha | Base commit SHA on target |
Merge Information
Section titled “Merge Information”| Field | Description |
|---|---|
merged | Whether PR was merged |
mergeable | Whether PR can be merged (no conflicts) |
mergeCommitSha | SHA of the merge commit |
mergedById | User who merged (GuideMode ID) |
mergedByUsername | Username of merger |
Author Information
Section titled “Author Information”| Field | Description |
|---|---|
authorId | PR creator (GuideMode user) |
authorExternalId | Provider’s author ID |
authorUsername | Author’s username |
Code Change Metrics
Section titled “Code Change Metrics”PRs track detailed metrics about the code changes:
| Metric | Description |
|---|---|
additions | Lines of code added |
deletions | Lines of code removed |
changedFiles | Number of files modified |
commits | Number of commits in PR |
These metrics help identify:
- PR size - Large PRs may need splitting
- Churn - High deletion count may indicate refactoring
- Complexity - Many files may increase review time
Review Workflow
Section titled “Review Workflow”Review Metrics
Section titled “Review Metrics”| Field | Description |
|---|---|
reviewerCount | Number of reviewers assigned/participated |
commentCount | Total comments (general + code) |
reviewCommentCount | Code review comments specifically |
Review States
Section titled “Review States”Individual reviews have their own states:
| Review State | Description |
|---|---|
pending | Review requested but not started |
commented | Reviewer left comments (no approval/rejection) |
approved | Changes approved |
changes_requested | Reviewer requested changes before merge |
dismissed | Review was dismissed |
Key Timestamps
Section titled “Key Timestamps”GuideMode tracks several timestamps throughout the PR lifecycle to calculate metrics:
| Timestamp | Description | Used For |
|---|---|---|
createdAt | When PR was opened | Cycle time start |
firstReviewAt | First review received | Review velocity |
firstApprovalAt | First approval received | Approval time |
mergedAt | When PR was merged | Cycle time end |
closedAt | When PR was closed (if not merged) | Abandonment tracking |
updatedAt | Last modification | Freshness |
Calculated Durations
Section titled “Calculated Durations”| Metric | Calculation | Measures |
|---|---|---|
| Review Time | firstReviewAt - createdAt | How quickly reviewers respond |
| Cycle Time | mergedAt - createdAt | Total time from PR creation to merge |
PR Lifecycle
Section titled “PR Lifecycle”Typical Flow
Section titled “Typical Flow”Draft PR Flow
Section titled “Draft PR Flow”Issue Links
Section titled “Issue Links”PRs can link to issues they address:
Link Types
Section titled “Link Types”| Link Type | Description | Effect on Issue |
|---|---|---|
fixes | PR fixes an issue | Closes issue when merged |
closes | PR closes an issue | Closes issue when merged |
resolves | PR resolves an issue | Closes issue when merged |
references | PR is related | No automatic action |
These links are detected from:
- PR description (“Fixes #123”)
- Commit messages (“Closes #456”)
- GitHub linking UI
See Issue Linking for cross-tool linking.
Deployment Links
Section titled “Deployment Links”PRs are linked to deployments to track delivery:
Links are created by:
- SHA matching - Deployment SHA matches PR merge commit
- Webhooks - Provider sends deployment events
- Manual - Explicitly linked
Metrics Calculations
Section titled “Metrics Calculations”Cycle Time
Section titled “Cycle Time”Time from PR creation to merge:
Cycle Time = mergedAt - createdAtMeasures how long code changes take to review and merge.
Review Time
Section titled “Review Time”Time from creation to first review:
Review Time = firstReviewAt - createdAtMeasures how quickly reviewers respond to PRs.
PR Size
Section titled “PR Size”Aggregate measure of change scope:
Total Changes = additions + deletionsChange Ratio = additions / deletionsLabels
Section titled “Labels”PRs can have labels for categorization:
| Field | Description |
|---|---|
name | Label name |
color | Hex color code |
description | Label description |
Common label uses:
- Priority indicators
- Type of change (feature, bugfix, refactor)
- Team ownership
- Review status
Metadata
Section titled “Metadata”The metadata field stores provider-specific data:
{ "milestone": { "id": 123, "title": "v2.0" }, "requested_reviewers": ["alice", "bob"], "ci_status": "success"}Related Documentation
Section titled “Related Documentation”Core Concepts
Section titled “Core Concepts”- Issues - Linking PRs to issues
- Deployments - PR-to-deployment tracking
- Issue Linking - Cross-tool linking
- Repositories - Repository context
Analytics
Section titled “Analytics”- Delivery Flow - PR cycle time and metrics
- Work Tracking - PR cube details
Integrations
Section titled “Integrations”- GitHub Integration - GitHub PR tracking