Overview
TheSCM (Source Control Management) interface is the richest plugin interface, covering the full PR pipeline: PR detection, state tracking, CI checks, code reviews, and merge operations.
Plugin Slot: scmDefault Plugin:
github
Interface Definition
PR Lifecycle Methods
Detect if a session has an open PR (by branch name).Parameters:
session- Session to checkproject- Project configuration
Get current PR state.Parameters:
pr- PR info
"open", "merged", or "closed"Optional: Get PR summary with stats (state, title, additions, deletions).Parameters:
pr- PR info
Merge a PR.Parameters:
pr- PR infomethod- Merge method:"merge","squash", or"rebase"(default: repo settings)
Close a PR without merging.Parameters:
pr- PR info
CI Tracking Methods
Get individual CI check statuses.Parameters:
pr- PR info
Get overall CI summary.Parameters:
pr- PR info
"pending", "passing", "failing", or "none"Review Tracking Methods
Get all reviews on a PR.Parameters:
pr- PR info
Get the overall review decision.Parameters:
pr- PR info
"approved", "changes_requested", "pending", or "none"Get pending (unresolved) review comments.Parameters:
pr- PR info
Get automated review comments (bots, linters, security scanners).Parameters:
pr- PR info
Merge Readiness Method
Check if PR is ready to merge.Parameters:
pr- PR info
Related Types
PRInfo
PR number
Full URL to PR
PR title
Repository owner
Repository name
Source branch name
Target/base branch name
Whether PR is in draft mode
PRState
CICheck
CIStatus
Review
ReviewDecision
ReviewComment
AutomatedComment
MergeReadiness
Overall merge readiness (all checks must pass)
Whether CI is passing
Whether PR is approved
Whether PR has no merge conflicts
Array of blocker descriptions (e.g.
"CI failing", "Changes requested")MergeMethod
Usage Examples
Implementing an SCM Plugin
Using SCM in Lifecycle Manager
Implementation Notes
Authentication
SCM plugins typically use CLI tools or API tokens:- GitHub:
ghCLI (uses~/.config/gh/hosts.yml) - GitLab:
glabCLI orGITLAB_TOKEN
Rate Limiting
Be mindful of API rate limits:- Cache PR info in session metadata
- Batch requests when possible
- Use GraphQL for complex queries (GitHub)
Review Comment Filtering
Distinguish between:- Human reviews (priority)
- Bot comments (linters, security scanners)
- Resolved vs unresolved comments
Built-in Plugins
- github - GitHub (default, uses
ghCLI)
