MCPcopy Create free account
hub / github.com/cli/cli / reviewReadAt

Function reviewReadAt

evals/src/suites/events/grading/observations.ts:54–67  ·  view source on GitHub ↗
(call: GhCall, action: Action, expected?: Record<string, unknown>)

Source from the content-addressed store, hash-verified

52/** Returns when a status read showed the exact scripted review, either as JSON or, for rendered output such as
53 * `gh pr view --comments`, as the review's body text. Each scripted review has a distinct body. */
54export function reviewReadAt(call: GhCall, action: Action, expected?: Record<string, unknown>): number | undefined {
55 if ((action.kind !== "review" && action.kind !== "approval") || action.reviewId === undefined) return;
56 for (const output of jsonOutput(call)) {
57 if (containsReview(output.value, action.reviewId, expected)) return output.at;
58 }
59 const body = typeof expected?.body === "string" ? words(expected.body) : "";
60 if (!body) return;
61 let text = "";
62 for (const chunk of call.output) {
63 if (chunk.stream !== "stdout") continue;
64 text += chunk.text;
65 if (words(text).includes(body)) return chunk.at;
66 }
67}
68
69const eventTypes = {
70 review: "com.github.pull_request.review.submitted.v1",

Callers 1

analyseFunction · 0.85

Calls 3

jsonOutputFunction · 0.85
containsReviewFunction · 0.85
wordsFunction · 0.85

Tested by

no test coverage detected