Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): sync linked PR status on hosts without the stacks API #14460

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

Showing 2 changed files with 43 additions and 1 deletion.

x
0 of 2 viewed, 2 left
39 additions and 0 deletionsapps/server/src/vcs/VcsProcess.test.tsModified
View file
@@ -414,6 +414,45 @@
}).pipe(provideLive),
​
+ it.effect("classifies a gh HTTP 404 as not found without retaining stderr", () =>
+ Effect.gen(function* () {
+ // What `gh api` prints when the host does not serve an endpoint, such as the stacks
+ // preview on a GitHub Enterprise Server release.
+ const providerStderr = 'gh: Not Found (HTTP 404)\n{"message":"Not Found","status":"404"}';
+ const error = yield* VcsProcess.make.pipe(
+ Effect.provideService(
+ ProcessRunner.ProcessRunner,
+ ProcessRunner.ProcessRunner.of({
+ run: () =>
+ Effect.succeed({
+ stdout: "",
+ stderr: providerStderr,
+ code: ChildProcessSpawner.ExitCode(1),
+ timedOut: false,
+ stdoutTruncated: false,
+ stderrTruncated: false,
+ stdoutInvalidUtf8: false,
+ stderrInvalidUtf8: false,
+ }),
+ }),
+ ),
+ Effect.flatMap((service) =>
+ service.run({
+ operation: "test.not-found",
+ command: "gh",