Skip to content

g1t/apps/api/src/rest.rs

1,257 lines57,302 bytesCodeBlameRaw

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;
Actions: OIDC tokens, the toolkit's cache and artifact services, and artifacts in R26use crate::artifacts::ArtifactsOp;
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb977use crate::deployments::DeploymentsOp;
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), &[]),
Agents as a team: lifecycle, merge queue, billing and a new shell327 route("GET", "/repos/:owner/:name/queue", Op::GetMergeQueue, &[]),
API and MCP server in Rust; a public index at the API root328 route(
Usage, like a hosting provider's: what agents cost, per day, task, repository and pull request329 "POST",
330 "/repos/:owner/:name/pulls/:number/messages",
331 Op::MessageAgent,
332 &[],
333 ),
334 route(
335 "POST",
336 "/repos/:owner/:name/pulls/:number/messages/take",
337 Op::TakeMessages,
338 &[],
339 ),
340 route(
Docs worth reading, and kept that way341 "POST",
342 "/repos/:owner/:name/messages/:id/answer",
343 Op::AnswerMessage,
344 &[],
345 ),
Agents and memory, checks and conflicts, profiles, slug renames, custom domains346 route("POST", "/repos/:owner/:name/memory", Op::Remember, &[]),
347 route(
348 "GET",
349 "/repos/:owner/:name/memory",
350 Op::Recall,
351 &[("q", "query"), ("limit", "limit")],
352 ),
Docs worth reading, and kept that way353 route(
API and MCP server in Rust; a public index at the API root354 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell355 "/repos/:owner/:name/events",
API and MCP server in Rust; a public index at the API root356 Op::ListEvents,
357 &[("before", "before")],
358 ),
Agents as a team: lifecycle, merge queue, billing and a new shell359 route("GET", "/repos/:owner/:name/labels", Op::ListLabels, &[]),
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar360 route("POST", "/repos/:owner/:name/labels", Op::CreateLabel, &[]),
361 route("POST", "/repos/:owner/:name/labels/defaults", Op::AddDefaultLabels, &[]),
362 route("PATCH", "/repos/:owner/:name/labels/:label", Op::UpdateLabel, &[]),
363 route("DELETE", "/repos/:owner/:name/labels/:label", Op::DeleteLabel, &[]),
364 route("GET", "/repos/:owner/:name/issues/:number/labels", Op::ListIssueLabels, &[]),
365 route("POST", "/repos/:owner/:name/issues/:number/labels", Op::AddIssueLabels, &[]),
366 route("PUT", "/repos/:owner/:name/issues/:number/labels", Op::SetIssueLabels, &[]),
367 route("DELETE", "/repos/:owner/:name/issues/:number/labels", Op::RemoveIssueLabels, &[]),
368 route("DELETE", "/repos/:owner/:name/issues/:number/labels/:label", Op::RemoveIssueLabels, &[]),
369 route("GET", "/repos/:owner/:name/milestones", Op::ListMilestones, &[("state", "state")]),
370 route("POST", "/repos/:owner/:name/milestones", Op::CreateMilestone, &[]),
371 route("GET", "/repos/:owner/:name/milestones/:milestone", Op::GetMilestone, &[]),
372 route("PATCH", "/repos/:owner/:name/milestones/:milestone", Op::UpdateMilestone, &[]),
373 route("DELETE", "/repos/:owner/:name/milestones/:milestone", Op::DeleteMilestone, &[]),
API and MCP server in Rust; a public index at the API root374 route(
375 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell376 "/repos/:owner/:name/issues",
API and MCP server in Rust; a public index at the API root377 Op::ListIssues,
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar378 &[("state", "state"), ("label", "label"), ("milestone", "milestone")],
API and MCP server in Rust; a public index at the API root379 ),
Agents as a team: lifecycle, merge queue, billing and a new shell380 route("POST", "/repos/:owner/:name/issues", Op::CreateIssue, &[]),
API and MCP server in Rust; a public index at the API root381 route(
382 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell383 "/repos/:owner/:name/issues/:number",
API and MCP server in Rust; a public index at the API root384 Op::GetIssue,
385 &[],
386 ),
387 route(
388 "PATCH",
Agents as a team: lifecycle, merge queue, billing and a new shell389 "/repos/:owner/:name/issues/:number",
API and MCP server in Rust; a public index at the API root390 Op::UpdateIssue,
391 &[],
392 ),
393 route(
394 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell395 "/repos/:owner/:name/issues/:number/close",
API and MCP server in Rust; a public index at the API root396 Op::CloseIssue,
397 &[],
398 ),
399 route(
400 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell401 "/repos/:owner/:name/issues/:number/reopen",
API and MCP server in Rust; a public index at the API root402 Op::ReopenIssue,
403 &[],
404 ),
405 route(
406 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell407 "/repos/:owner/:name/issues/:number/assign",
408 Op::AssignIssue,
409 &[],
410 ),
Integrations: your own model provider, alerts that open issues, tickets agents read411 route(
412 "POST",
413 "/repos/:owner/:name/issues/import",
414 Op::ImportIssue,
415 &[],
416 ),
417 route(
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step418 "POST",
419 "/repos/:owner/:name/issues/delegate",
420 Op::Delegate,
421 &[],
422 ),
423 route(
Integrations: your own model provider, alerts that open issues, tickets agents read424 "GET",
425 "/repos/:owner/:name/context",
426 Op::GetContext,
427 &[("reference", "reference")],
428 ),
429 route(
430 "GET",
Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API431 "/workspaces/:workspace/context/search",
432 Op::SearchContext,
433 &[("q", "query"), ("project", "project"), ("kinds", "kinds"), ("limit", "limit")],
434 ),
435 route(
436 "GET",
437 "/workspaces/:workspace/context/:kind/:id",
438 Op::GetEntity,
439 &[],
440 ),
441 route(
442 "GET",
Integrations: your own model provider, alerts that open issues, tickets agents read443 "/workspaces/:workspace/integrations",
444 Op::ListIntegrations,
445 &[],
446 ),
447 route(
448 "POST",
449 "/workspaces/:workspace/integrations",
450 Op::ConnectIntegration,
451 &[],
452 ),
453 route(
Models per workspace: several providers, routed by kind of work454 "GET",
Webhooks: every event, to your own addresses, signed and retried455 "/repos/:owner/:name/hooks",
456 Op::ListWebhooks,
457 &[],
458 ),
459 route(
460 "POST",
461 "/repos/:owner/:name/hooks",
462 Op::CreateWebhook,
463 &[],
464 ),
465 route(
466 "PATCH",
467 "/repos/:owner/:name/hooks/:id",
468 Op::UpdateWebhook,
469 &[],
470 ),
471 route(
472 "DELETE",
473 "/repos/:owner/:name/hooks/:id",
474 Op::DeleteWebhook,
475 &[],
476 ),
477 route(
478 "POST",
479 "/repos/:owner/:name/hooks/:id/pings",
480 Op::PingWebhook,
481 &[],
482 ),
483 route(
484 "GET",
485 "/repos/:owner/:name/hooks/:id/deliveries",
486 Op::ListWebhookDeliveries,
487 &[],
488 ),
489 route(
490 "POST",
491 "/repos/:owner/:name/hooks/:id/deliveries/:delivery/redeliver",
492 Op::RedeliverWebhook,
493 &[],
494 ),
495 route(
496 "GET",
497 "/workspaces/:workspace/hooks",
498 Op::ListWebhooks,
499 &[],
500 ),
501 route(
502 "POST",
503 "/workspaces/:workspace/hooks",
504 Op::CreateWebhook,
505 &[],
506 ),
507 route(
508 "PATCH",
509 "/workspaces/:workspace/hooks/:id",
510 Op::UpdateWebhook,
511 &[],
512 ),
513 route(
514 "DELETE",
515 "/workspaces/:workspace/hooks/:id",
516 Op::DeleteWebhook,
517 &[],
518 ),
519 route(
520 "POST",
521 "/workspaces/:workspace/hooks/:id/pings",
522 Op::PingWebhook,
523 &[],
524 ),
525 route(
526 "GET",
527 "/workspaces/:workspace/hooks/:id/deliveries",
528 Op::ListWebhookDeliveries,
529 &[],
530 ),
531 route(
532 "POST",
533 "/workspaces/:workspace/hooks/:id/deliveries/:delivery/redeliver",
534 Op::RedeliverWebhook,
535 &[],
536 ),
537 route(
538 "GET",
Models per workspace: several providers, routed by kind of work539 "/workspaces/:workspace/model-routes",
540 Op::GetModelRoutes,
541 &[],
542 ),
543 route(
544 "PUT",
545 "/workspaces/:workspace/model-routes",
546 Op::SetModelRoutes,
547 &[],
548 ),
549 route(
AI Gateway: OpenAI's format, open models, and your own providers550 "PATCH",
551 "/workspaces/:workspace/integrations/:id",
552 Op::UpdateIntegration,
553 &[],
554 ),
555 route(
Integrations: your own model provider, alerts that open issues, tickets agents read556 "DELETE",
557 "/workspaces/:workspace/integrations/:id",
558 Op::DisconnectIntegration,
559 &[],
560 ),
561 route(
562 "POST",
563 "/workspaces/:workspace/integrations/:id/test",
564 Op::TestIntegration,
565 &[],
566 ),
Automations: rules in .g1t/automations that act when something happens567 route(
568 "GET",
GitHub Actions on g1t, part two: running workflows569 "/repos/:owner/:name/actions/workflows",
570 Op::ListWorkflows,
571 &[],
572 ),
573 route(
574 "GET",
575 "/repos/:owner/:name/actions/workflows/:workflow/runs",
576 Op::ListWorkflowRuns,
577 &[("branch", "branch"), ("event", "event"), ("per_page", "limit")],
578 ),
579 route(
580 "POST",
581 "/repos/:owner/:name/actions/workflows/:workflow/dispatches",
582 Op::DispatchWorkflow,
583 &[],
584 ),
585 route(
586 "PATCH",
587 "/repos/:owner/:name/actions/workflows/:workflow",
588 Op::UpdateWorkflow,
589 &[],
590 ),
591 route(
592 "PUT",
593 "/repos/:owner/:name/actions/workflows/:workflow/enable",
594 Op::UpdateWorkflow,
595 &[],
596 ),
597 route(
598 "PUT",
599 "/repos/:owner/:name/actions/workflows/:workflow/disable",
600 Op::UpdateWorkflow,
601 &[],
602 ),
603 route(
604 "GET",
605 "/repos/:owner/:name/actions/runs",
606 Op::ListWorkflowRuns,
607 &[("workflow", "workflow"), ("branch", "branch"), ("event", "event"), ("pull", "pull"), ("head_sha", "sha"), ("per_page", "limit")],
608 ),
609 route(
610 "GET",
611 "/repos/:owner/:name/actions/runs/:id",
612 Op::GetWorkflowRun,
613 &[],
614 ),
615 route(
616 "POST",
617 "/repos/:owner/:name/actions/runs/:id/cancel",
618 Op::CancelWorkflowRun,
619 &[],
620 ),
621 route(
622 "POST",
623 "/repos/:owner/:name/actions/runs/:id/rerun",
624 Op::RerunWorkflowRun,
625 &[],
626 ),
627 route(
628 "POST",
629 "/repos/:owner/:name/actions/runs/:id/rerun-failed-jobs",
630 Op::RerunWorkflowRun,
631 &[],
632 ),
633 route(
634 "GET",
635 "/repos/:owner/:name/actions/jobs/:job/logs",
636 Op::GetJobLogs,
637 &[("after", "after")],
638 ),
Actions: OIDC tokens, the toolkit's cache and artifact services, and artifacts in R2639 // Artifacts, at GitHub's addresses. `…/zip` answers with a redirect to
640 // a signed link (lib.rs).
641 route("GET", "/repos/:owner/:name/actions/artifacts", Op::Artifacts(ArtifactsOp::ListArtifacts), &[("name", "name"), ("page", "page"), ("per_page", "per_page")]),
642 route("GET", "/repos/:owner/:name/actions/runs/:id/artifacts", Op::Artifacts(ArtifactsOp::ListRunArtifacts), &[("name", "name")]),
643 route("GET", "/repos/:owner/:name/actions/artifacts/:id", Op::Artifacts(ArtifactsOp::GetArtifact), &[]),
644 route("GET", "/repos/:owner/:name/actions/artifacts/:id/zip", Op::Artifacts(ArtifactsOp::DownloadArtifact), &[]),
645 route("DELETE", "/repos/:owner/:name/actions/artifacts/:id", Op::Artifacts(ArtifactsOp::DeleteArtifact), &[]),
646 route("GET", "/repos/:owner/:name/actions/permissions/artifact-and-log-retention", Op::Artifacts(ArtifactsOp::GetArtifactRetention), &[]),
647 route("PUT", "/repos/:owner/:name/actions/permissions/artifact-and-log-retention", Op::Artifacts(ArtifactsOp::SetArtifactRetention), &[]),
GitHub Actions on g1t, part two: running workflows648 route(
649 "GET",
650 "/repos/:owner/:name/actions/secrets",
651 Op::ListActionsSecrets,
652 &[],
653 ),
654 route(
655 "PUT",
656 "/repos/:owner/:name/actions/secrets/:setting",
657 Op::SetActionsSecret,
658 &[],
659 ),
660 route(
661 "DELETE",
662 "/repos/:owner/:name/actions/secrets/:setting",
663 Op::DeleteActionsSecret,
664 &[],
665 ),
666 route(
667 "GET",
668 "/repos/:owner/:name/actions/variables",
669 Op::ListActionsVariables,
670 &[],
671 ),
672 route(
673 "POST",
674 "/repos/:owner/:name/actions/variables",
675 Op::SetActionsVariable,
676 &[],
677 ),
678 route(
679 "PATCH",
680 "/repos/:owner/:name/actions/variables/:setting",
681 Op::SetActionsVariable,
682 &[],
683 ),
684 route(
685 "DELETE",
686 "/repos/:owner/:name/actions/variables/:setting",
687 Op::DeleteActionsVariable,
688 &[],
689 ),
690 route(
691 "GET",
692 "/workspaces/:workspace/actions/secrets",
693 Op::ListActionsSecrets,
694 &[],
695 ),
696 route(
697 "PUT",
698 "/workspaces/:workspace/actions/secrets/:setting",
699 Op::SetActionsSecret,
700 &[],
701 ),
702 route(
703 "DELETE",
704 "/workspaces/:workspace/actions/secrets/:setting",
705 Op::DeleteActionsSecret,
706 &[],
707 ),
708 route(
709 "GET",
710 "/workspaces/:workspace/actions/variables",
711 Op::ListActionsVariables,
712 &[],
713 ),
714 route(
715 "POST",
716 "/workspaces/:workspace/actions/variables",
717 Op::SetActionsVariable,
718 &[],
719 ),
720 route(
721 "PATCH",
722 "/workspaces/:workspace/actions/variables/:setting",
723 Op::SetActionsVariable,
724 &[],
725 ),
726 route(
727 "DELETE",
728 "/workspaces/:workspace/actions/variables/:setting",
729 Op::DeleteActionsVariable,
730 &[],
731 ),
Fast pages, required checks on the branch, self-hosted runners, honest incidents732 // Self-hosted runners: a repository's own, or a workspace's.
733 route("GET", "/repos/:owner/:name/actions/runners", Op::ListRunners, &[]),
734 route("POST", "/repos/:owner/:name/actions/runners/registration-token", Op::CreateRunnerRegistrationToken, &[]),
735 route("DELETE", "/repos/:owner/:name/actions/runners/:id", Op::RemoveRunner, &[]),
736 route("GET", "/repos/:owner/:name/actions/runner-settings", Op::GetRunnerSettings, &[]),
737 route("PATCH", "/repos/:owner/:name/actions/runner-settings", Op::UpdateRunnerSettings, &[]),
738 route("GET", "/workspaces/:workspace/actions/runners", Op::ListRunners, &[]),
739 route("POST", "/workspaces/:workspace/actions/runners/registration-token", Op::CreateRunnerRegistrationToken, &[]),
740 route("DELETE", "/workspaces/:workspace/actions/runners/:id", Op::RemoveRunner, &[]),
741 route("GET", "/workspaces/:workspace/actions/runner-settings", Op::GetRunnerSettings, &[]),
742 route("PATCH", "/workspaces/:workspace/actions/runner-settings", Op::UpdateRunnerSettings, &[]),
743 route("GET", "/workspaces/:workspace/actions/runner-groups", Op::ListRunnerGroups, &[]),
744 route("POST", "/workspaces/:workspace/actions/runner-groups", Op::CreateRunnerGroup, &[]),
745 route("PATCH", "/workspaces/:workspace/actions/runner-groups/:id", Op::UpdateRunnerGroup, &[]),
746 route("DELETE", "/workspaces/:workspace/actions/runner-groups/:id", Op::DeleteRunnerGroup, &[]),
Agents as a team: lifecycle, merge queue, billing and a new shell747 route("POST", "/repos/:owner/:name/plans", Op::PlanWork, &[]),
748 route("GET", "/repos/:owner/:name/plans/:plan", Op::GetPlan, &[]),
749 route(
750 "POST",
751 "/repos/:owner/:name/plans/:plan/apply",
752 Op::ApplyPlan,
753 &[],
754 ),
755 route(
756 "POST",
757 "/repos/:owner/:name/issues/:number/comments",
API and MCP server in Rust; a public index at the API root758 Op::AddComment,
759 &[],
760 ),
761 route(
762 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell763 "/repos/:owner/:name/pulls",
API and MCP server in Rust; a public index at the API root764 Op::ListPullRequests,
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar765 &[("state", "state"), ("label", "label"), ("milestone", "milestone"), ("base", "base")],
API and MCP server in Rust; a public index at the API root766 ),
767 route(
768 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell769 "/repos/:owner/:name/pulls",
API and MCP server in Rust; a public index at the API root770 Op::CreatePullRequest,
771 &[],
772 ),
773 route(
774 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell775 "/repos/:owner/:name/pulls/:number",
API and MCP server in Rust; a public index at the API root776 Op::GetPullRequest,
777 &[],
778 ),
779 route(
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar780 "PATCH",
781 "/repos/:owner/:name/pulls/:number",
782 Op::UpdatePullRequest,
783 &[],
784 ),
785 route(
API and MCP server in Rust; a public index at the API root786 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell787 "/repos/:owner/:name/pulls/:number/changes",
API and MCP server in Rust; a public index at the API root788 Op::GetPullRequestChanges,
789 &[],
790 ),
791 route(
Acceptance checks in sandboxes, line comments and review verdicts792 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell793 "/repos/:owner/:name/pulls/:number/reviews",
Acceptance checks in sandboxes, line comments and review verdicts794 Op::ReviewPullRequest,
795 &[],
796 ),
797 route(
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar798 "POST",
799 "/repos/:owner/:name/pulls/:number/requested_reviewers",
800 Op::RequestReviewers,
801 &[],
802 ),
803 route(
804 "DELETE",
805 "/repos/:owner/:name/pulls/:number/requested_reviewers",
806 Op::RemoveRequestedReviewers,
807 &[],
808 ),
809 route(
API and MCP server in Rust; a public index at the API root810 "GET",
Agents as a team: lifecycle, merge queue, billing and a new shell811 "/repos/:owner/:name/pulls/:number/session",
API and MCP server in Rust; a public index at the API root812 Op::ReadSession,
813 &[("after", "after")],
814 ),
815 route(
816 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell817 "/repos/:owner/:name/pulls/:number/session",
API and MCP server in Rust; a public index at the API root818 Op::RecordSession,
819 &[],
820 ),
821 route(
822 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell823 "/repos/:owner/:name/pulls/:number/ready",
API and MCP server in Rust; a public index at the API root824 Op::MarkPullRequestReady,
825 &[],
826 ),
827 route(
828 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell829 "/repos/:owner/:name/pulls/:number/close",
API and MCP server in Rust; a public index at the API root830 Op::ClosePullRequest,
831 &[],
832 ),
833 route(
834 "POST",
Agents as a team: lifecycle, merge queue, billing and a new shell835 "/repos/:owner/:name/pulls/:number/merge",
API and MCP server in Rust; a public index at the API root836 Op::MergePullRequest,
837 &[],
838 ),
839];
840
841impl Route {
842 /// The names of the route's path parameters, in order.
843 pub fn params(&self) -> impl Iterator<Item = &'static str> {
844 self.path
845 .split('/')
846 .filter_map(|segment| segment.strip_prefix(':'))
847 }
848
849 /// The values of the path parameters, if `path` is this route's.
850 fn matches<'a>(&self, path: &'a str) -> Option<Vec<(&'static str, &'a str)>> {
851 let mut values = Vec::new();
852 let mut actual = path.trim_end_matches('/').split('/');
853 for expected in self.path.split('/') {
854 let segment = actual.next()?;
855 match expected.strip_prefix(':') {
856 Some(name) if !segment.is_empty() => values.push((name, segment)),
857 Some(_) => return None,
858 None if expected == segment => {}
859 None => return None,
860 }
861 }
862 actual.next().is_none().then_some(values)
863 }
864}
865
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look866/// A path segment with its `%XX` escapes decoded; as given when that is not
867/// UTF-8.
868fn percent_decoded(segment: &str) -> String {
869 let bytes = segment.as_bytes();
870 let mut out = Vec::with_capacity(bytes.len());
871 let mut i = 0;
872 while i < bytes.len() {
873 let escaped = (bytes[i] == b'%')
874 .then(|| segment.get(i + 1..i + 3))
875 .flatten()
876 .filter(|hex| hex.bytes().all(|byte| byte.is_ascii_hexdigit()))
877 .and_then(|hex| u8::from_str_radix(hex, 16).ok());
878 match escaped {
879 Some(byte) => {
880 out.push(byte);
881 i += 3;
882 }
883 None => {
884 out.push(bytes[i]);
885 i += 1;
886 }
887 }
888 }
889 String::from_utf8(out).unwrap_or_else(|_| segment.to_owned())
890}
891
API and MCP server in Rust; a public index at the API root892/// The route for a request, and the operation input it describes.
893///
894/// The input is the JSON body, overlaid with the query parameters the route
895/// 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 bar896/// `repo`, as does a team's `repo` with its `workspace`, and `number`
897/// becomes an integer.
API and MCP server in Rust; a public index at the API root898pub fn resolve(
899 method: &str,
900 path: &str,
901 query: &[(String, String)],
902 body: Value,
903) -> Option<(&'static Route, Value)> {
904 let (route, params) = ROUTES
905 .iter()
906 .filter(|route| route.method == method)
907 .find_map(|route| Some((route, route.matches(path)?)))?;
908
909 let mut input = match body {
910 Value::Object(fields) => fields,
911 _ => Map::new(),
912 };
913 for (name, key) in route.query {
914 if let Some((_, value)) = query.iter().find(|(query_name, _)| query_name == name) {
915 input.insert((*key).to_owned(), Value::String(value.clone()));
916 }
917 }
918 let param = |wanted: &str| {
919 params
920 .iter()
921 .find(|(name, _)| *name == wanted)
922 .map(|(_, value)| *value)
923 };
924 if let (Some(owner), Some(name)) = (param("owner"), param("name")) {
925 input.insert("repo".to_owned(), Value::String(format!("{owner}/{name}")));
926 }
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97927 // Every other name the path gives, under that name; the ones below that
928 // need more (a repository, a number, an encoded name) are set after.
929 for (key, value) in &params {
930 if !matches!(*key, "owner" | "name") {
931 input.insert((*key).to_owned(), Value::String(percent_decoded(value)));
Docs worth reading, and kept that way932 }
Agents as a team: lifecycle, merge queue, billing and a new shell933 }
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar934 // A repository of a team's workspace, named by itself.
935 if let (Some(workspace), Some(name)) = (param("workspace"), param("repo")) {
936 input.insert("repo".to_owned(), Value::String(format!("{workspace}/{name}")));
937 }
938 // A branch name may hold slashes, sent URL-encoded as one segment, and
939 // a label's name spaces.
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look940 if let Some(branch) = param("branch") {
941 input.insert("branch".to_owned(), Value::String(percent_decoded(branch)));
942 }
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97943 // An environment's name may hold slashes and spaces, URL-encoded.
944 if let Some(environment) = param("environment") {
945 input.insert("environment".to_owned(), Value::String(percent_decoded(environment)));
946 }
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar947 if let Some(label) = param("label") {
948 input.insert("label".to_owned(), Value::String(percent_decoded(label)));
949 }
950 if let Some(milestone) = param("milestone") {
951 // Not a number: zero, which no milestone has.
952 input.insert("milestone".to_owned(), milestone.parse::<u32>().unwrap_or(0).into());
953 }
GitHub Actions on g1t, part two: running workflows954 // GitHub says some things with the path alone.
955 if route.path.ends_with("/enable") || route.path.ends_with("/disable") {
956 input.insert("enabled".to_owned(), Value::Bool(route.path.ends_with("/enable")));
957 }
958 if route.path.ends_with("/rerun-failed-jobs") {
959 input.insert("failed_only".to_owned(), Value::Bool(true));
960 }
API: notifications over REST and MCP, with notifications scopes961 // Unsaving and waking a thread are a DELETE of what PUT made.
962 if route.method == "DELETE" && route.path.ends_with("/saved") {
963 input.insert("saved".to_owned(), Value::Bool(false));
964 }
965 if route.method == "DELETE" && route.path.ends_with("/snooze") {
966 input.remove("until");
967 }
API and MCP server in Rust; a public index at the API root968 if let Some(number) = param("number") {
969 // Not a number: zero, which no issue or pull request has.
970 input.insert(
971 "number".to_owned(),
972 number.parse::<u32>().unwrap_or(0).into(),
973 );
974 }
975 Some((route, Value::Object(input)))
976}
977
978#[cfg(test)]
979mod tests {
980 use serde_json::json;
981
982 use super::*;
983
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97984 /// Every name a route's path gives reaches the operation: a name left
985 /// off the lists above is dropped, and the operation answers that it
986 /// was not given (the project routes were, until this test).
987 #[test]
988 fn every_path_parameter_reaches_the_input() {
989 for route in ROUTES.iter() {
990 let names: Vec<&str> = route.path.split('/').filter_map(|part| part.strip_prefix(':')).collect();
991 if names.is_empty() {
992 continue;
993 }
994 let path: String = route
995 .path
996 .split('/')
997 .map(|part| match part.strip_prefix(':') {
998 Some("number" | "milestone") => "7".to_owned(),
999 Some(name) => format!("{name}-x"),
1000 None => part.to_owned(),
1001 })
1002 .collect::<Vec<_>>()
1003 .join("/");
1004 let (found, input) = resolve(route.method, &path, &[], json!({})).unwrap();
1005 // A path two routes could take is checked under the first.
1006 if found.path != route.path {
1007 continue;
1008 }
1009 for name in names {
1010 let key = match name {
1011 "owner" | "name" => "repo",
1012 "repo" if names_has_workspace(route.path) => "repo",
1013 other => other,
1014 };
1015 assert!(
1016 input.get(key).is_some_and(|value| !value.is_null()),
1017 "{} {}: :{name} does not reach the input",
1018 route.method,
1019 route.path
1020 );
1021 }
1022 }
1023 }
1024
1025 fn names_has_workspace(path: &str) -> bool {
1026 path.split('/').any(|part| part == ":workspace")
1027 }
1028
API and MCP server in Rust; a public index at the API root1029 #[test]
1030 fn a_path_resolves_to_its_operation_and_input() {
1031 let (route, input) = resolve(
1032 "POST",
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look1033 "/repos/flagon-io/hello/pulls/14/merge",
API and MCP server in Rust; a public index at the API root1034 &[],
1035 json!({ "keep_issue_open": true, "number": 99, "repo": "someone/else" }),
1036 )
1037 .unwrap();
1038 assert_eq!(route.op, Op::MergePullRequest);
1039 // What the path names wins over the body.
1040 assert_eq!(
1041 input,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look1042 json!({ "keep_issue_open": true, "number": 14, "repo": "flagon-io/hello" })
API and MCP server in Rust; a public index at the API root1043 );
1044 }
1045
1046 #[test]
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look1047 fn a_branch_with_slashes_is_one_encoded_segment() {
1048 let (route, input) = resolve(
1049 "POST",
1050 "/repos/flagon-io/hello/branches/feature%2Flogin/rename",
1051 &[],
1052 json!({ "new_name": "feature/sign-in" }),
1053 )
1054 .unwrap();
1055 assert_eq!(route.op, Op::RenameBranch);
1056 assert_eq!(
1057 input,
1058 json!({ "new_name": "feature/sign-in", "branch": "feature/login", "repo": "flagon-io/hello" })
1059 );
1060 assert_eq!(percent_decoded("100%"), "100%");
1061 assert_eq!(percent_decoded("a%2bb%zz"), "a+b%zz");
1062 }
1063
1064 #[test]
1065 fn a_collaborator_is_named_by_username() {
1066 let (route, input) = resolve(
1067 "PATCH",
1068 "/repos/flagon-io/hello/collaborators/ada",
1069 &[],
1070 json!({ "role": "maintain" }),
1071 )
1072 .unwrap();
1073 assert_eq!(route.op, Op::UpdateCollaborator);
1074 assert_eq!(input, json!({ "role": "maintain", "username": "ada", "repo": "flagon-io/hello" }));
1075 let (route, input) = resolve("DELETE", "/user/repository_invitations/rin_1", &[], Value::Null).unwrap();
1076 assert_eq!(route.op, Op::DeclineRepoInvitation);
1077 assert_eq!(input, json!({ "id": "rin_1" }));
1078 }
1079
1080 #[test]
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar1081 fn teams_are_addressed_by_workspace_and_slug() {
1082 let query = [("q".to_owned(), "back".to_owned())];
1083 let (route, input) = resolve("GET", "/workspaces/acme/teams", &query, Value::Null).unwrap();
1084 assert_eq!(route.op, Op::ListTeams);
1085 assert_eq!(input, json!({ "query": "back", "workspace": "acme" }));
1086 let (route, input) = resolve("PATCH", "/workspaces/acme/teams/backend", &[], json!({ "name": "Back end" })).unwrap();
1087 assert_eq!(route.op, Op::UpdateTeam);
1088 assert_eq!(input, json!({ "name": "Back end", "workspace": "acme", "team": "backend" }));
1089 let (route, input) =
1090 resolve("PUT", "/workspaces/acme/teams/backend/members/ana", &[], json!({ "role": "maintainer" })).unwrap();
1091 assert_eq!(route.op, Op::SetTeamMember);
1092 assert_eq!(input, json!({ "role": "maintainer", "workspace": "acme", "team": "backend", "username": "ana" }));
1093 let query = [("include_child_teams".to_owned(), "true".to_owned())];
1094 let (route, input) = resolve("GET", "/workspaces/acme/teams/backend/members", &query, Value::Null).unwrap();
1095 assert_eq!(route.op, Op::ListTeamMembers);
1096 assert_eq!(input, json!({ "include_child_teams": "true", "workspace": "acme", "team": "backend" }));
1097 // A repository is named by itself, in the team's workspace.
1098 let (route, input) =
1099 resolve("PUT", "/workspaces/acme/teams/backend/repos/rocket", &[], json!({ "role": "write" })).unwrap();
1100 assert_eq!(route.op, Op::SetTeamRepo);
1101 assert_eq!(input, json!({ "role": "write", "workspace": "acme", "team": "backend", "repo": "acme/rocket" }));
1102 let op = |method: &str, path: &str| resolve(method, path, &[], Value::Null).unwrap().0.op;
1103 assert_eq!(op("DELETE", "/workspaces/acme/teams/backend/repos/rocket"), Op::RemoveTeamRepo);
1104 assert_eq!(op("GET", "/workspaces/acme/teams/backend/teams"), Op::ListChildTeams);
1105 assert_eq!(op("GET", "/workspaces/acme/teams/backend/repos"), Op::ListTeamRepos);
1106 assert_eq!(op("PUT", "/workspaces/acme/teams/backend/review_assignment"), Op::SetTeamReviewAssignment);
1107 assert_eq!(op("DELETE", "/workspaces/acme/teams/backend"), Op::DeleteTeam);
1108 assert_eq!(op("POST", "/workspaces/acme/teams"), Op::CreateTeam);
1109 assert_eq!(op("GET", "/workspaces/acme/teams/backend"), Op::GetTeam);
1110 assert_eq!(op("DELETE", "/workspaces/acme/teams/backend/members/ana"), Op::RemoveTeamMember);
1111 let (route, input) = resolve("GET", "/workspaces/acme/members/ana/teams", &[], Value::Null).unwrap();
1112 assert_eq!(route.op, Op::ListUserTeams);
1113 assert_eq!(input, json!({ "workspace": "acme", "username": "ana" }));
1114 }
1115
1116 #[test]
1117 fn reviewers_are_requested_and_code_owners_checked_on_a_repository() {
1118 let body = json!({ "reviewers": ["ana"], "team_reviewers": ["backend"] });
1119 let (route, input) = resolve("POST", "/repos/acme/rocket/pulls/7/requested_reviewers", &[], body.clone()).unwrap();
1120 assert_eq!(route.op, Op::RequestReviewers);
1121 assert_eq!(
1122 input,
1123 json!({ "reviewers": ["ana"], "team_reviewers": ["backend"], "repo": "acme/rocket", "number": 7 })
1124 );
1125 let (route, _) = resolve("DELETE", "/repos/acme/rocket/pulls/7/requested_reviewers", &[], body).unwrap();
1126 assert_eq!(route.op, Op::RemoveRequestedReviewers);
1127 let query = [("ref".to_owned(), "main".to_owned())];
1128 let (route, input) = resolve("GET", "/repos/acme/rocket/codeowners/errors", &query, Value::Null).unwrap();
1129 assert_eq!(route.op, Op::GetCodeownersErrors);
1130 assert_eq!(input, json!({ "ref": "main", "repo": "acme/rocket" }));
1131 }
1132
1133 #[test]
API: notifications over REST and MCP, with notifications scopes1134 fn notifications_are_addressed_as_threads_and_by_issue() {
1135 let (route, input) = resolve("DELETE", "/notifications/threads/ntf_1", &[], Value::Null).unwrap();
1136 assert_eq!(route.op, Op::MarkThreadDone);
1137 assert_eq!(input, json!({ "id": "ntf_1" }));
1138 let (route, input) = resolve("DELETE", "/notifications/threads/ntf_1/saved", &[], Value::Null).unwrap();
1139 assert_eq!(route.op, Op::SaveThread);
1140 assert_eq!(input, json!({ "id": "ntf_1", "saved": false }));
1141 let (route, input) = resolve("DELETE", "/notifications/threads/ntf_1/snooze", &[], json!({ "until": "x" })).unwrap();
1142 assert_eq!(route.op, Op::SnoozeThread);
1143 assert_eq!(input, json!({ "id": "ntf_1" }));
1144 let query = [("all".to_owned(), "true".to_owned()), ("per_page".to_owned(), "50".to_owned())];
1145 let (route, input) = resolve("GET", "/repos/acme/rocket/notifications", &query, Value::Null).unwrap();
1146 assert_eq!(route.op, Op::ListNotifications);
1147 assert_eq!(input, json!({ "all": "true", "per_page": "50", "repo": "acme/rocket" }));
1148 let (route, input) = resolve("PUT", "/repos/acme/rocket/issues/7/subscription", &[], json!({ "ignored": true })).unwrap();
1149 assert_eq!(route.op, Op::SetThreadSubscription);
1150 assert_eq!(input, json!({ "ignored": true, "number": 7, "repo": "acme/rocket" }));
1151 assert_eq!(resolve("GET", "/user/subscriptions", &[], Value::Null).unwrap().0.op, Op::ListWatchedRepos);
1152 }
1153
1154 #[test]
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar1155 fn labels_and_milestones_are_named_in_the_path() {
1156 let (route, input) = resolve("PATCH", "/repos/acme/web/labels/good%20first%20issue", &[], json!({ "color": "7057ff" })).unwrap();
1157 assert_eq!(route.op, Op::UpdateLabel);
1158 assert_eq!(input, json!({ "color": "7057ff", "label": "good first issue", "repo": "acme/web" }));
1159 let (route, input) = resolve("DELETE", "/repos/acme/web/issues/7/labels/bug", &[], Value::Null).unwrap();
1160 assert_eq!(route.op, Op::RemoveIssueLabels);
1161 assert_eq!(input, json!({ "label": "bug", "number": 7, "repo": "acme/web" }));
1162 let (route, input) = resolve("DELETE", "/repos/acme/web/issues/7/labels", &[], Value::Null).unwrap();
1163 assert_eq!(route.op, Op::RemoveIssueLabels);
1164 assert_eq!(input, json!({ "number": 7, "repo": "acme/web" }));
1165 let (route, _) = resolve("POST", "/repos/acme/web/labels/defaults", &[], Value::Null).unwrap();
1166 assert_eq!(route.op, Op::AddDefaultLabels);
1167 let (route, input) = resolve("PATCH", "/repos/acme/web/milestones/3", &[], json!({ "state": "closed" })).unwrap();
1168 assert_eq!(route.op, Op::UpdateMilestone);
1169 assert_eq!(input, json!({ "state": "closed", "milestone": 3, "repo": "acme/web" }));
1170 let (route, input) = resolve("PATCH", "/repos/acme/web/pulls/9", &[], json!({ "base": "release" })).unwrap();
1171 assert_eq!(route.op, Op::UpdatePullRequest);
1172 assert_eq!(input, json!({ "base": "release", "number": 9, "repo": "acme/web" }));
1173 }
1174
1175 #[test]
Usage, Billing settings and prepaid AI credit; fixes from the UX audit1176 fn billing_is_addressed_by_workspace() {
1177 let query = [("from".to_owned(), "2026-10-01".to_owned()), ("products".to_owned(), "agent,sandboxes".to_owned())];
1178 let (route, input) = resolve("GET", "/workspaces/acme/usage", &query, Value::Null).unwrap();
1179 assert_eq!(route.op, Op::GetUsage);
1180 assert_eq!(input, json!({ "from": "2026-10-01", "products": "agent,sandboxes", "workspace": "acme" }));
1181 let (route, input) = resolve("PUT", "/workspaces/acme/budget", &[], json!({ "alerts": [50] })).unwrap();
1182 assert_eq!(route.op, Op::SetBudget);
1183 assert_eq!(input, json!({ "alerts": [50], "workspace": "acme" }));
1184 let op = |method: &str, path: &str| resolve(method, path, &[], Value::Null).unwrap().0.op;
1185 assert_eq!(op("GET", "/workspaces/acme/budget"), Op::GetBudget);
1186 assert_eq!(op("GET", "/workspaces/acme/ai_credit"), Op::GetAiCredit);
1187 assert_eq!(op("POST", "/workspaces/acme/ai_credit/checkout"), Op::BuyAiCredit);
1188 assert_eq!(op("GET", "/workspaces/acme/invoices"), Op::ListInvoices);
1189 assert_eq!(op("GET", "/workspaces/acme/billing_details"), Op::GetBillingDetails);
Merge the AI Gateway: Anthropic's Messages API on a workspace's tokens1190 assert_eq!(op("GET", "/workspaces/acme/gateway/requests"), Op::ListGatewayRequests);
Usage, Billing settings and prepaid AI credit; fixes from the UX audit1191 }
1192
1193 #[test]
Merge checks: statuses and check runs on every commit1194 fn checks_are_at_githubs_addresses() {
1195 let sha = "a".repeat(40);
1196 let body = json!({ "state": "success", "context": "ci/build" });
1197 let (route, input) = resolve("POST", &format!("/repos/acme/web/statuses/{sha}"), &[], body).unwrap();
1198 assert_eq!(route.op, Op::Checks(ChecksOp::CreateCommitStatus));
1199 assert_eq!(input, json!({ "state": "success", "context": "ci/build", "sha": sha, "repo": "acme/web" }));
1200 let (route, input) = resolve("GET", "/repos/acme/web/commits/release%2F1.x/status", &[], Value::Null).unwrap();
1201 assert_eq!(route.op, Op::Checks(ChecksOp::GetCombinedStatus));
1202 assert_eq!(input, json!({ "ref": "release/1.x", "repo": "acme/web" }));
1203 let query = [("check_name".to_owned(), "lint".to_owned())];
1204 let (route, input) = resolve("GET", "/repos/acme/web/commits/main/check-runs", &query, Value::Null).unwrap();
1205 assert_eq!(route.op, Op::Checks(ChecksOp::ListCheckRunsForRef));
1206 assert_eq!(input, json!({ "check_name": "lint", "ref": "main", "repo": "acme/web" }));
1207 let (route, input) = resolve("PATCH", "/repos/acme/web/check-runs/cr_1", &[], json!({ "conclusion": "success" })).unwrap();
1208 assert_eq!(route.op, Op::Checks(ChecksOp::UpdateCheckRun));
1209 assert_eq!(input, json!({ "conclusion": "success", "id": "cr_1", "repo": "acme/web" }));
1210 let op = |method: &str, path: &str| resolve(method, path, &[], Value::Null).unwrap().0.op;
1211 assert_eq!(op("POST", "/repos/acme/web/check-runs"), Op::Checks(ChecksOp::CreateCheckRun));
1212 assert_eq!(op("GET", "/repos/acme/web/check-runs/cr_1/annotations"), Op::Checks(ChecksOp::ListCheckRunAnnotations));
1213 assert_eq!(op("POST", "/repos/acme/web/check-suites/cs_1/rerequest"), Op::Checks(ChecksOp::RerequestCheckSuite));
1214 assert_eq!(op("GET", "/repos/acme/web/commits/main/check-suites"), Op::Checks(ChecksOp::ListCheckSuitesForRef));
1215 }
1216
1217 #[test]
API and MCP server in Rust; a public index at the API root1218 fn query_parameters_are_renamed() {
1219 let query = [
1220 ("q".to_owned(), "parser".to_owned()),
1221 ("x".to_owned(), "y".to_owned()),
1222 ];
Agents as a team: lifecycle, merge queue, billing and a new shell1223 let (route, input) = resolve("GET", "/repos", &query, Value::Null).unwrap();
API and MCP server in Rust; a public index at the API root1224 assert_eq!(route.op, Op::ListRepos);
1225 assert_eq!(input, json!({ "query": "parser" }));
1226 }
1227
1228 #[test]
1229 fn method_and_shape_must_match() {
Agents as a team: lifecycle, merge queue, billing and a new shell1230 assert!(resolve("GET", "/repos/a/b/issues/1/close", &[], Value::Null).is_none());
1231 assert!(resolve("GET", "/repos/a", &[], Value::Null).is_none());
1232 assert!(resolve("GET", "/repos/a/b/issues/1/extra", &[], Value::Null).is_none());
1233 assert!(resolve("GET", "/repos/a/b/", &[], Value::Null).is_some());
API and MCP server in Rust; a public index at the API root1234 }
1235
1236 #[test]
1237 fn every_parameter_and_query_name_is_an_input() {
1238 for route in ROUTES {
1239 let properties = route.op.properties();
1240 for (_, key) in route.query {
1241 assert!(properties.contains_key(*key), "{}: {key}", route.path);
1242 }
1243 for name in route.params() {
1244 let covered = matches!(name, "owner" | "name") && properties.contains_key("repo")
1245 || properties.contains_key(name);
1246 assert!(covered, "{}: {name}", route.path);
1247 }
1248 }
1249 }
1250
1251 #[test]
1252 fn every_operation_has_a_route() {
1253 for op in Op::ALL {
1254 assert!(ROUTES.iter().any(|route| route.op == op), "{}", op.name());
1255 }
1256 }
1257}

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