Skip to content
1,279 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

API and MCP server in Rust; a public index at the API root1//! REST: each route maps an HTTP request onto one operation.
2
3use serde_json::{Map, Value};
4
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb975use crate::about::AboutOp;
6use crate::deployments::DeploymentsOp;
Actions: keep workflow runs safe7use crate::protection::ProtectionOp;
API and MCP server in Rust; a public index at the API root8use crate::operations::Op;
Merge checks: statuses and check runs on every commit9use crate::checks::ChecksOp;
Merge rulesets: branch and tag rules, agent-first, enforced on push and merge10use crate::rules::RulesOp;
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar11use crate::security::SecurityOp;
API and MCP server in Rust; a public index at the API root12
13pub struct Route {
14 pub method: &'static str,
15 /// Segments starting with `:` are parameters.
16 pub path: &'static str,
17 pub op: Op,
18 /// Query parameters the route reads, as `(name in the URL, input name)`.
19 pub query: &'static [(&'static str, &'static str)],
20}
21
22const fn route(
23 method: &'static str,
24 path: &'static str,
25 op: Op,
26 query: &'static [(&'static str, &'static str)],
27) -> Route {
28 Route {
29 method,
30 path,
31 op,
32 query,
33 }
34}
35
36pub const ROUTES: &[Route] = &[
Agents as a team: lifecycle, merge queue, billing and a new shell37 route("GET", "/user", Op::Whoami, &[]),
38 route("POST", "/workspaces", Op::CreateWorkspace, &[]),
Merge branch 'worktree-agent-ad7c6d88d93adc817'39 route("GET", "/workspaces/:workspace", Op::GetWorkspace, &[]),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look40 route("DELETE", "/workspaces/:workspace", Op::DeleteWorkspace, &[]),
41 route("GET", "/user/emails", Op::ListEmails, &[]),
42 route("POST", "/user/emails", Op::AddEmail, &[]),
43 route("DELETE", "/user/emails/:email", Op::RemoveEmail, &[]),
44 route("PATCH", "/user/email-settings", Op::UpdateEmailSettings, &[]),
45 route("GET", "/user/invites", Op::ListInvites, &[]),
46 route("POST", "/user/invites", Op::CreateInvite, &[]),
47 route("DELETE", "/user/invites/:id", Op::RevokeInvite, &[]),
48 route("GET", "/workspaces/:workspace/invitations", Op::ListWorkspaceInvites, &[]),
49 route("POST", "/workspaces/:workspace/invitations", Op::InviteMember, &[]),
50 route("DELETE", "/workspaces/:workspace/invitations/:id", Op::RevokeWorkspaceInvite, &[]),
51 // Who has access. GitHub's addresses, but for adding someone, which
52 // takes an email address as well as a username.
53 route("GET", "/repos/:owner/:name/collaborators", Op::ListCollaborators, &[]),
54 route("POST", "/repos/:owner/:name/collaborators", Op::AddCollaborator, &[]),
55 route("PATCH", "/repos/:owner/:name/collaborators/:username", Op::UpdateCollaborator, &[]),
56 route("DELETE", "/repos/:owner/:name/collaborators/:username", Op::RemoveCollaborator, &[]),
57 route(
58 "GET",
59 "/repos/:owner/:name/collaborators/:username/permission",
60 Op::GetCollaboratorPermission,
61 &[],
62 ),
63 route("GET", "/repos/:owner/:name/invitations", Op::ListRepoInvitations, &[]),
64 route("DELETE", "/repos/:owner/:name/invitations/:id", Op::RevokeRepoInvitation, &[]),
65 route("GET", "/user/repository_invitations", Op::ListMyRepoInvitations, &[]),
API: notifications over REST and MCP, with notifications scopes66 // Your notifications: threads, marking them, and what you subscribe
67 // to and watch. GitHub's addresses, with g1t's saved and snoozed.
68 route("GET", "/notifications", Op::ListNotifications, &[("all", "all"), ("participating", "participating"), ("view", "view"), ("reason", "reason"), ("severity", "severity"), ("since", "since"), ("before", "before"), ("cursor", "cursor"), ("per_page", "per_page")]),
69 route("PUT", "/notifications", Op::MarkNotificationsRead, &[]),
70 route("GET", "/notifications/threads/:id", Op::GetNotificationThread, &[]),
71 route("PATCH", "/notifications/threads/:id", Op::MarkThreadRead, &[]),
72 route("DELETE", "/notifications/threads/:id", Op::MarkThreadDone, &[]),
73 route("PUT", "/notifications/threads/:id/saved", Op::SaveThread, &[]),
74 route("DELETE", "/notifications/threads/:id/saved", Op::SaveThread, &[]),
75 route("PUT", "/notifications/threads/:id/snooze", Op::SnoozeThread, &[]),
76 route("DELETE", "/notifications/threads/:id/snooze", Op::SnoozeThread, &[]),
77 route("GET", "/notifications/threads/:id/subscription", Op::GetThreadSubscription, &[]),
78 route("PUT", "/notifications/threads/:id/subscription", Op::SetThreadSubscription, &[]),
79 route("DELETE", "/notifications/threads/:id/subscription", Op::DeleteThreadSubscription, &[]),
80 route("GET", "/repos/:owner/:name/notifications", Op::ListNotifications, &[("all", "all"), ("participating", "participating"), ("view", "view"), ("reason", "reason"), ("severity", "severity"), ("since", "since"), ("before", "before"), ("cursor", "cursor"), ("per_page", "per_page")]),
81 route("PUT", "/repos/:owner/:name/notifications", Op::MarkNotificationsRead, &[]),
82 route("GET", "/repos/:owner/:name/subscription", Op::GetRepoSubscription, &[]),
83 route("PUT", "/repos/:owner/:name/subscription", Op::SetRepoSubscription, &[]),
84 route("DELETE", "/repos/:owner/:name/subscription", Op::DeleteRepoSubscription, &[]),
85 route("GET", "/repos/:owner/:name/issues/:number/subscription", Op::GetThreadSubscription, &[]),
86 route("PUT", "/repos/:owner/:name/issues/:number/subscription", Op::SetThreadSubscription, &[]),
87 route("DELETE", "/repos/:owner/:name/issues/:number/subscription", Op::DeleteThreadSubscription, &[]),
88 route("GET", "/user/subscriptions", Op::ListWatchedRepos, &[]),
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb9789 // Stars: yours, and who starred a repository.
90 route("GET", "/user/starred", Op::About(AboutOp::ListStarred), &[]),
91 route("GET", "/user/starred/:owner/:name", Op::About(AboutOp::CheckStarred), &[]),
92 route("PUT", "/user/starred/:owner/:name", Op::About(AboutOp::Star), &[]),
93 route("DELETE", "/user/starred/:owner/:name", Op::About(AboutOp::Unstar), &[]),
94 route("GET", "/repos/:owner/:name/stargazers", Op::About(AboutOp::ListStargazers), &[("page", "page")]),
95 // What the default branch says about a repository, kept by commit.
96 route("GET", "/repos/:owner/:name/languages", Op::About(AboutOp::GetLanguages), &[]),
97 route("GET", "/repos/:owner/:name/contributors", Op::About(AboutOp::ListContributors), &[]),
98 route("GET", "/repos/:owner/:name/license", Op::About(AboutOp::GetLicense), &[]),
99 // Releases: `latest` and `tags/…` before an id.
100 route("GET", "/repos/:owner/:name/releases", Op::About(AboutOp::ListReleases), &[]),
101 route("POST", "/repos/:owner/:name/releases", Op::About(AboutOp::CreateRelease), &[]),
102 route("GET", "/repos/:owner/:name/releases/latest", Op::About(AboutOp::GetLatestRelease), &[]),
103 route("GET", "/repos/:owner/:name/releases/tags/:tag", Op::About(AboutOp::GetReleaseByTag), &[]),
104 route("GET", "/repos/:owner/:name/releases/:id", Op::About(AboutOp::GetRelease), &[]),
105 route("PATCH", "/repos/:owner/:name/releases/:id", Op::About(AboutOp::UpdateRelease), &[]),
106 route("DELETE", "/repos/:owner/:name/releases/:id", Op::About(AboutOp::DeleteRelease), &[]),
API: pinned projects over REST and MCP107 // Your pinned projects in a workspace, in your order.
108 route("GET", "/user/pinned_projects/:workspace", Op::ListPinnedProjects, &[]),
109 route("PUT", "/user/pinned_projects/:workspace", Op::ReorderPinnedProjects, &[]),
110 route("PUT", "/user/pinned_projects/:workspace/:project", Op::PinProject, &[]),
111 route("DELETE", "/user/pinned_projects/:workspace/:project", Op::UnpinProject, &[]),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look112 route("PATCH", "/user/repository_invitations/:id", Op::AcceptRepoInvitation, &[]),
113 route("DELETE", "/user/repository_invitations/:id", Op::DeclineRepoInvitation, &[]),
Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily114 route("PATCH", "/workspaces/:workspace", Op::UpdateWorkspace, &[]),
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97115 // A workspace's projects: what each is, where it runs, its links.
116 route("GET", "/workspaces/:workspace/projects", Op::ListProjects, &[]),
117 route("GET", "/workspaces/:workspace/projects/:project", Op::GetProject, &[]),
118 route("PATCH", "/workspaces/:workspace/projects/:project", Op::UpdateProject, &[]),
Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily119 route("PUT", "/workspaces/:workspace/base_permission", Op::SetBasePermission, &[]),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look120 route(
121 "GET",
122 "/workspaces/:workspace/outside_collaborators",
123 Op::ListOutsideCollaborators,
124 &[],
125 ),
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar126 // Teams: a workspace's groups of members, with roles on repositories.
127 route("GET", "/workspaces/:workspace/teams", Op::ListTeams, &[("q", "query")]),
128 route("POST", "/workspaces/:workspace/teams", Op::CreateTeam, &[]),
129 route("GET", "/workspaces/:workspace/teams/:team", Op::GetTeam, &[]),
130 route("PATCH", "/workspaces/:workspace/teams/:team", Op::UpdateTeam, &[]),
131 route("DELETE", "/workspaces/:workspace/teams/:team", Op::DeleteTeam, &[]),
132 route(
133 "GET",
134 "/workspaces/:workspace/teams/:team/members",
135 Op::ListTeamMembers,
136 &[("include_child_teams", "include_child_teams")],
137 ),
138 route("PUT", "/workspaces/:workspace/teams/:team/members/:username", Op::SetTeamMember, &[]),
139 route("DELETE", "/workspaces/:workspace/teams/:team/members/:username", Op::RemoveTeamMember, &[]),
140 route("GET", "/workspaces/:workspace/teams/:team/teams", Op::ListChildTeams, &[]),
141 route("GET", "/workspaces/:workspace/teams/:team/repos", Op::ListTeamRepos, &[]),
142 route("PUT", "/workspaces/:workspace/teams/:team/repos/:repo", Op::SetTeamRepo, &[]),
143 route("DELETE", "/workspaces/:workspace/teams/:team/repos/:repo", Op::RemoveTeamRepo, &[]),
144 route(
145 "PUT",
146 "/workspaces/:workspace/teams/:team/review_assignment",
147 Op::SetTeamReviewAssignment,
148 &[],
149 ),
150 route("GET", "/workspaces/:workspace/members/:username/teams", Op::ListUserTeams, &[]),
Usage, Billing settings and prepaid AI credit; fixes from the UX audit151 // A workspace's billing: usage, budget, AI credit and invoices.
152 route(
153 "GET",
154 "/workspaces/:workspace/usage",
155 Op::GetUsage,
156 &[("from", "from"), ("until", "until"), ("products", "products"), ("projects", "projects"), ("group_by", "group_by")],
157 ),
158 route("GET", "/workspaces/:workspace/budget", Op::GetBudget, &[]),
159 route("PUT", "/workspaces/:workspace/budget", Op::SetBudget, &[]),
160 route("GET", "/workspaces/:workspace/ai_credit", Op::GetAiCredit, &[]),
161 route("POST", "/workspaces/:workspace/ai_credit/checkout", Op::BuyAiCredit, &[]),
162 route("GET", "/workspaces/:workspace/invoices", Op::ListInvoices, &[]),
163 route("GET", "/workspaces/:workspace/billing_details", Op::GetBillingDetails, &[]),
Merge the AI Gateway: Anthropic's Messages API on a workspace's tokens164 // The AI Gateway's log of a workspace's requests.
165 route("GET", "/workspaces/:workspace/gateway/requests", Op::ListGatewayRequests, &[("limit", "limit"), ("before", "before")]),
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar166 // Code owners: the CODEOWNERS file, checked.
167 route("GET", "/repos/:owner/:name/codeowners/errors", Op::GetCodeownersErrors, &[("ref", "ref")]),
Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily168 // Security alerts: secrets and vulnerable dependencies.
169 route(
170 "GET",
171 "/repos/:owner/:name/security/alerts",
172 Op::ListSecurityAlerts,
173 &[("state", "state"), ("kind", "kind")],
174 ),
175 route("POST", "/repos/:owner/:name/security/alerts/:id/dismiss", Op::DismissSecurityAlert, &[]),
176 route("POST", "/repos/:owner/:name/security/alerts/:id/reopen", Op::ReopenSecurityAlert, &[]),
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar177 // The security suite: secret scanning, code scanning, vulnerability
178 // alerts and the supply chain, at the common addresses.
179 route("GET", "/repos/:owner/:name/secret-scanning/alerts", Op::Security(SecurityOp::ListSecretAlerts), &[("state", "state"), ("secret_type", "secret_type"), ("validity", "validity"), ("bypassed", "bypassed")]),
180 route("GET", "/workspaces/:workspace/secret-scanning/alerts", Op::Security(SecurityOp::ListSecretAlerts), &[("state", "state"), ("secret_type", "secret_type"), ("validity", "validity"), ("bypassed", "bypassed")]),
181 route("GET", "/repos/:owner/:name/secret-scanning/alerts/:id", Op::Security(SecurityOp::GetSecretAlert), &[]),
182 route("PATCH", "/repos/:owner/:name/secret-scanning/alerts/:id", Op::Security(SecurityOp::UpdateSecretAlert), &[]),
183 route("GET", "/repos/:owner/:name/secret-scanning/alerts/:id/locations", Op::Security(SecurityOp::ListSecretLocations), &[]),
184 route("POST", "/repos/:owner/:name/secret-scanning/alerts/:id/bypass", Op::Security(SecurityOp::BypassPushProtection), &[]),
185 route("POST", "/repos/:owner/:name/secret-scanning/alerts/:id/validity", Op::Security(SecurityOp::CheckSecretValidity), &[]),
186 route("GET", "/workspaces/:workspace/secret-scanning/bypass-requests", Op::Security(SecurityOp::ListBypassRequests), &[("state", "state"), ("repo", "repo")]),
187 route("PATCH", "/workspaces/:workspace/secret-scanning/bypass-requests/:id", Op::Security(SecurityOp::ReviewBypassRequest), &[]),
188 route("POST", "/repos/:owner/:name/secret-scanning/custom-patterns/dry-run", Op::Security(SecurityOp::DryRunCustomPattern), &[]),
189 route("POST", "/workspaces/:workspace/secret-scanning/custom-patterns/dry-run", Op::Security(SecurityOp::DryRunCustomPattern), &[]),
190 route("GET", "/repos/:owner/:name/secret-scanning/custom-patterns", Op::Security(SecurityOp::ListCustomPatterns), &[]),
191 route("GET", "/workspaces/:workspace/secret-scanning/custom-patterns", Op::Security(SecurityOp::ListCustomPatterns), &[]),
192 route("POST", "/repos/:owner/:name/secret-scanning/custom-patterns", Op::Security(SecurityOp::CreateCustomPattern), &[]),
193 route("POST", "/workspaces/:workspace/secret-scanning/custom-patterns", Op::Security(SecurityOp::CreateCustomPattern), &[]),
194 route("PATCH", "/repos/:owner/:name/secret-scanning/custom-patterns/:id", Op::Security(SecurityOp::UpdateCustomPattern), &[]),
195 route("PATCH", "/workspaces/:workspace/secret-scanning/custom-patterns/:id", Op::Security(SecurityOp::UpdateCustomPattern), &[]),
196 route("DELETE", "/repos/:owner/:name/secret-scanning/custom-patterns/:id", Op::Security(SecurityOp::DeleteCustomPattern), &[]),
197 route("DELETE", "/workspaces/:workspace/secret-scanning/custom-patterns/:id", Op::Security(SecurityOp::DeleteCustomPattern), &[]),
198 route("GET", "/repos/:owner/:name/code-scanning/alerts", Op::Security(SecurityOp::ListCodeAlerts), &[("state", "state"), ("severity", "severity"), ("tool", "tool"), ("rule_id", "rule_id")]),
199 route("GET", "/workspaces/:workspace/code-scanning/alerts", Op::Security(SecurityOp::ListCodeAlerts), &[("state", "state"), ("severity", "severity"), ("tool", "tool"), ("rule_id", "rule_id")]),
200 route("GET", "/repos/:owner/:name/code-scanning/alerts/:number", Op::Security(SecurityOp::GetCodeAlert), &[]),
201 route("PATCH", "/repos/:owner/:name/code-scanning/alerts/:number", Op::Security(SecurityOp::UpdateCodeAlert), &[]),
202 route("GET", "/repos/:owner/:name/code-scanning/analyses", Op::Security(SecurityOp::ListAnalyses), &[]),
203 route("POST", "/repos/:owner/:name/code-scanning/sarifs", Op::Security(SecurityOp::UploadSarif), &[]),
204 route("GET", "/repos/:owner/:name/code-scanning/sarifs/:id", Op::Security(SecurityOp::GetSarifUpload), &[]),
205 route("GET", "/repos/:owner/:name/vulnerability-alerts", Op::Security(SecurityOp::ListVulnerabilityAlerts), &[("state", "state"), ("severity", "severity"), ("ecosystem", "ecosystem"), ("package", "package")]),
206 route("GET", "/workspaces/:workspace/vulnerability-alerts", Op::Security(SecurityOp::ListVulnerabilityAlerts), &[("state", "state"), ("severity", "severity"), ("ecosystem", "ecosystem"), ("package", "package")]),
207 route("GET", "/repos/:owner/:name/vulnerability-alerts/:id", Op::Security(SecurityOp::GetVulnerabilityAlert), &[]),
208 route("PATCH", "/repos/:owner/:name/vulnerability-alerts/:id", Op::Security(SecurityOp::UpdateVulnerabilityAlert), &[]),
209 route("POST", "/repos/:owner/:name/security/alerts/:id/fix", Op::Security(SecurityOp::FixAlert), &[]),
210 route("GET", "/repos/:owner/:name/dependency-graph", Op::Security(SecurityOp::GetDependencyGraph), &[]),
211 route("GET", "/repos/:owner/:name/dependency-graph/sbom", Op::Security(SecurityOp::GetSbom), &[]),
212 route("GET", "/repos/:owner/:name/dependency-graph/compare/:basehead", Op::Security(SecurityOp::CompareDependencies), &[]),
213 route("GET", "/repos/:owner/:name/security/settings", Op::Security(SecurityOp::GetSettings), &[]),
214 route("PATCH", "/repos/:owner/:name/security/settings", Op::Security(SecurityOp::UpdateSettings), &[]),
215 route("GET", "/workspaces/:workspace/security/settings", Op::Security(SecurityOp::GetWorkspaceSettings), &[]),
216 route("PATCH", "/workspaces/:workspace/security/settings", Op::Security(SecurityOp::UpdateWorkspaceSettings), &[]),
217 route("GET", "/workspaces/:workspace/security/overview", Op::Security(SecurityOp::GetOverview), &[("days", "days")]),
Agents as a team: lifecycle, merge queue, billing and a new shell218 route("GET", "/repos", Op::ListRepos, &[("q", "query")]),
Search across all of g1t, Explore, and a command palette219 route(
220 "GET",
221 "/search",
222 Op::Search,
223 &[("q", "query"), ("type", "type"), ("page", "page"), ("per_page", "per_page")],
224 ),
Agents as a team: lifecycle, merge queue, billing and a new shell225 route("POST", "/repos", Op::CreateRepo, &[]),
226 route("GET", "/repos/:owner/:name", Op::GetRepo, &[]),
227 route("PATCH", "/repos/:owner/:name", Op::UpdateRepo, &[]),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look228 route("POST", "/repos/:owner/:name/transfer", Op::TransferRepo, &[]),
229 route("DELETE", "/repos/:owner/:name", Op::DeleteRepo, &[]),
230 route(
231 "GET",
232 "/workspaces/:workspace/repos/deleted",
233 Op::ListDeletedRepos,
234 &[],
235 ),
236 route("POST", "/repos/:owner/:name/restore", Op::RestoreRepo, &[]),
237 route("POST", "/repos/:owner/:name/purge", Op::PurgeRepo, &[]),
238 route("POST", "/repos/:owner/:name/rename", Op::RenameRepo, &[]),
239 route("POST", "/repos/:owner/:name/archive", Op::ArchiveRepo, &[]),
240 route("POST", "/repos/:owner/:name/unarchive", Op::UnarchiveRepo, &[]),
241 route(
242 "POST",
243 "/repos/:owner/:name/visibility",
244 Op::SetRepoVisibility,
245 &[],
246 ),
247 route(
248 "POST",
249 "/repos/:owner/:name/branches/:branch/rename",
250 Op::RenameBranch,
251 &[],
252 ),
Agents as a team: lifecycle, merge queue, billing and a new shell253 route(
254 "GET",
255 "/repos/:owner/:name/settings",
256 Op::GetRepoSettings,
257 &[],
258 ),
259 route(
260 "PATCH",
261 "/repos/:owner/:name/settings",
262 Op::UpdateRepoSettings,
263 &[],
264 ),
Fast pages, required checks on the branch, self-hosted runners, honest incidents265 route("GET", "/repos/:owner/:name/check-names", Op::ListCheckNames, &[]),
Merge checks: statuses and check runs on every commit266 // Checks: GitHub's addresses for statuses, check runs and check suites.
267 route("POST", "/repos/:owner/:name/statuses/:sha", Op::Checks(ChecksOp::CreateCommitStatus), &[]),
268 route("GET", "/repos/:owner/:name/commits/:ref/statuses", Op::Checks(ChecksOp::ListCommitStatuses), &[]),
269 route("GET", "/repos/:owner/:name/commits/:ref/status", Op::Checks(ChecksOp::GetCombinedStatus), &[]),
270 route(
271 "GET",
272 "/repos/:owner/:name/commits/:ref/check-runs",
273 Op::Checks(ChecksOp::ListCheckRunsForRef),
274 &[("check_name", "check_name"), ("status", "status"), ("app", "app"), ("filter", "filter")],
275 ),
276 route(
277 "GET",
278 "/repos/:owner/:name/commits/:ref/check-suites",
279 Op::Checks(ChecksOp::ListCheckSuitesForRef),
280 &[("app", "app"), ("check_name", "check_name")],
281 ),
282 route("POST", "/repos/:owner/:name/check-runs", Op::Checks(ChecksOp::CreateCheckRun), &[]),
283 route("GET", "/repos/:owner/:name/check-runs/:id", Op::Checks(ChecksOp::GetCheckRun), &[]),
284 route("PATCH", "/repos/:owner/:name/check-runs/:id", Op::Checks(ChecksOp::UpdateCheckRun), &[]),
285 route("GET", "/repos/:owner/:name/check-runs/:id/annotations", Op::Checks(ChecksOp::ListCheckRunAnnotations), &[]),
286 route("POST", "/repos/:owner/:name/check-runs/:id/rerequest", Op::Checks(ChecksOp::RerequestCheckRun), &[]),
287 route("GET", "/repos/:owner/:name/check-suites/:id", Op::Checks(ChecksOp::GetCheckSuite), &[]),
288 route("POST", "/repos/:owner/:name/check-suites/:id/rerequest", Op::Checks(ChecksOp::RerequestCheckSuite), &[]),
Merge rulesets: branch and tag rules, agent-first, enforced on push and merge289 // Rulesets: a repository's, a workspace's, the rules of one branch,
290 // and how they judged pushes and merges.
291 route("GET", "/repos/:owner/:name/rulesets", Op::Rules(RulesOp::ListRepoRulesets), &[("include_parents", "include_parents")]),
292 route("POST", "/repos/:owner/:name/rulesets", Op::Rules(RulesOp::CreateRepoRuleset), &[]),
293 route("GET", "/repos/:owner/:name/rulesets/:id", Op::Rules(RulesOp::GetRepoRuleset), &[]),
294 route("PUT", "/repos/:owner/:name/rulesets/:id", Op::Rules(RulesOp::UpdateRepoRuleset), &[]),
295 route("DELETE", "/repos/:owner/:name/rulesets/:id", Op::Rules(RulesOp::DeleteRepoRuleset), &[]),
296 route("GET", "/repos/:owner/:name/rules/branches/:branch", Op::Rules(RulesOp::GetBranchRules), &[("target", "target")]),
297 route(
298 "GET",
299 "/repos/:owner/:name/rules/evaluations",
300 Op::Rules(RulesOp::ListRuleEvaluations),
301 &[("ruleset_id", "ruleset_id"), ("verdict", "verdict"), ("problems_only", "problems_only"), ("before", "before"), ("limit", "limit")],
302 ),
303 route("GET", "/workspaces/:workspace/rulesets", Op::Rules(RulesOp::ListWorkspaceRulesets), &[]),
304 route("POST", "/workspaces/:workspace/rulesets", Op::Rules(RulesOp::CreateWorkspaceRuleset), &[]),
305 route("GET", "/workspaces/:workspace/rulesets/:id", Op::Rules(RulesOp::GetWorkspaceRuleset), &[]),
306 route("PUT", "/workspaces/:workspace/rulesets/:id", Op::Rules(RulesOp::UpdateWorkspaceRuleset), &[]),
307 route("DELETE", "/workspaces/:workspace/rulesets/:id", Op::Rules(RulesOp::DeleteWorkspaceRuleset), &[]),
308 route(
309 "GET",
310 "/workspaces/:workspace/rules/evaluations",
311 Op::Rules(RulesOp::ListWorkspaceRuleEvaluations),
312 &[("ruleset_id", "ruleset_id"), ("verdict", "verdict"), ("problems_only", "problems_only"), ("before", "before"), ("limit", "limit")],
313 ),
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97314 // Deployments wherever they run, their statuses, and environments.
315 route(
316 "GET",
317 "/repos/:owner/:name/deployments",
318 Op::Deployments(DeploymentsOp::ListDeployments),
319 &[("environment", "environment"), ("ref", "ref"), ("sha", "sha"), ("task", "task"), ("state", "state"), ("source", "source"), ("creator", "creator"), ("page", "page"), ("per_page", "per_page")],
320 ),
321 route("POST", "/repos/:owner/:name/deployments", Op::Deployments(DeploymentsOp::CreateDeployment), &[]),
322 route("GET", "/repos/:owner/:name/deployments/:id", Op::Deployments(DeploymentsOp::GetDeployment), &[]),
323 route("GET", "/repos/:owner/:name/deployments/:id/statuses", Op::Deployments(DeploymentsOp::ListDeploymentStatuses), &[]),
324 route("POST", "/repos/:owner/:name/deployments/:id/statuses", Op::Deployments(DeploymentsOp::CreateDeploymentStatus), &[]),
325 route("GET", "/repos/:owner/:name/environments", Op::Deployments(DeploymentsOp::ListEnvironments), &[]),
326 route("GET", "/repos/:owner/:name/environments/:environment", Op::Deployments(DeploymentsOp::GetEnvironment), &[]),
Actions: keep workflow runs safe327 // Environments' protection rules, and the runs they hold.
328 route("PUT", "/repos/:owner/:name/environments/:environment", Op::Protection(ProtectionOp::UpdateEnvironment), &[]),
329 route("DELETE", "/repos/:owner/:name/environments/:environment", Op::Protection(ProtectionOp::DeleteEnvironment), &[]),
330 route(
331 "GET",
332 "/repos/:owner/:name/actions/runs/:id/pending_deployments",
333 Op::Protection(ProtectionOp::GetPendingDeployments),
334 &[],
335 ),
336 route(
337 "POST",
338 "/repos/:owner/:name/actions/runs/:id/pending_deployments",
339 Op::Protection(ProtectionOp::ReviewPendingDeployments),
340 &[],
341 ),
342 route("POST", "/repos/:owner/:name/actions/runs/:id/approve", Op::Protection(ProtectionOp::ApproveWorkflowRun), &[]),
343 route("GET", "/repos/:owner/:name/actions/permissions/workflow", Op::Protection(ProtectionOp::GetWorkflowPermissions), &[]),
344 route("PUT", "/repos/:owner/:name/actions/permissions/workflow", Op::Protection(ProtectionOp::SetWorkflowPermissions), &[]),
345 route(
346 "GET",
347 "/repos/:owner/:name/actions/permissions/fork-pr-contributor-approval",
348 Op::Protection(ProtectionOp::GetForkPrApproval),
349 &[],
350 ),
351 route(
352 "PUT",
353 "/repos/:owner/:name/actions/permissions/fork-pr-contributor-approval",
354 Op::Protection(ProtectionOp::SetForkPrApproval),
355 &[],
356 ),
357 route("POST", "/repos/:owner/:name/dispatches", Op::Protection(ProtectionOp::CreateRepositoryDispatch), &[]),
Agents as a team: lifecycle, merge queue, billing and a new shell358 route("GET", "/repos/:owner/:name/queue", Op::GetMergeQueue, &[]),
API and MCP server in Rust; a public index at the API root359 route(
Usage, like a hosting provider's: what agents cost, per day, task, repository and pull request360 "POST",
361 "/repos/:owner/:name/pulls/:number/messages",
362 Op::MessageAgent,
363 &[],
364 ),
365 route(
366 "POST",
367 "/repos/:owner/:name/pulls/:number/messages/take",
368 Op::TakeMessages,
369 &[],
370 ),
371 route(
Docs worth reading, and kept that way372 "POST",
373 "/repos/:owner/:name/messages/:id/answer",
374 Op::AnswerMessage,
375 &[],
376 ),
Agents and memory, checks and conflicts, profiles, slug renames, custom domains377 route("POST", "/repos/:owner/:name/memory", Op::Remember, &[]),
378 route(
379 "GET",
380 "/repos/:owner/:name/memory",
381 Op::Recall,
382 &[("q", "query"), ("limit", "limit")],
383 ),
Docs worth reading, and kept that way384 route(
API and MCP server in Rust; a public index at the API root385 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell386 "/repos/:owner/:name/events",
API and MCP server in Rust; a public index at the API root387 Op::ListEvents,
388 &[("before", "before")],
389 ),
Agents as a team: lifecycle, merge queue, billing and a new shell390 route("GET", "/repos/:owner/:name/labels", Op::ListLabels, &[]),
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar391 route("POST", "/repos/:owner/:name/labels", Op::CreateLabel, &[]),
392 route("POST", "/repos/:owner/:name/labels/defaults", Op::AddDefaultLabels, &[]),
393 route("PATCH", "/repos/:owner/:name/labels/:label", Op::UpdateLabel, &[]),
394 route("DELETE", "/repos/:owner/:name/labels/:label", Op::DeleteLabel, &[]),
395 route("GET", "/repos/:owner/:name/issues/:number/labels", Op::ListIssueLabels, &[]),
396 route("POST", "/repos/:owner/:name/issues/:number/labels", Op::AddIssueLabels, &[]),
397 route("PUT", "/repos/:owner/:name/issues/:number/labels", Op::SetIssueLabels, &[]),
398 route("DELETE", "/repos/:owner/:name/issues/:number/labels", Op::RemoveIssueLabels, &[]),
399 route("DELETE", "/repos/:owner/:name/issues/:number/labels/:label", Op::RemoveIssueLabels, &[]),
400 route("GET", "/repos/:owner/:name/milestones", Op::ListMilestones, &[("state", "state")]),
401 route("POST", "/repos/:owner/:name/milestones", Op::CreateMilestone, &[]),
402 route("GET", "/repos/:owner/:name/milestones/:milestone", Op::GetMilestone, &[]),
403 route("PATCH", "/repos/:owner/:name/milestones/:milestone", Op::UpdateMilestone, &[]),
404 route("DELETE", "/repos/:owner/:name/milestones/:milestone", Op::DeleteMilestone, &[]),
API and MCP server in Rust; a public index at the API root405 route(
406 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell407 "/repos/:owner/:name/issues",
API and MCP server in Rust; a public index at the API root408 Op::ListIssues,
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar409 &[("state", "state"), ("label", "label"), ("milestone", "milestone")],
API and MCP server in Rust; a public index at the API root410 ),
Agents as a team: lifecycle, merge queue, billing and a new shell411 route("POST", "/repos/:owner/:name/issues", Op::CreateIssue, &[]),
API and MCP server in Rust; a public index at the API root412 route(
413 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell414 "/repos/:owner/:name/issues/:number",
API and MCP server in Rust; a public index at the API root415 Op::GetIssue,
416 &[],
417 ),
418 route(
419 "PATCH",
Agents as a team: lifecycle, merge queue, billing and a new shell420 "/repos/:owner/:name/issues/:number",
API and MCP server in Rust; a public index at the API root421 Op::UpdateIssue,
422 &[],
423 ),
424 route(
425 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell426 "/repos/:owner/:name/issues/:number/close",
API and MCP server in Rust; a public index at the API root427 Op::CloseIssue,
428 &[],
429 ),
430 route(
431 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell432 "/repos/:owner/:name/issues/:number/reopen",
API and MCP server in Rust; a public index at the API root433 Op::ReopenIssue,
434 &[],
435 ),
436 route(
437 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell438 "/repos/:owner/:name/issues/:number/assign",
439 Op::AssignIssue,
440 &[],
441 ),
Integrations: your own model provider, alerts that open issues, tickets agents read442 route(
443 "POST",
444 "/repos/:owner/:name/issues/import",
445 Op::ImportIssue,
446 &[],
447 ),
448 route(
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step449 "POST",
450 "/repos/:owner/:name/issues/delegate",
451 Op::Delegate,
452 &[],
453 ),
454 route(
Integrations: your own model provider, alerts that open issues, tickets agents read455 "GET",
456 "/repos/:owner/:name/context",
457 Op::GetContext,
458 &[("reference", "reference")],
459 ),
460 route(
461 "GET",
Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API462 "/workspaces/:workspace/context/search",
463 Op::SearchContext,
464 &[("q", "query"), ("project", "project"), ("kinds", "kinds"), ("limit", "limit")],
465 ),
466 route(
467 "GET",
468 "/workspaces/:workspace/context/:kind/:id",
469 Op::GetEntity,
470 &[],
471 ),
472 route(
473 "GET",
Integrations: your own model provider, alerts that open issues, tickets agents read474 "/workspaces/:workspace/integrations",
475 Op::ListIntegrations,
476 &[],
477 ),
478 route(
479 "POST",
480 "/workspaces/:workspace/integrations",
481 Op::ConnectIntegration,
482 &[],
483 ),
484 route(
Models per workspace: several providers, routed by kind of work485 "GET",
Webhooks: every event, to your own addresses, signed and retried486 "/repos/:owner/:name/hooks",
487 Op::ListWebhooks,
488 &[],
489 ),
490 route(
491 "POST",
492 "/repos/:owner/:name/hooks",
493 Op::CreateWebhook,
494 &[],
495 ),
496 route(
497 "PATCH",
498 "/repos/:owner/:name/hooks/:id",
499 Op::UpdateWebhook,
500 &[],
501 ),
502 route(
503 "DELETE",
504 "/repos/:owner/:name/hooks/:id",
505 Op::DeleteWebhook,
506 &[],
507 ),
508 route(
509 "POST",
510 "/repos/:owner/:name/hooks/:id/pings",
511 Op::PingWebhook,
512 &[],
513 ),
514 route(
515 "GET",
516 "/repos/:owner/:name/hooks/:id/deliveries",
517 Op::ListWebhookDeliveries,
518 &[],
519 ),
520 route(
521 "POST",
522 "/repos/:owner/:name/hooks/:id/deliveries/:delivery/redeliver",
523 Op::RedeliverWebhook,
524 &[],
525 ),
526 route(
527 "GET",
528 "/workspaces/:workspace/hooks",
529 Op::ListWebhooks,
530 &[],
531 ),
532 route(
533 "POST",
534 "/workspaces/:workspace/hooks",
535 Op::CreateWebhook,
536 &[],
537 ),
538 route(
539 "PATCH",
540 "/workspaces/:workspace/hooks/:id",
541 Op::UpdateWebhook,
542 &[],
543 ),
544 route(
545 "DELETE",
546 "/workspaces/:workspace/hooks/:id",
547 Op::DeleteWebhook,
548 &[],
549 ),
550 route(
551 "POST",
552 "/workspaces/:workspace/hooks/:id/pings",
553 Op::PingWebhook,
554 &[],
555 ),
556 route(
557 "GET",
558 "/workspaces/:workspace/hooks/:id/deliveries",
559 Op::ListWebhookDeliveries,
560 &[],
561 ),
562 route(
563 "POST",
564 "/workspaces/:workspace/hooks/:id/deliveries/:delivery/redeliver",
565 Op::RedeliverWebhook,
566 &[],
567 ),
568 route(
569 "GET",
Models per workspace: several providers, routed by kind of work570 "/workspaces/:workspace/model-routes",
571 Op::GetModelRoutes,
572 &[],
573 ),
574 route(
575 "PUT",
576 "/workspaces/:workspace/model-routes",
577 Op::SetModelRoutes,
578 &[],
579 ),
580 route(
AI Gateway: OpenAI's format, open models, and your own providers581 "PATCH",
582 "/workspaces/:workspace/integrations/:id",
583 Op::UpdateIntegration,
584 &[],
585 ),
586 route(
Integrations: your own model provider, alerts that open issues, tickets agents read587 "DELETE",
588 "/workspaces/:workspace/integrations/:id",
589 Op::DisconnectIntegration,
590 &[],
591 ),
592 route(
593 "POST",
594 "/workspaces/:workspace/integrations/:id/test",
595 Op::TestIntegration,
596 &[],
597 ),
Automations: rules in .g1t/automations that act when something happens598 route(
599 "GET",
GitHub Actions on g1t, part two: running workflows600 "/repos/:owner/:name/actions/workflows",
601 Op::ListWorkflows,
602 &[],
603 ),
604 route(
605 "GET",
606 "/repos/:owner/:name/actions/workflows/:workflow/runs",
607 Op::ListWorkflowRuns,
608 &[("branch", "branch"), ("event", "event"), ("per_page", "limit")],
609 ),
610 route(
611 "POST",
612 "/repos/:owner/:name/actions/workflows/:workflow/dispatches",
613 Op::DispatchWorkflow,
614 &[],
615 ),
616 route(
617 "PATCH",
618 "/repos/:owner/:name/actions/workflows/:workflow",
619 Op::UpdateWorkflow,
620 &[],
621 ),
622 route(
623 "PUT",
624 "/repos/:owner/:name/actions/workflows/:workflow/enable",
625 Op::UpdateWorkflow,
626 &[],
627 ),
628 route(
629 "PUT",
630 "/repos/:owner/:name/actions/workflows/:workflow/disable",
631 Op::UpdateWorkflow,
632 &[],
633 ),
634 route(
635 "GET",
636 "/repos/:owner/:name/actions/runs",
637 Op::ListWorkflowRuns,
638 &[("workflow", "workflow"), ("branch", "branch"), ("event", "event"), ("pull", "pull"), ("head_sha", "sha"), ("per_page", "limit")],
639 ),
640 route(
641 "GET",
642 "/repos/:owner/:name/actions/runs/:id",
643 Op::GetWorkflowRun,
644 &[],
645 ),
646 route(
647 "POST",
648 "/repos/:owner/:name/actions/runs/:id/cancel",
649 Op::CancelWorkflowRun,
650 &[],
651 ),
652 route(
653 "POST",
654 "/repos/:owner/:name/actions/runs/:id/rerun",
655 Op::RerunWorkflowRun,
656 &[],
657 ),
658 route(
659 "POST",
660 "/repos/:owner/:name/actions/runs/:id/rerun-failed-jobs",
661 Op::RerunWorkflowRun,
662 &[],
663 ),
664 route(
665 "GET",
666 "/repos/:owner/:name/actions/jobs/:job/logs",
667 Op::GetJobLogs,
668 &[("after", "after")],
669 ),
670 route(
671 "GET",
672 "/repos/:owner/:name/actions/secrets",
673 Op::ListActionsSecrets,
674 &[],
675 ),
676 route(
677 "PUT",
678 "/repos/:owner/:name/actions/secrets/:setting",
679 Op::SetActionsSecret,
680 &[],
681 ),
682 route(
683 "DELETE",
684 "/repos/:owner/:name/actions/secrets/:setting",
685 Op::DeleteActionsSecret,
686 &[],
687 ),
688 route(
689 "GET",
690 "/repos/:owner/:name/actions/variables",
691 Op::ListActionsVariables,
692 &[],
693 ),
694 route(
695 "POST",
696 "/repos/:owner/:name/actions/variables",
697 Op::SetActionsVariable,
698 &[],
699 ),
700 route(
701 "PATCH",
702 "/repos/:owner/:name/actions/variables/:setting",
703 Op::SetActionsVariable,
704 &[],
705 ),
706 route(
707 "DELETE",
708 "/repos/:owner/:name/actions/variables/:setting",
709 Op::DeleteActionsVariable,
710 &[],
711 ),
712 route(
713 "GET",
714 "/workspaces/:workspace/actions/secrets",
715 Op::ListActionsSecrets,
716 &[],
717 ),
718 route(
719 "PUT",
720 "/workspaces/:workspace/actions/secrets/:setting",
721 Op::SetActionsSecret,
722 &[],
723 ),
724 route(
725 "DELETE",
726 "/workspaces/:workspace/actions/secrets/:setting",
727 Op::DeleteActionsSecret,
728 &[],
729 ),
730 route(
731 "GET",
732 "/workspaces/:workspace/actions/variables",
733 Op::ListActionsVariables,
734 &[],
735 ),
736 route(
737 "POST",
738 "/workspaces/:workspace/actions/variables",
739 Op::SetActionsVariable,
740 &[],
741 ),
742 route(
743 "PATCH",
744 "/workspaces/:workspace/actions/variables/:setting",
745 Op::SetActionsVariable,
746 &[],
747 ),
748 route(
749 "DELETE",
750 "/workspaces/:workspace/actions/variables/:setting",
751 Op::DeleteActionsVariable,
752 &[],
753 ),
Fast pages, required checks on the branch, self-hosted runners, honest incidents754 // Self-hosted runners: a repository's own, or a workspace's.
755 route("GET", "/repos/:owner/:name/actions/runners", Op::ListRunners, &[]),
756 route("POST", "/repos/:owner/:name/actions/runners/registration-token", Op::CreateRunnerRegistrationToken, &[]),
757 route("DELETE", "/repos/:owner/:name/actions/runners/:id", Op::RemoveRunner, &[]),
758 route("GET", "/repos/:owner/:name/actions/runner-settings", Op::GetRunnerSettings, &[]),
759 route("PATCH", "/repos/:owner/:name/actions/runner-settings", Op::UpdateRunnerSettings, &[]),
760 route("GET", "/workspaces/:workspace/actions/runners", Op::ListRunners, &[]),
761 route("POST", "/workspaces/:workspace/actions/runners/registration-token", Op::CreateRunnerRegistrationToken, &[]),
762 route("DELETE", "/workspaces/:workspace/actions/runners/:id", Op::RemoveRunner, &[]),
763 route("GET", "/workspaces/:workspace/actions/runner-settings", Op::GetRunnerSettings, &[]),
764 route("PATCH", "/workspaces/:workspace/actions/runner-settings", Op::UpdateRunnerSettings, &[]),
765 route("GET", "/workspaces/:workspace/actions/runner-groups", Op::ListRunnerGroups, &[]),
766 route("POST", "/workspaces/:workspace/actions/runner-groups", Op::CreateRunnerGroup, &[]),
767 route("PATCH", "/workspaces/:workspace/actions/runner-groups/:id", Op::UpdateRunnerGroup, &[]),
768 route("DELETE", "/workspaces/:workspace/actions/runner-groups/:id", Op::DeleteRunnerGroup, &[]),
Agents as a team: lifecycle, merge queue, billing and a new shell769 route("POST", "/repos/:owner/:name/plans", Op::PlanWork, &[]),
770 route("GET", "/repos/:owner/:name/plans/:plan", Op::GetPlan, &[]),
771 route(
772 "POST",
773 "/repos/:owner/:name/plans/:plan/apply",
774 Op::ApplyPlan,
775 &[],
776 ),
777 route(
778 "POST",
779 "/repos/:owner/:name/issues/:number/comments",
API and MCP server in Rust; a public index at the API root780 Op::AddComment,
781 &[],
782 ),
783 route(
784 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell785 "/repos/:owner/:name/pulls",
API and MCP server in Rust; a public index at the API root786 Op::ListPullRequests,
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar787 &[("state", "state"), ("label", "label"), ("milestone", "milestone"), ("base", "base")],
API and MCP server in Rust; a public index at the API root788 ),
789 route(
790 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell791 "/repos/:owner/:name/pulls",
API and MCP server in Rust; a public index at the API root792 Op::CreatePullRequest,
793 &[],
794 ),
795 route(
796 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell797 "/repos/:owner/:name/pulls/:number",
API and MCP server in Rust; a public index at the API root798 Op::GetPullRequest,
799 &[],
800 ),
801 route(
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar802 "PATCH",
803 "/repos/:owner/:name/pulls/:number",
804 Op::UpdatePullRequest,
805 &[],
806 ),
807 route(
API and MCP server in Rust; a public index at the API root808 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell809 "/repos/:owner/:name/pulls/:number/changes",
API and MCP server in Rust; a public index at the API root810 Op::GetPullRequestChanges,
811 &[],
812 ),
813 route(
Acceptance checks in sandboxes, line comments and review verdicts814 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell815 "/repos/:owner/:name/pulls/:number/reviews",
Acceptance checks in sandboxes, line comments and review verdicts816 Op::ReviewPullRequest,
817 &[],
818 ),
819 route(
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar820 "POST",
821 "/repos/:owner/:name/pulls/:number/requested_reviewers",
822 Op::RequestReviewers,
823 &[],
824 ),
825 route(
826 "DELETE",
827 "/repos/:owner/:name/pulls/:number/requested_reviewers",
828 Op::RemoveRequestedReviewers,
829 &[],
830 ),
831 route(
API and MCP server in Rust; a public index at the API root832 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell833 "/repos/:owner/:name/pulls/:number/session",
API and MCP server in Rust; a public index at the API root834 Op::ReadSession,
835 &[("after", "after")],
836 ),
837 route(
838 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell839 "/repos/:owner/:name/pulls/:number/session",
API and MCP server in Rust; a public index at the API root840 Op::RecordSession,
841 &[],
842 ),
843 route(
844 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell845 "/repos/:owner/:name/pulls/:number/ready",
API and MCP server in Rust; a public index at the API root846 Op::MarkPullRequestReady,
847 &[],
848 ),
849 route(
850 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell851 "/repos/:owner/:name/pulls/:number/close",
API and MCP server in Rust; a public index at the API root852 Op::ClosePullRequest,
853 &[],
854 ),
855 route(
856 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell857 "/repos/:owner/:name/pulls/:number/merge",
API and MCP server in Rust; a public index at the API root858 Op::MergePullRequest,
859 &[],
860 ),
861];
862
863impl Route {
864 /// The names of the route's path parameters, in order.
865 pub fn params(&self) -> impl Iterator<Item = &'static str> {
866 self.path
867 .split('/')
868 .filter_map(|segment| segment.strip_prefix(':'))
869 }
870
871 /// The values of the path parameters, if `path` is this route's.
872 fn matches<'a>(&self, path: &'a str) -> Option<Vec<(&'static str, &'a str)>> {
873 let mut values = Vec::new();
874 let mut actual = path.trim_end_matches('/').split('/');
875 for expected in self.path.split('/') {
876 let segment = actual.next()?;
877 match expected.strip_prefix(':') {
878 Some(name) if !segment.is_empty() => values.push((name, segment)),
879 Some(_) => return None,
880 None if expected == segment => {}
881 None => return None,
882 }
883 }
884 actual.next().is_none().then_some(values)
885 }
886}
887
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look888/// A path segment with its `%XX` escapes decoded; as given when that is not
889/// UTF-8.
890fn percent_decoded(segment: &str) -> String {
891 let bytes = segment.as_bytes();
892 let mut out = Vec::with_capacity(bytes.len());
893 let mut i = 0;
894 while i < bytes.len() {
895 let escaped = (bytes[i] == b'%')
896 .then(|| segment.get(i + 1..i + 3))
897 .flatten()
898 .filter(|hex| hex.bytes().all(|byte| byte.is_ascii_hexdigit()))
899 .and_then(|hex| u8::from_str_radix(hex, 16).ok());
900 match escaped {
901 Some(byte) => {
902 out.push(byte);
903 i += 3;
904 }
905 None => {
906 out.push(bytes[i]);
907 i += 1;
908 }
909 }
910 }
911 String::from_utf8(out).unwrap_or_else(|_| segment.to_owned())
912}
913
API and MCP server in Rust; a public index at the API root914/// The route for a request, and the operation input it describes.
915///
916/// The input is the JSON body, overlaid with the query parameters the route
917/// reads and then with what the path names: `owner` and `name` become
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar918/// `repo`, as does a team's `repo` with its `workspace`, and `number`
919/// becomes an integer.
API and MCP server in Rust; a public index at the API root920pub fn resolve(
921 method: &str,
922 path: &str,
923 query: &[(String, String)],
924 body: Value,
925) -> Option<(&'static Route, Value)> {
926 let (route, params) = ROUTES
927 .iter()
928 .filter(|route| route.method == method)
929 .find_map(|route| Some((route, route.matches(path)?)))?;
930
931 let mut input = match body {
932 Value::Object(fields) => fields,
933 _ => Map::new(),
934 };
935 for (name, key) in route.query {
936 if let Some((_, value)) = query.iter().find(|(query_name, _)| query_name == name) {
937 input.insert((*key).to_owned(), Value::String(value.clone()));
938 }
939 }
940 let param = |wanted: &str| {
941 params
942 .iter()
943 .find(|(name, _)| *name == wanted)
944 .map(|(_, value)| *value)
945 };
946 if let (Some(owner), Some(name)) = (param("owner"), param("name")) {
947 input.insert("repo".to_owned(), Value::String(format!("{owner}/{name}")));
948 }
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97949 // Every other name the path gives, under that name; the ones below that
950 // need more (a repository, a number, an encoded name) are set after.
951 for (key, value) in &params {
952 if !matches!(*key, "owner" | "name") {
953 input.insert((*key).to_owned(), Value::String(percent_decoded(value)));
Docs worth reading, and kept that way954 }
Agents as a team: lifecycle, merge queue, billing and a new shell955 }
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar956 // A repository of a team's workspace, named by itself.
957 if let (Some(workspace), Some(name)) = (param("workspace"), param("repo")) {
958 input.insert("repo".to_owned(), Value::String(format!("{workspace}/{name}")));
959 }
960 // A branch name may hold slashes, sent URL-encoded as one segment, and
961 // a label's name spaces.
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look962 if let Some(branch) = param("branch") {
963 input.insert("branch".to_owned(), Value::String(percent_decoded(branch)));
964 }
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97965 // An environment's name may hold slashes and spaces, URL-encoded.
966 if let Some(environment) = param("environment") {
967 input.insert("environment".to_owned(), Value::String(percent_decoded(environment)));
968 }
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar969 if let Some(label) = param("label") {
970 input.insert("label".to_owned(), Value::String(percent_decoded(label)));
971 }
972 if let Some(milestone) = param("milestone") {
973 // Not a number: zero, which no milestone has.
974 input.insert("milestone".to_owned(), milestone.parse::<u32>().unwrap_or(0).into());
975 }
GitHub Actions on g1t, part two: running workflows976 // GitHub says some things with the path alone.
977 if route.path.ends_with("/enable") || route.path.ends_with("/disable") {
978 input.insert("enabled".to_owned(), Value::Bool(route.path.ends_with("/enable")));
979 }
980 if route.path.ends_with("/rerun-failed-jobs") {
981 input.insert("failed_only".to_owned(), Value::Bool(true));
982 }
API: notifications over REST and MCP, with notifications scopes983 // Unsaving and waking a thread are a DELETE of what PUT made.
984 if route.method == "DELETE" && route.path.ends_with("/saved") {
985 input.insert("saved".to_owned(), Value::Bool(false));
986 }
987 if route.method == "DELETE" && route.path.ends_with("/snooze") {
988 input.remove("until");
989 }
API and MCP server in Rust; a public index at the API root990 if let Some(number) = param("number") {
991 // Not a number: zero, which no issue or pull request has.
992 input.insert(
993 "number".to_owned(),
994 number.parse::<u32>().unwrap_or(0).into(),
995 );
996 }
997 Some((route, Value::Object(input)))
998}
999
1000#[cfg(test)]
1001mod tests {
1002 use serde_json::json;
1003
1004 use super::*;
1005
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb971006 /// Every name a route's path gives reaches the operation: a name left
1007 /// off the lists above is dropped, and the operation answers that it
1008 /// was not given (the project routes were, until this test).
1009 #[test]
1010 fn every_path_parameter_reaches_the_input() {
1011 for route in ROUTES.iter() {
1012 let names: Vec<&str> = route.path.split('/').filter_map(|part| part.strip_prefix(':')).collect();
1013 if names.is_empty() {
1014 continue;
1015 }
1016 let path: String = route
1017 .path
1018 .split('/')
1019 .map(|part| match part.strip_prefix(':') {
1020 Some("number" | "milestone") => "7".to_owned(),
1021 Some(name) => format!("{name}-x"),
1022 None => part.to_owned(),
1023 })
1024 .collect::<Vec<_>>()
1025 .join("/");
1026 let (found, input) = resolve(route.method, &path, &[], json!({})).unwrap();
1027 // A path two routes could take is checked under the first.
1028 if found.path != route.path {
1029 continue;
1030 }
1031 for name in names {
1032 let key = match name {
1033 "owner" | "name" => "repo",
1034 "repo" if names_has_workspace(route.path) => "repo",
1035 other => other,
1036 };
1037 assert!(
1038 input.get(key).is_some_and(|value| !value.is_null()),
1039 "{} {}: :{name} does not reach the input",
1040 route.method,
1041 route.path
1042 );
1043 }
1044 }
1045 }
1046
1047 fn names_has_workspace(path: &str) -> bool {
1048 path.split('/').any(|part| part == ":workspace")
1049 }
1050
API and MCP server in Rust; a public index at the API root1051 #[test]
1052 fn a_path_resolves_to_its_operation_and_input() {
1053 let (route, input) = resolve(
1054 "POST",
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look1055 "/repos/flagon-io/hello/pulls/14/merge",
API and MCP server in Rust; a public index at the API root1056 &[],
1057 json!({ "keep_issue_open": true, "number": 99, "repo": "someone/else" }),
1058 )
1059 .unwrap();
1060 assert_eq!(route.op, Op::MergePullRequest);
1061 // What the path names wins over the body.
1062 assert_eq!(
1063 input,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look1064 json!({ "keep_issue_open": true, "number": 14, "repo": "flagon-io/hello" })
API and MCP server in Rust; a public index at the API root1065 );
1066 }
1067
1068 #[test]
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look1069 fn a_branch_with_slashes_is_one_encoded_segment() {
1070 let (route, input) = resolve(
1071 "POST",
1072 "/repos/flagon-io/hello/branches/feature%2Flogin/rename",
1073 &[],
1074 json!({ "new_name": "feature/sign-in" }),
1075 )
1076 .unwrap();
1077 assert_eq!(route.op, Op::RenameBranch);
1078 assert_eq!(
1079 input,
1080 json!({ "new_name": "feature/sign-in", "branch": "feature/login", "repo": "flagon-io/hello" })
1081 );
1082 assert_eq!(percent_decoded("100%"), "100%");
1083 assert_eq!(percent_decoded("a%2bb%zz"), "a+b%zz");
1084 }
1085
1086 #[test]
1087 fn a_collaborator_is_named_by_username() {
1088 let (route, input) = resolve(
1089 "PATCH",
1090 "/repos/flagon-io/hello/collaborators/ada",
1091 &[],
1092 json!({ "role": "maintain" }),
1093 )
1094 .unwrap();
1095 assert_eq!(route.op, Op::UpdateCollaborator);
1096 assert_eq!(input, json!({ "role": "maintain", "username": "ada", "repo": "flagon-io/hello" }));
1097 let (route, input) = resolve("DELETE", "/user/repository_invitations/rin_1", &[], Value::Null).unwrap();
1098 assert_eq!(route.op, Op::DeclineRepoInvitation);
1099 assert_eq!(input, json!({ "id": "rin_1" }));
1100 }
1101
1102 #[test]
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar1103 fn teams_are_addressed_by_workspace_and_slug() {
1104 let query = [("q".to_owned(), "back".to_owned())];
1105 let (route, input) = resolve("GET", "/workspaces/acme/teams", &query, Value::Null).unwrap();
1106 assert_eq!(route.op, Op::ListTeams);
1107 assert_eq!(input, json!({ "query": "back", "workspace": "acme" }));
1108 let (route, input) = resolve("PATCH", "/workspaces/acme/teams/backend", &[], json!({ "name": "Back end" })).unwrap();
1109 assert_eq!(route.op, Op::UpdateTeam);
1110 assert_eq!(input, json!({ "name": "Back end", "workspace": "acme", "team": "backend" }));
1111 let (route, input) =
1112 resolve("PUT", "/workspaces/acme/teams/backend/members/ana", &[], json!({ "role": "maintainer" })).unwrap();
1113 assert_eq!(route.op, Op::SetTeamMember);
1114 assert_eq!(input, json!({ "role": "maintainer", "workspace": "acme", "team": "backend", "username": "ana" }));
1115 let query = [("include_child_teams".to_owned(), "true".to_owned())];
1116 let (route, input) = resolve("GET", "/workspaces/acme/teams/backend/members", &query, Value::Null).unwrap();
1117 assert_eq!(route.op, Op::ListTeamMembers);
1118 assert_eq!(input, json!({ "include_child_teams": "true", "workspace": "acme", "team": "backend" }));
1119 // A repository is named by itself, in the team's workspace.
1120 let (route, input) =
1121 resolve("PUT", "/workspaces/acme/teams/backend/repos/rocket", &[], json!({ "role": "write" })).unwrap();
1122 assert_eq!(route.op, Op::SetTeamRepo);
1123 assert_eq!(input, json!({ "role": "write", "workspace": "acme", "team": "backend", "repo": "acme/rocket" }));
1124 let op = |method: &str, path: &str| resolve(method, path, &[], Value::Null).unwrap().0.op;
1125 assert_eq!(op("DELETE", "/workspaces/acme/teams/backend/repos/rocket"), Op::RemoveTeamRepo);
1126 assert_eq!(op("GET", "/workspaces/acme/teams/backend/teams"), Op::ListChildTeams);
1127 assert_eq!(op("GET", "/workspaces/acme/teams/backend/repos"), Op::ListTeamRepos);
1128 assert_eq!(op("PUT", "/workspaces/acme/teams/backend/review_assignment"), Op::SetTeamReviewAssignment);
1129 assert_eq!(op("DELETE", "/workspaces/acme/teams/backend"), Op::DeleteTeam);
1130 assert_eq!(op("POST", "/workspaces/acme/teams"), Op::CreateTeam);
1131 assert_eq!(op("GET", "/workspaces/acme/teams/backend"), Op::GetTeam);
1132 assert_eq!(op("DELETE", "/workspaces/acme/teams/backend/members/ana"), Op::RemoveTeamMember);
1133 let (route, input) = resolve("GET", "/workspaces/acme/members/ana/teams", &[], Value::Null).unwrap();
1134 assert_eq!(route.op, Op::ListUserTeams);
1135 assert_eq!(input, json!({ "workspace": "acme", "username": "ana" }));
1136 }
1137
1138 #[test]
1139 fn reviewers_are_requested_and_code_owners_checked_on_a_repository() {
1140 let body = json!({ "reviewers": ["ana"], "team_reviewers": ["backend"] });
1141 let (route, input) = resolve("POST", "/repos/acme/rocket/pulls/7/requested_reviewers", &[], body.clone()).unwrap();
1142 assert_eq!(route.op, Op::RequestReviewers);
1143 assert_eq!(
1144 input,
1145 json!({ "reviewers": ["ana"], "team_reviewers": ["backend"], "repo": "acme/rocket", "number": 7 })
1146 );
1147 let (route, _) = resolve("DELETE", "/repos/acme/rocket/pulls/7/requested_reviewers", &[], body).unwrap();
1148 assert_eq!(route.op, Op::RemoveRequestedReviewers);
1149 let query = [("ref".to_owned(), "main".to_owned())];
1150 let (route, input) = resolve("GET", "/repos/acme/rocket/codeowners/errors", &query, Value::Null).unwrap();
1151 assert_eq!(route.op, Op::GetCodeownersErrors);
1152 assert_eq!(input, json!({ "ref": "main", "repo": "acme/rocket" }));
1153 }
1154
1155 #[test]
API: notifications over REST and MCP, with notifications scopes1156 fn notifications_are_addressed_as_threads_and_by_issue() {
1157 let (route, input) = resolve("DELETE", "/notifications/threads/ntf_1", &[], Value::Null).unwrap();
1158 assert_eq!(route.op, Op::MarkThreadDone);
1159 assert_eq!(input, json!({ "id": "ntf_1" }));
1160 let (route, input) = resolve("DELETE", "/notifications/threads/ntf_1/saved", &[], Value::Null).unwrap();
1161 assert_eq!(route.op, Op::SaveThread);
1162 assert_eq!(input, json!({ "id": "ntf_1", "saved": false }));
1163 let (route, input) = resolve("DELETE", "/notifications/threads/ntf_1/snooze", &[], json!({ "until": "x" })).unwrap();
1164 assert_eq!(route.op, Op::SnoozeThread);
1165 assert_eq!(input, json!({ "id": "ntf_1" }));
1166 let query = [("all".to_owned(), "true".to_owned()), ("per_page".to_owned(), "50".to_owned())];
1167 let (route, input) = resolve("GET", "/repos/acme/rocket/notifications", &query, Value::Null).unwrap();
1168 assert_eq!(route.op, Op::ListNotifications);
1169 assert_eq!(input, json!({ "all": "true", "per_page": "50", "repo": "acme/rocket" }));
1170 let (route, input) = resolve("PUT", "/repos/acme/rocket/issues/7/subscription", &[], json!({ "ignored": true })).unwrap();
1171 assert_eq!(route.op, Op::SetThreadSubscription);
1172 assert_eq!(input, json!({ "ignored": true, "number": 7, "repo": "acme/rocket" }));
1173 assert_eq!(resolve("GET", "/user/subscriptions", &[], Value::Null).unwrap().0.op, Op::ListWatchedRepos);
1174 }
1175
1176 #[test]
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar1177 fn labels_and_milestones_are_named_in_the_path() {
1178 let (route, input) = resolve("PATCH", "/repos/acme/web/labels/good%20first%20issue", &[], json!({ "color": "7057ff" })).unwrap();
1179 assert_eq!(route.op, Op::UpdateLabel);
1180 assert_eq!(input, json!({ "color": "7057ff", "label": "good first issue", "repo": "acme/web" }));
1181 let (route, input) = resolve("DELETE", "/repos/acme/web/issues/7/labels/bug", &[], Value::Null).unwrap();
1182 assert_eq!(route.op, Op::RemoveIssueLabels);
1183 assert_eq!(input, json!({ "label": "bug", "number": 7, "repo": "acme/web" }));
1184 let (route, input) = resolve("DELETE", "/repos/acme/web/issues/7/labels", &[], Value::Null).unwrap();
1185 assert_eq!(route.op, Op::RemoveIssueLabels);
1186 assert_eq!(input, json!({ "number": 7, "repo": "acme/web" }));
1187 let (route, _) = resolve("POST", "/repos/acme/web/labels/defaults", &[], Value::Null).unwrap();
1188 assert_eq!(route.op, Op::AddDefaultLabels);
1189 let (route, input) = resolve("PATCH", "/repos/acme/web/milestones/3", &[], json!({ "state": "closed" })).unwrap();
1190 assert_eq!(route.op, Op::UpdateMilestone);
1191 assert_eq!(input, json!({ "state": "closed", "milestone": 3, "repo": "acme/web" }));
1192 let (route, input) = resolve("PATCH", "/repos/acme/web/pulls/9", &[], json!({ "base": "release" })).unwrap();
1193 assert_eq!(route.op, Op::UpdatePullRequest);
1194 assert_eq!(input, json!({ "base": "release", "number": 9, "repo": "acme/web" }));
1195 }
1196
1197 #[test]
Usage, Billing settings and prepaid AI credit; fixes from the UX audit1198 fn billing_is_addressed_by_workspace() {
1199 let query = [("from".to_owned(), "2026-10-01".to_owned()), ("products".to_owned(), "agent,sandboxes".to_owned())];
1200 let (route, input) = resolve("GET", "/workspaces/acme/usage", &query, Value::Null).unwrap();
1201 assert_eq!(route.op, Op::GetUsage);
1202 assert_eq!(input, json!({ "from": "2026-10-01", "products": "agent,sandboxes", "workspace": "acme" }));
1203 let (route, input) = resolve("PUT", "/workspaces/acme/budget", &[], json!({ "alerts": [50] })).unwrap();
1204 assert_eq!(route.op, Op::SetBudget);
1205 assert_eq!(input, json!({ "alerts": [50], "workspace": "acme" }));
1206 let op = |method: &str, path: &str| resolve(method, path, &[], Value::Null).unwrap().0.op;
1207 assert_eq!(op("GET", "/workspaces/acme/budget"), Op::GetBudget);
1208 assert_eq!(op("GET", "/workspaces/acme/ai_credit"), Op::GetAiCredit);
1209 assert_eq!(op("POST", "/workspaces/acme/ai_credit/checkout"), Op::BuyAiCredit);
1210 assert_eq!(op("GET", "/workspaces/acme/invoices"), Op::ListInvoices);
1211 assert_eq!(op("GET", "/workspaces/acme/billing_details"), Op::GetBillingDetails);
Merge the AI Gateway: Anthropic's Messages API on a workspace's tokens1212 assert_eq!(op("GET", "/workspaces/acme/gateway/requests"), Op::ListGatewayRequests);
Usage, Billing settings and prepaid AI credit; fixes from the UX audit1213 }
1214
1215 #[test]
Merge checks: statuses and check runs on every commit1216 fn checks_are_at_githubs_addresses() {
1217 let sha = "a".repeat(40);
1218 let body = json!({ "state": "success", "context": "ci/build" });
1219 let (route, input) = resolve("POST", &format!("/repos/acme/web/statuses/{sha}"), &[], body).unwrap();
1220 assert_eq!(route.op, Op::Checks(ChecksOp::CreateCommitStatus));
1221 assert_eq!(input, json!({ "state": "success", "context": "ci/build", "sha": sha, "repo": "acme/web" }));
1222 let (route, input) = resolve("GET", "/repos/acme/web/commits/release%2F1.x/status", &[], Value::Null).unwrap();
1223 assert_eq!(route.op, Op::Checks(ChecksOp::GetCombinedStatus));
1224 assert_eq!(input, json!({ "ref": "release/1.x", "repo": "acme/web" }));
1225 let query = [("check_name".to_owned(), "lint".to_owned())];
1226 let (route, input) = resolve("GET", "/repos/acme/web/commits/main/check-runs", &query, Value::Null).unwrap();
1227 assert_eq!(route.op, Op::Checks(ChecksOp::ListCheckRunsForRef));
1228 assert_eq!(input, json!({ "check_name": "lint", "ref": "main", "repo": "acme/web" }));
1229 let (route, input) = resolve("PATCH", "/repos/acme/web/check-runs/cr_1", &[], json!({ "conclusion": "success" })).unwrap();
1230 assert_eq!(route.op, Op::Checks(ChecksOp::UpdateCheckRun));
1231 assert_eq!(input, json!({ "conclusion": "success", "id": "cr_1", "repo": "acme/web" }));
1232 let op = |method: &str, path: &str| resolve(method, path, &[], Value::Null).unwrap().0.op;
1233 assert_eq!(op("POST", "/repos/acme/web/check-runs"), Op::Checks(ChecksOp::CreateCheckRun));
1234 assert_eq!(op("GET", "/repos/acme/web/check-runs/cr_1/annotations"), Op::Checks(ChecksOp::ListCheckRunAnnotations));
1235 assert_eq!(op("POST", "/repos/acme/web/check-suites/cs_1/rerequest"), Op::Checks(ChecksOp::RerequestCheckSuite));
1236 assert_eq!(op("GET", "/repos/acme/web/commits/main/check-suites"), Op::Checks(ChecksOp::ListCheckSuitesForRef));
1237 }
1238
1239 #[test]
API and MCP server in Rust; a public index at the API root1240 fn query_parameters_are_renamed() {
1241 let query = [
1242 ("q".to_owned(), "parser".to_owned()),
1243 ("x".to_owned(), "y".to_owned()),
1244 ];
Agents as a team: lifecycle, merge queue, billing and a new shell1245 let (route, input) = resolve("GET", "/repos", &query, Value::Null).unwrap();
API and MCP server in Rust; a public index at the API root1246 assert_eq!(route.op, Op::ListRepos);
1247 assert_eq!(input, json!({ "query": "parser" }));
1248 }
1249
1250 #[test]
1251 fn method_and_shape_must_match() {
Agents as a team: lifecycle, merge queue, billing and a new shell1252 assert!(resolve("GET", "/repos/a/b/issues/1/close", &[], Value::Null).is_none());
1253 assert!(resolve("GET", "/repos/a", &[], Value::Null).is_none());
1254 assert!(resolve("GET", "/repos/a/b/issues/1/extra", &[], Value::Null).is_none());
1255 assert!(resolve("GET", "/repos/a/b/", &[], Value::Null).is_some());
API and MCP server in Rust; a public index at the API root1256 }
1257
1258 #[test]
1259 fn every_parameter_and_query_name_is_an_input() {
1260 for route in ROUTES {
1261 let properties = route.op.properties();
1262 for (_, key) in route.query {
1263 assert!(properties.contains_key(*key), "{}: {key}", route.path);
1264 }
1265 for name in route.params() {
1266 let covered = matches!(name, "owner" | "name") && properties.contains_key("repo")
1267 || properties.contains_key(name);
1268 assert!(covered, "{}: {name}", route.path);
1269 }
1270 }
1271 }
1272
1273 #[test]
1274 fn every_operation_has_a_route() {
1275 for op in Op::ALL {
1276 assert!(ROUTES.iter().any(|route| route.op == op), "{}", op.name());
1277 }
1278 }
1279}

This file's history is long; its oldest lines are credited to the oldest commit read.