feat(server): agents can watch a PR and get woken when checks, reviews, or conflicts need them (#15057)
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
e8545b293b
commit
18b21325c3
31 files changed
+1531
-39
No files matched your search
@@ -26,6 +26,7 @@ import {
|
||||
decodeWorkflowRunApprovalsJson,
|
||||
reviewThreadConversation,
|
||||
REVIEW_THREADS_GRAPHQL_QUERY,
|
||||
pullRequestCoreGraphQlQuery,
|
||||
pullRequestSearchGraphQlQuery,
|
||||
} from "./gitHubPullRequestJson.ts";
|
||||
|
||||
@@ -285,6 +286,25 @@ describe("pull request detail decoding", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("keeps what branch protection requires, and asks for it on github.com only", () => {
|
||||
const raw = JSON.parse(detailJson) as Record<string, unknown>;
|
||||
const detail = expectSuccess(
|
||||
decodePullRequestDetailJson(
|
||||
JSON.stringify({
|
||||
...raw,
|
||||
statusCheckRollup: [
|
||||
{ __typename: "CheckRun", name: "test", status: "IN_PROGRESS", isRequired: true },
|
||||
{ __typename: "StatusContext", context: "bot", state: "PENDING", isRequired: false },
|
||||
{ __typename: "StatusContext", context: "legacy", state: "SUCCESS" },
|
||||
],
|
||||
}),
|
||||
),
|
||||
);
|
||||
expect(detail.checks.map((check) => check.required)).toEqual([true, false, undefined]);
|
||||
expect(pullRequestCoreGraphQlQuery("github.com")).toContain("isRequired");
|
||||
expect(pullRequestCoreGraphQlQuery("github.example.com")).not.toContain("isRequired");
|
||||
});
|
||||
|
||||
it("keeps a workflow waiting for approval out of the passing state", () => {
|
||||
const raw = JSON.parse(detailJson) as Record<string, unknown>;
|
||||
const detail = expectSuccess(
|
||||
|
||||
Reference in new issue
Block a user