[codex] Enrich source-control errors (#3248)
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
569b3e5959
commit
630df6b986
20 files changed
+1086
-341
No files matched your search
@@ -52,6 +52,50 @@ it.effect("maps GitLab MR summaries into provider-neutral change requests", () =
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("adds repository context while retaining GitLab CLI causes", () =>
|
||||
Effect.gen(function* () {
|
||||
const cause = new GitLabCli.GitLabCliError({
|
||||
operation: "execute",
|
||||
command: "glab",
|
||||
cwd: "/repo",
|
||||
detail: "GitLab CLI command failed.",
|
||||
cause: new Error("raw upstream detail that should remain in the cause"),
|
||||
});
|
||||
const provider = yield* makeProvider({
|
||||
createRepository: () => Effect.fail(cause),
|
||||
});
|
||||
|
||||
const error = yield* provider
|
||||
.createRepository({
|
||||
cwd: "/repo",
|
||||
repository: "owner/repo",
|
||||
visibility: "private",
|
||||
})
|
||||
.pipe(Effect.flip);
|
||||
|
||||
assert.deepStrictEqual(
|
||||
{
|
||||
provider: error.provider,
|
||||
operation: error.operation,
|
||||
command: error.command,
|
||||
cwd: error.cwd,
|
||||
repository: error.repository,
|
||||
detail: error.detail,
|
||||
},
|
||||
{
|
||||
provider: "gitlab",
|
||||
operation: "createRepository",
|
||||
command: "glab",
|
||||
cwd: "/repo",
|
||||
repository: "owner/repo",
|
||||
detail: "GitLab CLI command failed.",
|
||||
},
|
||||
);
|
||||
assert.strictEqual(error.cause, cause);
|
||||
assert.equal(error.message.includes("raw upstream detail"), false);
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("lists GitLab MRs through provider-neutral input names", () =>
|
||||
Effect.gen(function* () {
|
||||
let listInput: Parameters<GitLabCli.GitLabCli["Service"]["listMergeRequests"]>[0] | null = null;
|
||||
|
||||
Reference in new issue
Block a user