Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): load merge request diffs on older GitLab #15886

Mergedaravhawk(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/15886/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 205 additions and 0 deletions (loading 2).

x
0 of 3 viewed, 3 left
205 additions and 0 deletionspackages/source-control-gitlab/src/server/GitLabPullRequestCli.legacy.test.tsAdded
View file
@@ -0,0 +1,205 @@
+import { afterEach, assert, expect, it, vi } from "@effect/vitest";
+import * as Effect from "effect/Effect";
+import * as Layer from "effect/Layer";
+import { ChildProcessSpawner } from "effect/process";
+import { VcsProcessExitError } from "@t3tools/contracts";
+​
+import type * as SourceControlHost from "@t3tools/source-control-core/server/SourceControlHost";
+import * as TestSourceControlHost from "@t3tools/source-control-testing/TestSourceControlHost";
+import * as GitLabCli from "./GitLabCli.ts";
+import * as GitLabPullRequestCli from "./GitLabPullRequestCli.ts";
+​
+const run = vi.fn<SourceControlHost.SourceControlHost["Service"]["process"]["run"]>();
+const layer = it.layer(
+ GitLabPullRequestCli.layer.pipe(
+ Layer.provide(GitLabCli.layer),
+ Layer.provide(TestSourceControlHost.layer({ process: { run } })),
+ ),
+);
+const input = { cwd: "/repo", repository: "acme/nested/web", number: 7 };
+const file = {
+ old_path: "src/old.ts",
+ new_path: "src/new.ts",
+ renamed_file: true,
+ new_file: false,
+ deleted_file: false,
+ a_mode: "100644",
+ b_mode: "100644",
+ diff: "@@ -1 +1 @@\n-before\n+after\n",
+};
+/** Supplies JSON at the process boundary while retaining the real CLI adapter and decoder. */