Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a PR watch the host refuses to show ends at once and says why #21636

Closedshredderts2000(GitHub profile, opens in a new tab)wants to merge 7 commits intomain fromrefs/pull/21636/headopened View on GitHub

Showing 5 changed files with 193 additions and 12 deletions (loading 2).

x
0 of 5 viewed, 5 left
45 additions and 11 deletionsapps/server/src/orchestration-v2/PullRequestWatchReactor.tsModified
View file
@@ -59,6 +59,22 @@
: null,
});
​
+// GitHub also uses not-found when the credential cannot see a private repository.
+const lastingFailure = (cause: Cause.Cause<PullRequestService.PullRequestError>) =>
+ Option.match(Cause.findErrorOption(cause), {
+ onNone: () => null,
+ onSome: (error) =>
+ error._tag === "PullRequestUnavailableError" ||
+ (error._tag === "PullRequestOperationError" && error.reason === "not-found")
+ ? {
+ message: error.message,
+ unsupported:
+ error._tag === "PullRequestUnavailableError" &&
+ error.reason === "provider-unsupported",
+ }
+ : null,
+ });
+​
const logFailure =
(message: string, fields: Record<string, unknown>) =>
<E>(cause: Cause.Cause<E>): Effect.Effect<void> =>
@@ -291,9 +307,14 @@
});
});
​
- const giveUp = (target: WatchTarget) =>
+ const giveUp = (target: WatchTarget, lasting: ReturnType<typeof lastingFailure>) =>