Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(server): pull requests talk to GitHub's API instead of the gh CLI #16320

Mergedjuliusmarmingemerged 11 commits intot3code/github-api-transport fromrefs/pull/16320/headmerged by juliusmarminge View on GitHub

Showing 15 changed files with 50 additions and 67 deletions (loading 14).

x
0 of 15 viewed, 15 left
50 additions and 67 deletionsapps/server/scripts/measure-pr-preview.tsModified
View file
@@ -1,18 +1,21 @@
// Run with: node apps/server/scripts/measure-pr-preview.ts owner/repo 123 456
// Numbers form a session with shared repository-permission caches. Browser and
// service caches are excluded. Uses real GitHub reads, without a server or database.
-// CLI-generated GraphQL
-// queries are replayed with rateLimit.cost, outside the timed section, to measure
-// their cost without confusing other applications' traffic with this process's.
+// Every GraphQL read carries `rateLimit`, so its cost is read off its own answer.
import * as NodeServices from "@effect/platform-node/NodeServices";
import * as Effect from "effect/Effect";
import * as Console from "effect/Console";
import * as Layer from "effect/Layer";
+import * as Option from "effect/Option";
import * as Schema from "effect/Schema";
+import { FetchHttpClient } from "effect/http";
​
import * as GitHubPullRequestCli from "../src/pullRequest/GitHubPullRequestCli.ts";
import * as GitHubPullRequestProvider from "../src/pullRequest/GitHubPullRequestProvider.ts";
-import * as GitHubCli from "../src/sourceControl/GitHubCli.ts";
+import * as GitHubApi from "../src/sourceControl/GitHubApi.ts";
+import * as GitHubCredentials from "../src/sourceControl/GitHubCredentials.ts";
+import * as GitHubGraphQlBudget from "../src/sourceControl/githubGraphQlBudget.ts";
+import * as SourceControlRateLimit from "../src/sourceControl/SourceControlRateLimit.ts";
import * as VcsProcess from "../src/vcs/VcsProcess.ts";
​
const [repository, ...numbers] = process.argv.slice(2);
@@ -20,77 +23,58 @@
throw new Error("Usage: node apps/server/scripts/measure-pr-preview.ts owner/repo number...");
​