Open History to see the last commit
1import { SourceControlProviderKind } from "@t3tools/contracts";
2import { assert, it } from "@effect/vitest";
3import * as NodeServices from "@effect/platform-node/NodeServices";
4import * as DateTime from "effect/DateTime";
5import * as Deferred from "effect/Deferred";
6import * as Effect from "effect/Effect";
7import * as Fiber from "effect/Fiber";
8import * as Layer from "effect/Layer";
9import * as Option from "effect/Option";
10import * as PlatformError from "effect/PlatformError";
11import * as PubSub from "effect/PubSub";
12import * as Redacted from "effect/Redacted";
13import * as Stream from "effect/Stream";
14import * as TestClock from "effect/testing/TestClock";
15import { HttpClient } from "effect/http";
16import { ChildProcessSpawner } from "effect/process";
17import {
18 DEFAULT_SERVER_SETTINGS,
19 VcsProcessSpawnError,
20 VcsProcessTimeoutError,
21 VcsRepositoryDetectionError,
22} from "@t3tools/contracts";
23
24import * as ServerSettings from "../serverSettings.ts";
25import * as ServerConfig from "../config.ts";
26import type * as VcsDriver from "../vcs/VcsDriver.ts";
27import * as VcsDriverRegistry from "../vcs/VcsDriverRegistry.ts";
28import * as VcsProcess from "../vcs/VcsProcess.ts";
29import * as AzureDevOpsCli from "@t3tools/source-control-azure-devops/server/AzureDevOpsCli";
30import * as AzureDevOpsPullRequestCli from "@t3tools/source-control-azure-devops/server/AzureDevOpsPullRequestCli";
31import * as BitbucketApi from "@t3tools/source-control-bitbucket/server/BitbucketApi";
32import * as BitbucketPullRequestApi from "@t3tools/source-control-bitbucket/server/BitbucketPullRequestApi";
33import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";
34import * as GitHubRest from "@t3tools/source-control-github/server/GitHubRest";
35import * as GitHubRequestPolicy from "@t3tools/source-control-github/server/GitHubRequestPolicy";
36import * as GitHubPullRequestApi from "@t3tools/source-control-github/server/GitHubPullRequestApi";
37import * as GitHubCredentials from "@t3tools/source-control-github/server/GitHubCredentials";
38import * as GitLabCli from "@t3tools/source-control-gitlab/server/GitLabCli";
39import * as GitLabPullRequestCli from "@t3tools/source-control-gitlab/server/GitLabPullRequestCli";
40import * as ForgejoCli from "@t3tools/source-control-forgejo/server/ForgejoCli";
41import * as GitCafeApi from "@t3tools/source-control-gitcafe/server/GitCafeApi";
42import * as GitCafeCredentials from "@t3tools/source-control-gitcafe/server/GitCafeCredentials";
43import * as SourceControlProviderRegistry from "./SourceControlProviderRegistry.ts";
44import * as ServerSourceControlHost from "./ServerSourceControlHost.ts";
45
46const TEST_EPOCH = DateTime.makeUnsafe("1970-01-01T00:00:00.000Z");
47
48const processOutput = (
49 stdout: string,
50 options?: {
51 readonly stderr?: string;
52 readonly exitCode?: ChildProcessSpawner.ExitCode;
53 },
54): VcsProcess.VcsProcessOutput => ({
55 exitCode: options?.exitCode ?? ChildProcessSpawner.ExitCode(0),
56 stdout,
57 stderr: options?.stderr ?? "",
58 stdoutTruncated: false,
59 stderrTruncated: false,
60});
61
62function makeRegistry(input: {
63 readonly remotes: ReadonlyArray<{
64 readonly name: string;
65 readonly url: string;
66 }>;
67 readonly process?: Partial<VcsProcess.VcsProcess["Service"]>;
68 readonly githubApi?: Partial<GitHubRest.GitHubRest["Service"]>;
69 readonly gitlab?: Partial<GitLabCli.GitLabCli["Service"]>;
70 readonly forgejo?: Partial<ForgejoCli.ForgejoCli["Service"]>;
71 readonly settings?: Partial<ServerSettings.ServerSettingsService["Service"]>;
72 readonly resolve?: VcsDriverRegistry.VcsDriverRegistry["Service"]["resolve"];
73}) {
74 const driver = {
75 listRemotes: () =>
76 Effect.succeed({
77 remotes: input.remotes.map((remote) => ({
78 ...remote,
79 pushUrl: Option.none(),
80 isPrimary: remote.name === "origin",
81 })),
82 freshness: {
83 source: "live-local" as const,
84 observedAt: TEST_EPOCH,
85 expiresAt: Option.none(),
86 },
87 }),
88 } satisfies Partial<VcsDriver.VcsDriver["Service"]>;
89
90 const layerRegistry = Layer.mock(VcsDriverRegistry.VcsDriverRegistry)({
91 get: () => Effect.succeed(driver as unknown as VcsDriver.VcsDriver["Service"]),
92 resolve:
93 input.resolve ??
94 (() =>
95 Effect.succeed({
96 kind: "git",
97 repository: {
98 kind: "git",
99 rootPath: "/repo",
100 metadataPath: null,
101 freshness: {
102 source: "live-local" as const,
103 observedAt: TEST_EPOCH,
104 expiresAt: Option.none(),
105 },
106 },
107 driver: driver as unknown as VcsDriver.VcsDriver["Service"],
108 })),
109 });
110
111 const layerProcess = Layer.mock(VcsProcess.VcsProcess)({
112 run: () => Effect.succeed(processOutput("")),
113 ...input.process,
114 });
115
116 return SourceControlProviderRegistry.make.pipe(
117 Effect.provide(
118 Layer.mergeAll(
119 NodeServices.layer,
120 layerRegistry,
121 layerProcess,
122 ServerSourceControlHost.layer.pipe(
123 Layer.provide(
124 Layer.mergeAll(
125 layerProcess,
126 layerRegistry,
127 ServerSettings.ServerSettingsService.layerTest(),
128 Layer.mock(GitVcsDriver.GitVcsDriver)({}),
129 ),
130 ),
131 ),
132 Layer.mock(AzureDevOpsCli.AzureDevOpsCli)({}),
133 Layer.mock(AzureDevOpsPullRequestCli.AzureDevOpsPullRequestCli)({}),
134 Layer.mock(BitbucketApi.BitbucketApi)({}),
135 Layer.mock(BitbucketPullRequestApi.BitbucketPullRequestApi)({}),
136 input.settings
137 ? Layer.mock(ServerSettings.ServerSettingsService)(input.settings)
138 : ServerSettings.ServerSettingsService.layerTest(),
139 Layer.mock(GitHubPullRequestApi.GitHubPullRequestApi)({}),
140 // The GitHub provider's GraphQL reads go through these; no test here makes one.
141 Layer.mock(GitHubRequestPolicy.GitHubRequestPolicy)({}),
142 Layer.succeed(
143 HttpClient.HttpClient,
144 HttpClient.make(() => Effect.die(new Error("Unexpected GitHub GraphQL read"))),
145 ),
146 Layer.mock(GitHubRest.GitHubRest)({
147 // No GitHub credential unless a test supplies one, so custom hosts stay unclaimed.
148 credential: (host) => Effect.fail(new GitHubCredentials.GitHubNotSignedInError({ host })),
149 ...input.githubApi,
150 }),
151 Layer.mock(GitVcsDriver.GitVcsDriver)({}),
152 Layer.mock(GitLabCli.GitLabCli)(input.gitlab ?? {}),
153 Layer.mock(GitLabPullRequestCli.GitLabPullRequestCli)({}),
154 Layer.mock(ForgejoCli.ForgejoCli)({
155 listLogins: () => Effect.succeed([]),
156 ...input.forgejo,
157 }),
158 Layer.mock(GitCafeApi.GitCafeApi)({}),
159 Layer.mock(GitCafeCredentials.GitCafeCredentials)({
160 cliEnv: () => Effect.succeed({}),
161 }),
162 ServerConfig.layerTest(process.cwd(), {
163 prefix: "t3-source-control-registry-test-",
164 }).pipe(Layer.provide(NodeServices.layer)),
165 ),
166 ),
167 );
168}
169
170it.effect("routes GitHub remotes to the GitHub provider", () =>
171 Effect.gen(function* () {
172 const registry = yield* makeRegistry({
173 remotes: [{ name: "origin", url: "git@github.com:pingdotgg/t3code.git" }],
174 });
175
176 const provider = yield* registry.resolve({ cwd: "/repo" });
177
178 assert.strictEqual(provider.kind, "github");
179 }),
180);
181
182it.effect("routes directly by provider kind for remote-first workflows", () =>
183 Effect.gen(function* () {
184 const registry = yield* makeRegistry({
185 remotes: [],
186 });
187
188 const provider = yield* registry.get(SourceControlProviderKind.make("github"));
189
190 assert.strictEqual(provider.kind, "github");
191 }),
192);
193
194it.effect("includes the request cwd when an unregistered provider is used", () =>
195 Effect.gen(function* () {
196 const registry = yield* makeRegistry({ remotes: [] });
197 const provider = yield* registry.get(SourceControlProviderKind.make("unknown"));
198
199 const error = yield* provider
200 .getChangeRequest({ cwd: "/repo", reference: "#42" })
201 .pipe(Effect.flip);
202
203 assert.strictEqual(error.provider, "unknown");
204 assert.strictEqual(error.operation, "getChangeRequest");
205 assert.strictEqual(error.cwd, "/repo");
206 assert.strictEqual(error.reference, "#42");
207 }),
208);
209
210it.effect("lists no change requests for a repository on an unrecognized host", () =>
211 Effect.gen(function* () {
212 const registry = yield* makeRegistry({
213 remotes: [{ name: "origin", url: "https://git.example.internal/team/repo.git" }],
214 });
215 const provider = yield* registry.resolve({ cwd: "/repo" });
216
217 assert.strictEqual(provider.kind, "unknown");
218 assert.deepStrictEqual(
219 yield* provider.listChangeRequests({ cwd: "/repo", headSelector: "master", state: "all" }),
220 [],
221 );
222 }),
223);
224
225it.effect("retains VCS detection failures with structured cwd context", () =>
226 Effect.gen(function* () {
227 const cause = new VcsRepositoryDetectionError({
228 operation: "resolve",
229 cwd: "/repo",
230 detail: "raw VCS detection failure",
231 cause: new Error("raw nested failure"),
232 });
233 const registry = yield* makeRegistry({
234 remotes: [],
235 resolve: () => Effect.fail(cause),
236 });
237
238 const error = yield* registry.resolve({ cwd: "/repo" }).pipe(Effect.flip);
239
240 assert.strictEqual(error.provider, "unknown");
241 assert.strictEqual(error.operation, "detectProvider");
242 assert.strictEqual(error.cwd, "/repo");
243 assert.strictEqual(error.detail, "Failed to detect source control provider.");
244 assert.strictEqual(error.cause, cause);
245 assert.equal(error.message.includes(cause.message), false);
246 }),
247);
248
249it.effect("routes GitLab remotes to the GitLab provider", () =>
250 Effect.gen(function* () {
251 const registry = yield* makeRegistry({
252 remotes: [{ name: "origin", url: "git@gitlab.com:group/project.git" }],
253 });
254
255 const provider = yield* registry.resolve({ cwd: "/repo" });
256
257 assert.strictEqual(provider.kind, "gitlab");
258 }),
259);
260
261it.effect("routes authenticated self-hosted GitLab remotes without relying on host naming", () =>
262 Effect.gen(function* () {
263 const registry = yield* makeRegistry({
264 remotes: [{ name: "origin", url: "https://self-hosted.example.test/group/project.git" }],
265 process: {
266 run: () =>
267 Effect.succeed(
268 processOutput(
269 `gitlab.com
270 x gitlab.com: API call failed: 401 Unauthorized
271 ! No token found
272self-hosted.example.test
273 ✓ Logged in to self-hosted.example.test as gitlab-user
274 ✓ Token found: ******
275`,
276 { exitCode: ChildProcessSpawner.ExitCode(1) },
277 ),
278 ),
279 },
280 });
281
282 const provider = yield* registry.resolve({ cwd: "/repo" });
283
284 assert.strictEqual(provider.kind, "gitlab");
285 }),
286);
287
288it.effect("refines the caller-selected remote instead of choosing another configured remote", () =>
289 Effect.gen(function* () {
290 const registry = yield* makeRegistry({
291 remotes: [{ name: "origin", url: "git@github.com:fork/project.git" }],
292 process: {
293 run: () =>
294 Effect.succeed(
295 processOutput(`self-hosted.example.test
296 ✓ Logged in to self-hosted.example.test as gitlab-user
297`),
298 ),
299 },
300 });
301
302 const handle = yield* registry.resolveHandle({
303 cwd: "/repo",
304 context: {
305 provider: {
306 kind: SourceControlProviderKind.make("unknown"),
307 name: "self-hosted.example.test",
308 baseUrl: "https://self-hosted.example.test",
309 },
310 remoteName: "upstream",
311 remoteUrl: "https://self-hosted.example.test/group/project.git",
312 },
313 });
314
315 assert.strictEqual(handle.context?.provider.kind, "gitlab");
316 assert.strictEqual(handle.context?.remoteName, "upstream");
317 }),
318);
319
320it.effect("routes authenticated self-hosted GitLab remotes on non-standard ports", () =>
321 Effect.gen(function* () {
322 const registry = yield* makeRegistry({
323 remotes: [{ name: "origin", url: "https://self-hosted.example.test:8443/group/project.git" }],
324 process: {
325 run: () =>
326 Effect.succeed(
327 processOutput(
328 `self-hosted.example.test:8443
329 ✓ Logged in to self-hosted.example.test:8443 as gitlab-user
330 ✓ Token found: ******
331`,
332 ),
333 ),
334 },
335 });
336
337 const provider = yield* registry.resolve({ cwd: "/repo" });
338
339 assert.strictEqual(provider.kind, "gitlab");
340 }),
341);
342
343it.effect("routes Bitbucket remotes to the Bitbucket provider", () =>
344 Effect.gen(function* () {
345 const registry = yield* makeRegistry({
346 remotes: [{ name: "origin", url: "git@bitbucket.org:pingdotgg/t3code.git" }],
347 });
348
349 const provider = yield* registry.resolve({ cwd: "/repo" });
350
351 assert.strictEqual(provider.kind, "bitbucket");
352 }),
353);
354
355it.effect("routes Azure DevOps remotes to the Azure DevOps provider", () =>
356 Effect.gen(function* () {
357 const registry = yield* makeRegistry({
358 remotes: [{ name: "origin", url: "https://dev.azure.com/acme/project/_git/repo" }],
359 });
360
361 const provider = yield* registry.resolve({ cwd: "/repo" });
362
363 assert.strictEqual(provider.kind, "azure-devops");
364 }),
365);
366
367it.effect("falls back to a non-origin remote when origin is not configured", () =>
368 Effect.gen(function* () {
369 const registry = yield* makeRegistry({
370 remotes: [{ name: "upstream", url: "https://dev.azure.com/acme/project/_git/repo" }],
371 });
372
373 const provider = yield* registry.resolve({ cwd: "/repo" });
374
375 assert.strictEqual(provider.kind, "azure-devops");
376 }),
377);
378
379it.effect(
380 "routes linked subjects by URL independently of the checkout and skips unsupported links",
381 () =>
382 Effect.gen(function* () {
383 const registry = yield* makeRegistry({
384 remotes: [{ name: "origin", url: "https://github.com/unrelated/checkout.git" }],
385 githubApi: {
386 rest: () =>
387 Effect.succeed({
388 status: 200,
389 headers: {},
390 body: JSON.stringify({ title: "GitHub issue", body: null }),
391 truncated: false,
392 invalidUtf8: false,
393 }),
394 },
395 gitlab: {
396 execute: () =>
397 Effect.succeed(
398 processOutput(JSON.stringify({ title: "GitLab MR", description: "Nested project" })),
399 ),
400 },
401 });
402 for (const [url, expected] of [
403 ["https://github.com/team/project/issues/1", { title: "GitHub issue", body: null }],
404 [
405 "https://gitlab.com/team/sub/project/-/merge_requests/2",
406 { title: "GitLab MR", body: "Nested project" },
407 ],
408 ] as const) {
409 const lookup = registry.resolveLink({ cwd: "/unrelated", url: new URL(url) });
410 assert.ok(lookup);
411 assert.deepStrictEqual(yield* lookup, expected);
412 }
413 for (const url of [
414 "https://example.test/team/project/issues/1",
415 "https://github.attacker.test/team/project/issues/1",
416 "https://gitlab.attacker.test/team/project/-/issues/1",
417 "https://github.com/team/project",
418 "https://codeberg.org/team/project/issues/1",
419 "https://bitbucket.org/team/project/pull-requests/1",
420 "https://dev.azure.com/org/project/_git/repo/pullrequest/1",
421 "http://github.com/team/project/issues/1",
422 "https://user:secret@github.com/team/project/issues/1",
423 ]) {
424 assert.strictEqual(
425 registry.resolveLink({ cwd: "/unrelated", url: new URL(url) }),
426 undefined,
427 );
428 }
429 }).pipe(Effect.scoped),
430);
431
432it.effect.each([
433 { name: "a credential", credential: "found", expected: "github" },
434 { name: "a host turned off in Settings", credential: "disabled", expected: "github" },
435 { name: "no credential", credential: "missing", expected: "unknown" },
436] as const)("resolves custom-host remotes with $name", (scenario) =>
437 Effect.gen(function* () {
438 const hosts: Array<string> = [];
439 const commands: Array<string> = [];
440 const registry = yield* makeRegistry({
441 remotes: [{ name: "origin", url: "git@code.example.test:team/project.git" }],
442 process: {
443 run: ({ command }) => {
444 commands.push(command);
445 return Effect.succeed(processOutput(""));
446 },
447 },
448 githubApi: {
449 credential: (host) => {
450 hosts.push(host);
451 return scenario.credential === "found"
452 ? Effect.succeed({ token: Redacted.make("token"), fingerprint: `${host}:fingerprint` })
453 : scenario.credential === "disabled"
454 ? Effect.fail(new GitHubCredentials.GitHubHostDisabledError({ host }))
455 : Effect.fail(new GitHubCredentials.GitHubNotSignedInError({ host }));
456 },
457 },
458 });
459 const handle = yield* registry.resolveHandle({ cwd: "/repo" });
460 assert.strictEqual(handle.provider.kind, SourceControlProviderKind.make(scenario.expected));
461 assert.strictEqual(handle.context?.provider.baseUrl, "https://code.example.test");
462 assert.deepStrictEqual(hosts, ["code.example.test"]);
463 assert.notInclude(commands, "gh");
464 }),
465);
466
467it.effect("skips GitHub discovery for the identity resolver's empty base URL", () =>
468 Effect.gen(function* () {
469 const hosts: string[] = [];
470 const remoteUrl = "git@githubenterprise.dev.example.com:team/workspace.git";
471 const registry = yield* makeRegistry({
472 remotes: [{ name: "origin", url: remoteUrl }],
473 githubApi: {
474 credential: (host) => {
475 hosts.push(host);
476 return Effect.succeed({
477 token: Redacted.make("token"),
478 fingerprint: `${host}:fingerprint`,
479 });
480 },
481 },
482 });
483 const context = {
484 provider: { kind: SourceControlProviderKind.make("unknown"), name: "Unknown", baseUrl: "" },
485 remoteName: "origin",
486 remoteUrl,
487 };
488 const unresolved = yield* registry.resolveHandle({ cwd: "/repo", context });
489 assert.deepStrictEqual(unresolved.context, context);
490 assert.deepStrictEqual(hosts, []);
491
492 const resolved = yield* registry.resolveHandle({ cwd: "/repo" });
493 assert.strictEqual(resolved.provider.kind, "github");
494 assert.strictEqual(
495 resolved.context?.provider.baseUrl,
496 "https://githubenterprise.dev.example.com",
497 );
498 assert.deepStrictEqual(hosts, ["githubenterprise.dev.example.com"]);
499 }),
500);
501
502const notFound = (command: string, cwd: string) =>
503 new VcsProcessSpawnError({
504 operation: "test",
505 command,
506 cwd,
507 cause: PlatformError.systemError({ _tag: "NotFound", module: "ChildProcess", method: "spawn" }),
508 });
509
510const resolveUnknown = (
511 registry: SourceControlProviderRegistry.SourceControlProviderRegistry["Service"],
512 repository: string,
513) =>
514 registry.resolveHandle({
515 cwd: `/${repository}`,
516 context: {
517 provider: {
518 kind: SourceControlProviderKind.make("unknown"),
519 name: "git.example.internal",
520 baseUrl: "https://git.example.internal",
521 },
522 remoteName: "origin",
523 remoteUrl: `git@Git.Example.Internal:team/${repository}.git`,
524 },
525 });
526
527it.effect("asks once for every checkout of a server no integration claims", () =>
528 Effect.gen(function* () {
529 const asked: Array<string> = [];
530 const release = yield* Deferred.make<void>();
531 const registry = yield* makeRegistry({
532 remotes: [],
533 process: {
534 run: ({ command, args, cwd }) => {
535 asked.push([command, ...args].join(" "));
536 return Deferred.await(release).pipe(Effect.andThen(Effect.fail(notFound(command, cwd))));
537 },
538 },
539 githubApi: {
540 credential: (host) => {
541 asked.push(`credential ${host}`);
542 return Effect.fail(new GitHubCredentials.GitHubNotSignedInError({ host }));
543 },
544 },
545 forgejo: {
546 listLogins: ({ command = "tea", cwd }) => {
547 asked.push(command);
548 const cause = notFound(command, cwd);
549 return Effect.fail(new ForgejoCli.ForgejoCliError({ command, cwd, detail: "", cause }));
550 },
551 },
552 });
553
554 const started = yield* Effect.forEach(["a", "b", "c"], () => Deferred.make<void>());
555 const callers = yield* Effect.forEach(
556 ["a", "b", "c"],
557 (repository, index) =>
558 Deferred.succeed(started[index]!, undefined).pipe(
559 Effect.andThen(resolveUnknown(registry, repository)),
560 ),
561 { concurrency: "unbounded" },
562 ).pipe(Effect.forkChild);
563 yield* Effect.forEach(started, Deferred.await);
564 yield* Deferred.succeed(release, undefined);
565 const handles = yield* Fiber.join(callers);
566 yield* resolveUnknown(registry, "d");
567 assert.deepStrictEqual(
568 handles.map((handle) => handle.provider.kind),
569 ["unknown", "unknown", "unknown"],
570 );
571 const once = asked.slice();
572 assert.sameMembers(once, [
573 "credential git.example.internal",
574 "glab auth status --hostname Git.Example.Internal",
575 "fj",
576 "tea",
577 ]);
578
579 yield* TestClock.adjust("5 minutes");
580 yield* resolveUnknown(registry, "a");
581 assert.deepStrictEqual(asked, [...once, ...once]);
582 }),
583);
584
585it.effect("asks again after a check that could not answer", () =>
586 Effect.gen(function* () {
587 let asks = 0;
588 const registry = yield* makeRegistry({
589 remotes: [],
590 process: {
591 run: ({ command, cwd }) => {
592 asks += 1;
593 return Effect.fail(
594 new VcsProcessTimeoutError({ operation: "test", command, cwd, timeoutMs: 1 }),
595 );
596 },
597 },
598 });
599 yield* resolveUnknown(registry, "a");
600 yield* resolveUnknown(registry, "b");
601 assert.strictEqual(asks, 2);
602 }),
603);
604
605it.effect("asks again once Settings change", () =>
606 Effect.gen(function* () {
607 const changes = yield* PubSub.unbounded<typeof DEFAULT_SERVER_SETTINGS>();
608 const handled = yield* Deferred.make<void>();
609 let signedIn = false;
610 const registry = yield* makeRegistry({
611 remotes: [],
612 settings: {
613 subscribeChanges: PubSub.subscribe(changes).pipe(
614 Effect.map((subscription) =>
615 Stream.fromSubscription(subscription).pipe(
616 Stream.flatMap((settings) =>
617 Stream.concat(
618 Stream.make(settings),
619 Stream.fromEffectDrain(Deferred.succeed(handled, undefined)),
620 ),
621 ),
622 ),
623 ),
624 ),
625 },
626 process: { run: ({ command, cwd }) => Effect.fail(notFound(command, cwd)) },
627 githubApi: {
628 credential: (host) =>
629 signedIn
630 ? Effect.succeed({ token: Redacted.make("token"), fingerprint: `${host}:fingerprint` })
631 : Effect.fail(new GitHubCredentials.GitHubNotSignedInError({ host })),
632 },
633 });
634 assert.strictEqual((yield* resolveUnknown(registry, "a")).provider.kind, "unknown");
635 signedIn = true;
636 assert.strictEqual((yield* resolveUnknown(registry, "b")).provider.kind, "unknown");
637
638 yield* PubSub.publish(changes, DEFAULT_SERVER_SETTINGS);
639 yield* Deferred.await(handled);
640 assert.strictEqual((yield* resolveUnknown(registry, "c")).provider.kind, "github");
641 }),
642);