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