Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(forgejo): a pull request watch passes once the required checks pass #18775

MergedMnigos(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/18775/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 44 additions and 19 deletions (loading 2).

x
0 of 3 viewed, 3 left
44 additions and 19 deletionspackages/source-control-forgejo/src/server/ForgejoPullRequestProvider.tsModified
View file
@@ -33,8 +33,11 @@
forgejoChecks,
forgejoReactions,
} from "./forgejoPullRequestJson.ts";
+import { ForgejoBranchStatusChecks, markRequiredForgejoChecks } from "./forgejoRequiredChecks.ts";
import { definition } from "../client/definition.ts";
​
+const isForgejoCliError = Schema.is(ForgejoCli.ForgejoCliError);
+​
const CAPABILITIES: PullRequestCapabilities = {
diff: true,
viewedFiles: "environment",
@@ -202,6 +205,44 @@
return permissions(repo, pr, viewer);
});
+ const readChecks = Effect.fn("ForgejoPullRequestProvider.readChecks")(function* (
+ input: ProviderRepositoryRef,
+ pr: typeof ForgejoPullRequest.Type,
+ ) {
+ const branch = read(
+ {
+ ...input,
+ path: `${repoPath(input)}/branches/${pr.base.ref.split("/").map(encodeURIComponent).join("/")}`,
+ },
+ ForgejoBranchStatusChecks,
+ ).pipe(
+ Effect.catchTags({
+ PullRequestProviderError: (error) => {