Add remote repository publish and discovery support (#2482)
Co-authored-by: codex <[email protected]> Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
This commit is contained in:
33 files changed
+2502
-157
No files matched your search
@@ -175,7 +175,7 @@ layer("GitLabCli.layer", (it) => {
|
||||
|
||||
assert.deepStrictEqual(result, {
|
||||
nameWithOwner: "octocat/t3code",
|
||||
url: "https://gitlab.com/octocat/t3code.git",
|
||||
url: "https://gitlab.com/octocat/t3code",
|
||||
sshUrl: "[email protected]:octocat/t3code.git",
|
||||
});
|
||||
}),
|
||||
@@ -217,6 +217,67 @@ layer("GitLabCli.layer", (it) => {
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("creates repositories under an explicit namespace", () =>
|
||||
Effect.gen(function* () {
|
||||
mockedRun
|
||||
.mockReturnValueOnce(Effect.succeed(processOutput(JSON.stringify({ id: 1234 }))))
|
||||
.mockReturnValueOnce(
|
||||
Effect.succeed(
|
||||
processOutput(
|
||||
JSON.stringify({
|
||||
path_with_namespace: "octocat/t3code",
|
||||
web_url: "https://gitlab.com/octocat/t3code",
|
||||
http_url_to_repo: "https://gitlab.com/octocat/t3code.git",
|
||||
ssh_url_to_repo: "[email protected]:octocat/t3code.git",
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
const glab = yield* GitLabCli.GitLabCli;
|
||||
const result = yield* glab.createRepository({
|
||||
cwd: "/repo",
|
||||
repository: "octocat/t3code",
|
||||
visibility: "public",
|
||||
});
|
||||
|
||||
assert.deepStrictEqual(result, {
|
||||
nameWithOwner: "octocat/t3code",
|
||||
url: "https://gitlab.com/octocat/t3code",
|
||||
sshUrl: "[email protected]:octocat/t3code.git",
|
||||
});
|
||||
expect(mockedRun).toHaveBeenNthCalledWith(
|
||||
1,
|
||||
expect.objectContaining({
|
||||
command: "glab",
|
||||
cwd: "/repo",
|
||||
args: ["api", "namespaces/octocat"],
|
||||
}),
|
||||
);
|
||||
expect(mockedRun).toHaveBeenNthCalledWith(
|
||||
2,
|
||||
expect.objectContaining({
|
||||
command: "glab",
|
||||
cwd: "/repo",
|
||||
args: [
|
||||
"api",
|
||||
"--method",
|
||||
"POST",
|
||||
"projects",
|
||||
"--raw-field",
|
||||
"path=t3code",
|
||||
"--raw-field",
|
||||
"name=t3code",
|
||||
"--raw-field",
|
||||
"visibility=public",
|
||||
"--raw-field",
|
||||
"namespace_id=1234",
|
||||
],
|
||||
}),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("does not pass unsupported force flags when checking out merge requests", () =>
|
||||
Effect.gen(function* () {
|
||||
mockedRun.mockReturnValueOnce(Effect.succeed(processOutput("")));
|
||||
|
||||
Reference in new issue
Block a user