Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: show GitHub's reason when it refuses a pull request review #13293

Closedagomesp(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/13293/headopened View on GitHub

Showing 6 changed files with 131 additions and 2 deletions (loading 3).

x
0 of 6 viewed, 6 left
20 additions and 0 deletionsapps/server/src/sourceControl/GitHubCli.test.tsModified
View file
@@ -264,6 +264,26 @@
assert.notProperty(commandFailure, "operation");
});
​
+ it("names GitHub's own reason when a gh command was refused", () => {
+ const context = { command: "gh", cwd: "/repo" } as const;
+ const exit = (hostMessage?: string) =>
+ new VcsProcessExitError({
+ operation: "GitHubCli.execute",
+ command: "gh",
+ cwd: context.cwd,
+ exitCode: 1,
+ detail: "Process exited with a non-zero status.",
+ failureKind: "command-failed",
+ ...(hostMessage === undefined ? {} : { hostMessage }),
+ });
+​
+ assert.equal(
+ GitHubCli.fromVcsError(context, exit("Line could not be resolved")).detail,
+ "Line could not be resolved",
+ );
+ assert.equal(GitHubCli.fromVcsError(context, exit()).detail, "GitHub CLI command failed.");
+ });
+​
it.effect("parses pull request view output", () =>
Effect.gen(function* () {
mockRun.mockReturnValueOnce(
5 additions and 1 deletionapps/server/src/sourceControl/GitHubCli.tsModified
View file