teff.tool.builtin.github¶
teff.tool.builtin.github
¶
GitHub tools — list pull requests, fetch diffs, post comments, approve.
A small, purpose-built REST client over the GitHub API so a workflow can
review pull requests without hand-rolling http_request calls: auth
headers, endpoint paths and error surfacing are handled here.
All tools read token (a personal access token) from config and default
to the public https://api.github.com base URL — override it with
url for GitHub Enterprise. A repo is owner/repo. PRs are
addressed by their number (the #N from the web UI).
Classes:
| Name | Description |
|---|---|
GitHubApproveTool |
Approve a pull request by submitting an APPROVE review. |
GitHubGetPRChangesTool |
Fetch a pull request's diff (changed files + per-file patches). |
GitHubListOpenPRsTool |
List open pull requests for an |
GitHubPostCommentTool |
Post a comment on a pull request (as an issue comment). |
GitHubApproveTool
¶
Bases: _GitHubBase
Approve a pull request by submitting an APPROVE review.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo
|
|
required | |
number
|
Pull request number. |
required |
Source code in teff/tool/builtin/github.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
GitHubGetPRChangesTool
¶
Bases: _GitHubBase
Fetch a pull request's diff (changed files + per-file patches).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo
|
|
required | |
number
|
Pull request number (the |
required | |
max_chars
|
Cap on the returned diff text (default 20000). |
required |
Source code in teff/tool/builtin/github.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
GitHubListOpenPRsTool
¶
Bases: _GitHubBase
List open pull requests for an owner/repo.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo
|
|
required | |
limit
|
Maximum number of PRs to return (default 50). |
required | |
state
|
PR state filter (default |
required |
Source code in teff/tool/builtin/github.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
GitHubPostCommentTool
¶
Bases: _GitHubBase
Post a comment on a pull request (as an issue comment).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo
|
|
required | |
number
|
Pull request number. |
required | |
body
|
The comment text to post. |
required |
Source code in teff/tool/builtin/github.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |