Public: anyone can read this; the crew can change it.
A changes-requested review with only a body is invisible: the pull's API, its reviews list and a repeat review request all say nothing #18184
Merged 14h 9m ago, live in production
torque/forge:torque/18181-a-changes-requested-review-with-only-a-b → main 0 commits fork 3 threads · 3 unresolved
21 files
changed +286
−59
- docs/features/flow-waiting.md
- docs/features/review-requests.md
- src/actions/review_requests.ts
- src/contract/openapi/routes/getApiV1ReposOwnerNamePullsNumberReviews.ts
- src/contract/openapi/schemas/pull.ts
- src/core/changes_words.ts
- src/core/landing.ts
- src/core/review_list.ts
- src/flow/next_actor.ts
- src/flow/pull_pane.ts
- src/http/api/pulls.ts
- src/http/mcp/tools/request_review.ts
- src/tui/screens/pull.ts
- src/web/studio/actions.ts
- test/api-reader-marks.test.ts
- test/next_actor.test.ts
- test/parity.test.ts
- test/pull-pane.test.ts
- test/pull-waits-for.test.ts
- test/review-request.test.ts
- test/reviews-states.test.ts
docs/features/flow-waiting.md +1 −1
| @@ -24,7 +24,7 @@ Each stalled row carries one form button, never a silent wait: an approved pull | ||
| 24 | 24 | |
| 25 | 25 | A pull whose check on its head has been green for more than six hours and that has not landed says, in one line, what it waits for and the one thing that unblocks it: "Green for 30 hours, not landed: it waits for review. To unblock: a reviewer reviews it on its current head." |
| 26 | 26 | |
| 27 | The cause is the first that holds: a hold, a conflict with the base, a chapter, then whoever acts next (a person, the builder after changes were asked, a reviewer, the landing queue). `waitsFor` in `src/core/landing.ts` words it; `pullWaitsFor` in `src/flow/waits_for.ts` reads the facts. | |
| 27 | The cause is the first that holds: a hold, a conflict with the base, a chapter, then whoever acts next (a person, the builder, said as the Next line says it, "waits on its author: changes requested", a reviewer, the landing queue). `waitsFor` in `src/core/landing.ts` words it; `pullWaitsFor` in `src/flow/waits_for.ts` reads the facts. | |
| 28 | 28 | |
| 29 | 29 | Where it shows: |
| 30 | 30 |
docs/features/review-requests.md +3 −1
| @@ -6,4 +6,6 @@ row: Ask the crew to review a person's pull | ||
| 6 | 6 | |
| 7 | 7 | The crew reviews its own agents' pulls on its own; a person's pull is reviewed once asked. `POST /api/v1/repos/:owner/:name/pulls/:number/review-requests` with `{"reviewer": "<agent>"}` (optional; without it, the reviewer with the fewest queued or running runs), the "Ask the crew to review" button on the pull page, or an `@mention` of a crew reviewer in a pull comment by a person who writes the repository. The ask is one row (`review_request`); from it the review runs like an agent pull's (same rounds, verdicts and lapse, the clock starting at the ask), and an approval on the head lets `landIfGreen` land it. |
| 8 | 8 | |
| 9 | From the terminal, press `K` on a pull's screen (a reviewer's username, or empty for the least busy). Over MCP, `request_review {app, pull, reviewer?}` plans by default and asks with `dryRun: false`. Without a name the least busy reviewer is chosen and kept, so every door answers with who was asked. A later mention of the reviewer already asked does not ask again or restart the clock. An agent cannot ask, and a held pull is not reviewed. An app whose reviews are off lands a green pull without one, asked or not. | |
| 9 | From the terminal, press `K` on a pull's screen (a reviewer's username, or empty for the least busy). Over MCP, `request_review {app, pull, reviewer?}` asks; `dryRun: true` only plans. Without a name the least busy reviewer is chosen and kept, so every door answers with who was asked. A later mention of the reviewer already asked does not ask again or restart the clock. An agent cannot ask, and a held pull is not reviewed. An app whose reviews are off lands a green pull without one, asked or not. | |
| 10 | ||
| 11 | A head that already has a changes-requested review is not asked again (#18181): every door answers "already reviewed: changes requested by <who> at <time>", the review's first lines, and "Push a change, then ask again."; the API answers 409 `already_reviewed` with the review. A pull's API answer carries `latestReview` (state, reviewer, `at`, body, `current`) and `changesRequested` (the review asking for changes on the head, else null); `GET …/pulls/:n/reviews` lists reviews, body-only ones too, each with its line `comments` (`src/core/review_list.ts` shapes both). The shape changed: `/reviews` was a flat comment list and is now reviews with nested comments. A line comment carries no review id, so it is grouped under a review by author, commit and nearest time: a heuristic, not a link. The pull's Next line reads "waits on its author: changes requested". |
src/actions/review_requests.ts +17
| @@ -13,6 +13,7 @@ import type { Agent } from "../core/agents.ts"; | ||
| 13 | 13 | import { getHold } from "../core/holds.ts"; |
| 14 | 14 | import { setReviewRequest, type ReviewRequest } from "../core/review_requests.ts"; |
| 15 | 15 | import type { Pull } from "../core/pulls.ts"; |
| 16 | import { changesBrief, firstLines, type ReviewBrief } from "../core/review_list.ts"; | |
| 16 | 17 | import { canRead, canWrite, type Repo } from "../core/repos.ts"; |
| 17 | 18 | import type { User } from "../core/users.ts"; |
| 18 | 19 | import { createLog } from "../kernel/log.ts"; |
| @@ -27,6 +28,7 @@ export type ReviewRequestError = | ||
| 27 | 28 | | "not_open" |
| 28 | 29 | | "agent_pull" |
| 29 | 30 | | "held" |
| 31 | | "already_reviewed" | |
| 30 | 32 | | "no_reviewer" |
| 31 | 33 | | "not_reviewer"; |
| 32 | 34 | |
| @@ -56,6 +58,7 @@ export function requestReview( | ||
| 56 | 58 | if (pull.state !== "open" || pull.mergedAt !== null) return err("not_open"); |
| 57 | 59 | if (pull.authorIsAgent) return err("agent_pull"); |
| 58 | 60 | if (getHold(app.db, pull.id) !== undefined) return err("held"); |
| 61 | if (reviewedAlready(app, pull) !== null) return err("already_reviewed"); | |
| 59 | 62 | const crew = reviewersOf(app.db, repo.id); |
| 60 | 63 | if (crew.length === 0) return err("no_reviewer"); |
| 61 | 64 | let named: Agent | undefined; |
| @@ -83,6 +86,20 @@ export function requestReview( | ||
| 83 | 86 | return ok({ request, reviewer: chosen.user.username }); |
| 84 | 87 | } |
| 85 | 88 | |
| 89 | /** | |
| 90 | * The review that already asks for changes on this pull's head, or null (#18181): a head with one | |
| 91 | * is not reviewed again until something is pushed. | |
| 92 | */ | |
| 93 | export function reviewedAlready(app: App, pull: Pull): ReviewBrief | null { | |
| 94 | return changesBrief(app.db, pull.id, pull.headOid); | |
| 95 | } | |
| 96 | ||
| 97 | /** The refusal's words: the state, when, who, the first lines, and what to do. */ | |
| 98 | export function alreadyReviewedWords(r: ReviewBrief): string { | |
| 99 | const said = firstLines(r.body); | |
| 100 | return `already reviewed: changes requested by ${r.reviewer} at ${r.at.slice(0, 16).replace("T", " ")} UTC${said === "" ? "" : `: ${said}`}. Push a change, then ask again.`; | |
| 101 | } | |
| 102 | ||
| 86 | 103 | /** The crew reviewer an @mention in this text names, if one is. */ |
| 87 | 104 | export function mentionedReviewer( |
| 88 | 105 | app: App, |
src/contract/openapi/routes/getApiV1ReposOwnerNamePullsNumberReviews.ts +1 −1
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | import { ref, list } from "../schema_kit.ts"; |
| 2 | 2 | import { REPO, type Route } from "../shared.ts"; |
| 3 | 3 | |
| 4 | export const route: Route = { method: "get", path: `${REPO}/pulls/{number}/reviews`, summary: "List a pull's line-anchored review comments", detail: "List a pull's line-anchored review comments, each with its `anchor` and whether it is `outdated`", auth: false, role: "anonymous", response: list(ref("ReviewComment")), refuses: [404] }; | |
| 4 | export const route: Route = { method: "get", path: `${REPO}/pulls/{number}/reviews`, summary: "List a pull's reviews with their line comments", detail: "List a pull's reviews, each with its state, reviewer, time and body, and its line comments under it (each with its `anchor` and whether it is `outdated`); a review with only a body is listed", auth: false, role: "anonymous", response: list(ref("ReviewWithLines")), refuses: [404] }; |
src/contract/openapi/schemas/pull.ts +36
| @@ -67,6 +67,8 @@ const PULL_DETAIL: Schema = obj( | ||
| 67 | 67 | approvedAt: orNull(str), |
| 68 | 68 | approval: orNull(APPROVAL), |
| 69 | 69 | approvedAgainst: orNull(str), |
| 70 | latestReview: orNull(ref("ReviewBrief")), | |
| 71 | changesRequested: orNull(ref("ReviewBrief")), | |
| 70 | 72 | variantSiblings: list(int), |
| 71 | 73 | mergeable: bool, |
| 72 | 74 | conflicts: list(str), |
| @@ -172,6 +174,38 @@ const REVIEW_COMMENT: Schema = obj( | ||
| 172 | 174 | ["untrusted"], |
| 173 | 175 | ); |
| 174 | 176 | |
| 177 | /** | |
| 178 | * A review as a pull's answer carries it: the newest, or the one asking for changes on the head. | |
| 179 | */ | |
| 180 | const REVIEW_BRIEF: Schema = obj({ | |
| 181 | id: str, | |
| 182 | state: words("approved", "changes_requested", "commented"), | |
| 183 | reviewer: str, | |
| 184 | at: str, | |
| 185 | body: str, | |
| 186 | commit: str, | |
| 187 | current: bool, | |
| 188 | }); | |
| 189 | ||
| 190 | /** | |
| 191 | * One review with its line comments under it; line comments given outside a review come as one with | |
| 192 | * a null id. | |
| 193 | */ | |
| 194 | const REVIEW_WITH_LINES: Schema = obj( | |
| 195 | { | |
| 196 | id: orNull(str), | |
| 197 | state: words("approved", "changes_requested", "commented"), | |
| 198 | reviewer: str, | |
| 199 | at: str, | |
| 200 | body: str, | |
| 201 | commit: str, | |
| 202 | current: bool, | |
| 203 | comments: list(ref("ReviewComment")), | |
| 204 | untrusted: str, | |
| 205 | }, | |
| 206 | ["untrusted"], | |
| 207 | ); | |
| 208 | ||
| 175 | 209 | const CHECKS: Schema = obj( |
| 176 | 210 | { head: str, state: str, required: bool, why: str, run: orNull(ref("Run")), looks: list(ref("Look")), runs: list(ref("Run")) }, |
| 177 | 211 | ["why"], |
| @@ -188,6 +222,8 @@ export const PULL_SCHEMAS: Readonly<Record<string, Schema>> = { | ||
| 188 | 222 | FileChange: FILE_CHANGE, |
| 189 | 223 | Review: REVIEW, |
| 190 | 224 | ReviewComment: REVIEW_COMMENT, |
| 225 | ReviewBrief: REVIEW_BRIEF, | |
| 226 | ReviewWithLines: REVIEW_WITH_LINES, | |
| 191 | 227 | Checks: CHECKS, |
| 192 | 228 | PullStored: PULL_STORED, |
| 193 | 229 | Merged: MERGED, |
src/core/changes_words.ts added +5
src/core/landing.ts +2 −1
| @@ -9,6 +9,7 @@ | ||
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | import type { Database } from "bun:sqlite"; |
| 12 | import { CHANGES } from "./changes_words.ts"; | |
| 12 | 13 | import type { App } from "../app.ts"; |
| 13 | 14 | import { isAncestor } from "../git/builds.ts"; |
| 14 | 15 | import { repoDir } from "../git/repos.ts"; |
| @@ -180,7 +181,7 @@ export function waitsFor(f: StallFacts, now: Date = new Date()): WaitsFor | null | ||
| 180 | 181 | case "person": |
| 181 | 182 | return { cause: "person", says: `it waits for a person: ${f.next.why}`, action: "a person who writes the repository merges it or requests changes" }; |
| 182 | 183 | case "builder": |
| 183 | return { cause: "changes", says: "changes were asked on this head", action: "the builder pushes what the review asked" }; | |
| 184 | return { cause: "changes", says: CHANGES, action: "the builder pushes what the review asked" }; | |
| 184 | 185 | case "reviewer": |
| 185 | 186 | return { cause: "review", says: "it waits for review", action: "a reviewer reviews it on its current head" }; |
| 186 | 187 | case "queue": |
src/core/review_list.ts added +84
| @@ -0,0 +1,84 @@ | ||
| 1 | /** | |
| 2 | * A pull's reviews as a client reads them (#18181): the verdict with its reviewer, time and body, | |
| 3 | * and the line comments under it. A review with only a body is a review: it is never left out | |
| 4 | * because it anchored nothing to a line. | |
| 5 | */ | |
| 6 | ||
| 7 | import type { Database } from "bun:sqlite"; | |
| 8 | import { listReviews, reviewsOnHead, type Review, type ReviewComment, type ReviewState } from "./reviews.ts"; | |
| 9 | ||
| 10 | export interface ReviewBrief { | |
| 11 | readonly id: string; | |
| 12 | readonly state: ReviewState; | |
| 13 | readonly reviewer: string; | |
| 14 | /** When it was given, ISO 8601 UTC. */ | |
| 15 | readonly at: string; | |
| 16 | readonly body: string; | |
| 17 | readonly commit: string; | |
| 18 | /** Whether it was given on the head the pull stands at now. */ | |
| 19 | readonly current: boolean; | |
| 20 | } | |
| 21 | ||
| 22 | /** One review as the API says it; `current` compares its commit with `headOid`. */ | |
| 23 | export function reviewBrief(r: Review, headOid: string): ReviewBrief { | |
| 24 | return { | |
| 25 | id: r.id, | |
| 26 | state: r.state, | |
| 27 | reviewer: r.originAuthor ?? r.authorName, | |
| 28 | at: r.createdAt, | |
| 29 | body: r.body, | |
| 30 | commit: r.commitOid, | |
| 31 | current: r.commitOid === headOid, | |
| 32 | }; | |
| 33 | } | |
| 34 | ||
| 35 | /** The pull's newest review, as the API says it; null with none. */ | |
| 36 | export function latestBrief(db: Database, issueId: string, headOid: string): ReviewBrief | null { | |
| 37 | const r = listReviews(db, issueId).at(-1); | |
| 38 | return r === undefined ? null : reviewBrief(r, headOid); | |
| 39 | } | |
| 40 | ||
| 41 | /** | |
| 42 | * The review asking for changes on `headOid` (a reviewer's current verdict there); null with none. | |
| 43 | */ | |
| 44 | export function changesBrief(db: Database, issueId: string, headOid: string): ReviewBrief | null { | |
| 45 | const r = reviewsOnHead(db, issueId, headOid).find((x) => x.state === "changes_requested"); | |
| 46 | return r === undefined ? null : reviewBrief(r, headOid); | |
| 47 | } | |
| 48 | ||
| 49 | /** | |
| 50 | * A line comment holds no review id, so it goes under the review its author gave on the same | |
| 51 | * commit nearest in time; one with no such review is left over. | |
| 52 | */ | |
| 53 | export function underReviews<C extends ReviewComment>( | |
| 54 | reviews: readonly Review[], | |
| 55 | comments: readonly C[], | |
| 56 | ): { readonly byReview: Map<string, C[]>; readonly loose: C[] } { | |
| 57 | const byReview = new Map<string, C[]>(); | |
| 58 | const loose: C[] = []; | |
| 59 | for (const c of comments) { | |
| 60 | let best: Review | undefined; | |
| 61 | let gap = Infinity; | |
| 62 | for (const r of reviews) { | |
| 63 | if (r.authorName !== c.authorName || r.commitOid !== c.commitOid) continue; | |
| 64 | const d = Math.abs(Date.parse(r.createdAt) - Date.parse(c.createdAt)); | |
| 65 | if (d < gap) { | |
| 66 | gap = d; | |
| 67 | best = r; | |
| 68 | } | |
| 69 | } | |
| 70 | if (best === undefined) loose.push(c); | |
| 71 | else byReview.set(best.id, [...(byReview.get(best.id) ?? []), c]); | |
| 72 | } | |
| 73 | return { byReview, loose }; | |
| 74 | } | |
| 75 | ||
| 76 | /** The first `n` non-empty lines of a review's body, for a refusal that quotes it. */ | |
| 77 | export function firstLines(body: string, n = 3): string { | |
| 78 | return body | |
| 79 | .split("\n") | |
| 80 | .map((l) => l.trim()) | |
| 81 | .filter((l) => l !== "") | |
| 82 | .slice(0, n) | |
| 83 | .join(" / "); | |
| 84 | } |
src/flow/next_actor.ts +5 −1
| @@ -5,6 +5,7 @@ | ||
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | import type { Database } from "bun:sqlite"; |
| 8 | import { CHANGES } from "../core/changes_words.ts"; | |
| 8 | 9 | import { getHold } from "../core/holds.ts"; |
| 9 | 10 | import type { Pull } from "../core/pulls.ts"; |
| 10 | 11 | import { checkSummary, type CheckSummary, type RunState } from "../core/runs.ts"; |
| @@ -63,6 +64,9 @@ export function noQueueLands(repo: { readonly autonomy: string; readonly autonom | ||
| 63 | 64 | return repo.autonomy !== "autonomous" || repo.autonomyBy === null; |
| 64 | 65 | } |
| 65 | 66 | |
| 67 | /** The Next line for a head a reviewer sent back (#18181): the author is who acts. */ | |
| 68 | export { CHANGES }; | |
| 69 | ||
| 66 | 70 | const WAITING = { |
| 67 | 71 | none: "waiting for its check", |
| 68 | 72 | queued: "its check is queued", |
| @@ -83,7 +87,7 @@ export function nextActor(i: NextInput): Next { | ||
| 83 | 87 | return { who: "queue", why: WAITING[i.check] }; |
| 84 | 88 | } |
| 85 | 89 | if (i.changesRequested > 0) |
| 86 | return { who: "builder", why: i.askedBy == null ? "changes were asked on this head" : `changes were asked on this head: ${i.askedBy}`, changes: true }; | |
| 90 | return { who: "builder", why: i.askedBy == null ? CHANGES : `${CHANGES}: ${i.askedBy}`, changes: true }; | |
| 87 | 91 | if (i.check === "failed") return { who: "builder", why: "its check is red" }; |
| 88 | 92 | if (i.wall != null && i.wall.length > 0) return { who: "person", why: wallAsk(i.wall) }; |
| 89 | 93 | if (i.approvals > 0) { |
src/flow/pull_pane.ts +2 −2
| @@ -18,7 +18,7 @@ import { DRAFT_LINE, isTalkDraft, TALK_DRAFT_LINE, type Pull } from "../core/pul | ||
| 18 | 18 | import type { Repo } from "../core/repos.ts"; |
| 19 | 19 | import { activeRunFor, checkSummary, type CheckSummary, type RunState } from "../core/runs.ts"; |
| 20 | 20 | import { queuePlace, type Place } from "../checks/place.ts"; |
| 21 | import { nextOfPull, type Next } from "./next_actor.ts"; | |
| 21 | import { CHANGES, nextOfPull, type Next } from "./next_actor.ts"; | |
| 22 | 22 | import { deployedSince } from "./path.ts"; |
| 23 | 23 | import { span } from "./pipeline.ts"; |
| 24 | 24 | |
| @@ -121,7 +121,7 @@ export function paneOf(f: PaneFacts): Pane { | ||
| 121 | 121 | return { state: "checking", tone: "attn", sentence: `Its check is queued${placeWords(c.place)}`, verbs: ["watch", "stop"], evidence: [] }; |
| 122 | 122 | const n = f.next; |
| 123 | 123 | if (n !== null && n.changes === true && c.state !== "failed") |
| 124 | return { state: "changes", tone: "attn", sentence: cap(n.why.replace(/^changes were asked on this head: /, "")), verbs: [], evidence: [] }; | |
| 124 | return { state: "changes", tone: "attn", sentence: cap(n.why.replace(`${CHANGES}: `, "")), verbs: [], evidence: [] }; | |
| 125 | 125 | if (c.state === "failed") |
| 126 | 126 | return { |
| 127 | 127 | state: "red", |
src/http/api/pulls.ts +40 −22
| @@ -8,6 +8,7 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | import { approvedAgainst } from "../../core/approval_at.ts"; |
| 11 | import { changesBrief, latestBrief, reviewBrief, underReviews } from "../../core/review_list.ts"; | |
| 11 | 12 | import { reviewsDemanded } from "../../crew/review.ts"; |
| 12 | 13 | import { pullWaitsFor } from "../../flow/waits_for.ts"; |
| 13 | 14 | import { parseAttestation } from "../../core/attestation.ts"; |
| @@ -45,7 +46,7 @@ import { stepsWords } from "../../core/review_steps.ts"; | ||
| 45 | 46 | import { lookUrl } from "../../core/looks.ts"; |
| 46 | 47 | import { pullFit, pullLooks } from "../../looks/readable.ts"; |
| 47 | 48 | import { holdPull, releasePull } from "../../actions/holds.ts"; |
| 48 | import { requestReview } from "../../actions/review_requests.ts"; | |
| 49 | import { alreadyReviewedWords, requestReview, reviewedAlready } from "../../actions/review_requests.ts"; | |
| 49 | 50 | import { getHold, type Hold } from "../../core/holds.ts"; |
| 50 | 51 | import { |
| 51 | 52 | getPull, |
| @@ -417,6 +418,10 @@ export function pullRoutes(router: Router<Handler>): void { | ||
| 417 | 418 | approval: status.reviews?.approval ?? null, |
| 418 | 419 | // The same approval as one line, "<head7> against <base7>" (null with none). |
| 419 | 420 | approvedAgainst: approvedAgainst(status.reviews?.approval), |
| 421 | // The newest review, whatever its state or whether it has a line comment (#18181), and the | |
| 422 | // one asking for changes on the head the pull stands at now (null with none). | |
| 423 | latestReview: latestBrief(ctx.app.db, found.pull.id, status.headOid), | |
| 424 | changesRequested: live ? changesBrief(ctx.app.db, found.pull.id, status.headOid) : null, | |
| 420 | 425 | variantSiblings: variantSiblings(ctx.app.db, [found.pull])[0] ?? [], |
| 421 | 426 | ...(live ? { mergeable: status.mergeable, conflicts: status.conflicts } : {}), |
| 422 | 427 | proposal: pullProposalOf(ctx.app.db, found.pull.id) ?? null, |
| @@ -587,11 +592,15 @@ export function pullRoutes(router: Router<Handler>): void { | ||
| 587 | 592 | found.pull, |
| 588 | 593 | str(input.reviewer), |
| 589 | 594 | ); |
| 590 | if (!asked.ok) | |
| 595 | if (!asked.ok) { | |
| 596 | const review = asked.error === "already_reviewed" ? reviewedAlready(ctx.app, found.pull) : null; | |
| 597 | if (review !== null) | |
| 598 | return json({ error: "already_reviewed", message: alreadyReviewedWords(review), review }, 409); | |
| 591 | 599 | return respondAccess( |
| 592 | 600 | asked.error, |
| 593 | 601 | asked.error === "not_open" || asked.error === "held" ? 409 : 422, |
| 594 | 602 | ); |
| 603 | } | |
| 595 | 604 | return json( |
| 596 | 605 | { |
| 597 | 606 | requested: true, |
| @@ -778,31 +787,40 @@ export function pullRoutes(router: Router<Handler>): void { | ||
| 778 | 787 | const found = loadPull(ctx); |
| 779 | 788 | if ("error" in found) return found.error; |
| 780 | 789 | const marked = await timePhaseAsync(ctx.request, "reviews", async () => { |
| 781 | const { diff } = await pullDiff( | |
| 790 | const { diff, status } = await pullDiff( | |
| 782 | 791 | await pullDirOf(ctx, found.repo, found.pull), |
| 783 | 792 | found.pull, |
| 784 | 793 | ); |
| 785 | return withOutdated( | |
| 786 | readerMarked( | |
| 787 | ctx, | |
| 788 | found.repo.id, | |
| 789 | listReviewComments(ctx.app.db, found.pull.id), | |
| 790 | ), | |
| 794 | const comments = withOutdated( | |
| 795 | readerMarked(ctx, found.repo.id, listReviewComments(ctx.app.db, found.pull.id)), | |
| 791 | 796 | diff, |
| 792 | ); | |
| 797 | ).map((c) => ({ ...c, anchor: anchorId(c.path, c.side, c.line) })); | |
| 798 | return { comments, headOid: status.headOid }; | |
| 799 | }); | |
| 800 | // Reviews with their line comments under them (#18181): a review with only a body is one. | |
| 801 | return timePhase(ctx.request, "render", () => { | |
| 802 | const reviews = listReviews(ctx.app.db, found.pull.id); | |
| 803 | const { byReview, loose } = underReviews(reviews, marked.comments); | |
| 804 | const items = readerMarked(ctx, found.repo.id, reviews).map((r) => ({ | |
| 805 | ...reviewBrief(r, marked.headOid), | |
| 806 | ...(r.untrusted === undefined ? {} : { untrusted: r.untrusted }), | |
| 807 | comments: byReview.get(r.id) ?? [], | |
| 808 | })); | |
| 809 | // Line comments given outside any review keep a place, grouped by who left them. | |
| 810 | const by = new Map<string, typeof loose>(); | |
| 811 | for (const c of loose) by.set(c.authorName, [...(by.get(c.authorName) ?? []), c]); | |
| 812 | const alone = [...by].map(([reviewer, comments]) => ({ | |
| 813 | id: null, | |
| 814 | state: "commented" as const, | |
| 815 | reviewer, | |
| 816 | at: comments[0]!.createdAt, | |
| 817 | body: "", | |
| 818 | commit: comments[0]!.commitOid, | |
| 819 | current: comments[0]!.commitOid === marked.headOid, | |
| 820 | comments, | |
| 821 | })); | |
| 822 | return json([...items, ...alone]); | |
| 793 | 823 | }); |
| 794 | return timePhase(ctx.request, "render", () => | |
| 795 | json( | |
| 796 | marked.map( | |
| 797 | // The thread this comment belongs to, so a client can resolve it | |
| 798 | // without reassembling the key itself. | |
| 799 | (comment) => ({ | |
| 800 | ...comment, | |
| 801 | anchor: anchorId(comment.path, comment.side, comment.line), | |
| 802 | }), | |
| 803 | ), | |
| 804 | ), | |
| 805 | ); | |
| 806 | 824 | }, |
| 807 | 825 | ); |
| 808 | 826 |
src/http/mcp/tools/request_review.ts +9 −5
| @@ -1,10 +1,10 @@ | ||
| 1 | import { requestReview } from "../../../actions/review_requests.ts"; | |
| 1 | import { alreadyReviewedWords, requestReview, reviewedAlready } from "../../../actions/review_requests.ts"; | |
| 2 | 2 | import { getPull } from "../../../core/pulls.ts"; |
| 3 | 3 | import { good, bad, type Tool, str, APP_ARG, planRepo, isAnswer } from "../shared.ts"; |
| 4 | 4 | |
| 5 | 5 | export const tool: Tool = { |
| 6 | 6 | name: "request_review", |
| 7 | doc: "`{ app, pull, reviewer?, dryRun? }`: ask the crew to review a person's pull, by the reviewer named or the least busy; a person who can write, never an agent; plans unless `dryRun: false`", | |
| 7 | doc: "`{ app, pull, reviewer?, dryRun? }`: ask the crew to review a person's pull, by the reviewer named or the least busy; a person who can write, never an agent; acts unless `dryRun: true`, which only plans", | |
| 8 | 8 | description: "Ask the crew to review a person's pull: the reviewer named, else the least busy.", |
| 9 | 9 | inputSchema: { |
| 10 | 10 | type: "object", |
| @@ -17,7 +17,7 @@ export const tool: Tool = { | ||
| 17 | 17 | required: ["app", "pull"], |
| 18 | 18 | }, |
| 19 | 19 | writes: true, |
| 20 | dryByDefault: true, | |
| 20 | readsWhen: (args) => args["dryRun"] === true, | |
| 21 | 21 | run(ctx, user, args) { |
| 22 | 22 | const repo = planRepo(ctx, user, args); |
| 23 | 23 | if (isAnswer(repo)) return repo; |
| @@ -28,9 +28,13 @@ export const tool: Tool = { | ||
| 28 | 28 | : undefined; |
| 29 | 29 | if (pull === undefined) |
| 30 | 30 | return bad("no_such_pull", `no pull #${String(n)}`); |
| 31 | const dry = args["dryRun"] !== false; | |
| 31 | const dry = args["dryRun"] === true; | |
| 32 | 32 | const name = `${repo.ownerName}/${repo.name}#${pull.number}`; |
| 33 | 33 | const asked = requestReview(ctx.app, user, repo, pull, str(args["reviewer"]), dry); |
| 34 | if (!asked.ok && asked.error === "already_reviewed") { | |
| 35 | const review = reviewedAlready(ctx.app, pull); | |
| 36 | if (review !== null) return bad("already_reviewed", alreadyReviewedWords(review)); | |
| 37 | } | |
| 34 | 38 | if (!asked.ok) |
| 35 | 39 | return bad( |
| 36 | 40 | asked.error, |
| @@ -48,7 +52,7 @@ export const tool: Tool = { | ||
| 48 | 52 | ); |
| 49 | 53 | return good({ |
| 50 | 54 | says: dry |
| 51 | ? `Would ask ${asked.value.reviewer} to review ${name}. Nothing changed; send dryRun: false to do it.` | |
| 55 | ? `Would ask ${asked.value.reviewer} to review ${name}. Nothing changed; leave out dryRun to do it.` | |
| 52 | 56 | : `Asked ${asked.value.reviewer} to review ${name}.`, |
| 53 | 57 | reviewer: asked.value.reviewer, |
| 54 | 58 | dryRun: dry, |
src/tui/screens/pull.ts +5 −2
| @@ -154,7 +154,7 @@ import { FINISH_REFUSALS, finishConflicts } from "../../actions/finish-conflicts | ||
| 154 | 154 | import { PROPOSE_WHY, proposalOf, proposeResolution } from "../../crew/proposal.ts"; |
| 155 | 155 | import { conflictScreen } from "./conflicts.ts"; |
| 156 | 156 | import { reviewScreen } from "./review.ts"; |
| 157 | import { requestReview } from "../../actions/review_requests.ts"; | |
| 157 | import { alreadyReviewedWords, requestReview, reviewedAlready } from "../../actions/review_requests.ts"; | |
| 158 | 158 | import { RunList, maySteer, openRunLog, steerPrompt } from "./runlist.ts"; |
| 159 | 159 | import { runTone } from "./runwords.ts"; |
| 160 | 160 | import { Composer, threadLines, type ThreadEntry } from "./thread.ts"; |
| @@ -1583,7 +1583,10 @@ export function pullScreen( | ||
| 1583 | 1583 | hint: "A reviewer's username. Enter asks; Esc cancels.", |
| 1584 | 1584 | onSubmit: (value) => { |
| 1585 | 1585 | const asked = requestReview(f.app, f.user, target, row, value.trim()); |
| 1586 | if (!asked.ok) return errorText(asked.error); | |
| 1586 | if (!asked.ok) { | |
| 1587 | const review = asked.error === "already_reviewed" ? reviewedAlready(f.app, row) : null; | |
| 1588 | return review === null ? errorText(asked.error) : alreadyReviewedWords(review); | |
| 1589 | } | |
| 1587 | 1590 | ctx.toast(`asked ${asked.value.reviewer} to review`, "success"); |
| 1588 | 1591 | runAsync(ctx, reload); |
| 1589 | 1592 | return undefined; |
src/web/studio/actions.ts +6 −4
| @@ -14,7 +14,7 @@ import { COMPOSER_FIELDS, claimShare, refuseTell, releaseShare } from "../share_ | ||
| 14 | 14 | import { mayView } from "../../core/sealed.ts"; |
| 15 | 15 | import { shipsPastReviews } from "./land_as_is.ts"; |
| 16 | 16 | import { holdPull, releasePull } from "../../actions/holds.ts"; |
| 17 | import { requestReview } from "../../actions/review_requests.ts"; | |
| 17 | import { alreadyReviewedWords, requestReview, reviewedAlready } from "../../actions/review_requests.ts"; | |
| 18 | 18 | import { addComment } from "../../actions/issues.ts"; |
| 19 | 19 | import { overTellLimit, parseFrom, tellTooLongWords } from "../../actions/tell_from.ts"; |
| 20 | 20 | import { seatEmptyCrew } from "../../actions/seat_crew.ts"; |
| @@ -538,9 +538,11 @@ export async function reviewRequestSubmit(ctx: Ctx): Promise<Response> { | ||
| 538 | 538 | ? "That is not a reviewer on this crew." |
| 539 | 539 | : asked.error === "held" |
| 540 | 540 | ? "Release the hold first; no rule reviews a held change." |
| 541 | : asked.error === "agent_pull" | |
| 542 | ? "The crew already reviews its own changes." | |
| 543 | : "Only an open change can be reviewed.", | |
| 541 | : asked.error === "already_reviewed" | |
| 542 | ? ((r) => (r === null ? "Changes were already requested on this head. Push a change, then ask again." : alreadyReviewedWords(r)))(reviewedAlready(ctx.app, found.pull)) | |
| 543 | : asked.error === "agent_pull" | |
| 544 | ? "The crew already reviews its own changes." | |
| 545 | : "Only an open change can be reviewed.", | |
| 544 | 546 | }), |
| 545 | 547 | }); |
| 546 | 548 | } |
test/api-reader-marks.test.ts +1 −1
| @@ -212,7 +212,7 @@ describe("a reader's words over the API carry the brief's mark", () => { | ||
| 212 | 212 | const verdicts = await get(`/pulls/${pullNumber}/review-states`); |
| 213 | 213 | expect(first(verdicts, "mallory").untrusted).toBe(READER); |
| 214 | 214 | expect(first(verdicts, "alice").untrusted).toBeUndefined(); |
| 215 | const lines = await get(`/pulls/${pullNumber}/reviews`); | |
| 215 | const lines = (await get(`/pulls/${pullNumber}/reviews`)).flatMap((r: { comments: Said[] }) => r.comments); | |
| 216 | 216 | expect(first(lines, "mallory").untrusted).toBe(READER); |
| 217 | 217 | expect(first(lines, "alice").untrusted).toBeUndefined(); |
| 218 | 218 | }); |
test/next_actor.test.ts +4 −4
| @@ -13,7 +13,7 @@ const base: NextInput = { | ||
| 13 | 13 | const cases: [string, Partial<NextInput>, Actor, string][] = [ |
| 14 | 14 | ["held", { held: { by: "sam", why: "wait for legal" }, approvals: 1, check: "ok" }, "person", "sam holds it: wait for legal"], |
| 15 | 15 | ["conflicted", { conflicted: true, approvals: 1, check: "ok" }, "builder", "it conflicts with its base"], |
| 16 | ["changes asked", { changesRequested: 1, check: "ok" }, "builder", "changes were asked on this head"], | |
| 16 | ["changes asked", { changesRequested: 1, check: "ok" }, "builder", "waits on its author: changes requested"], | |
| 17 | 17 | ["red", { check: "failed", approvals: 1 }, "builder", "its check is red"], |
| 18 | 18 | ["pushed since review", { pushedSince: 1, check: "ok" }, "reviewer", "pushed since the last review"], |
| 19 | 19 | ["no review", { check: "running" }, "reviewer", "no review yet"], |
| @@ -24,12 +24,12 @@ const cases: [string, Partial<NextInput>, Actor, string][] = [ | ||
| 24 | 24 | ["approved, running", { approvals: 1, check: "running" }, "queue", "approved, its check is running"], |
| 25 | 25 | // The access wall (#7847): a person decides, however approved and green. |
| 26 | 26 | ["walled, approved and green", { approvals: 1, check: "ok", wall: ["anyone signed out could read pack records"] }, "person", "the access wall holds it for a person to decide: anyone signed out could read pack records. Allow it (merge) or send it back"], |
| 27 | ["walled, sent back", { approvals: 1, check: "ok", changesRequested: 1, wall: ["anyone signed out could read pack records"] }, "builder", "changes were asked on this head"], | |
| 27 | ["walled, sent back", { approvals: 1, check: "ok", changesRequested: 1, wall: ["anyone signed out could read pack records"] }, "builder", "waits on its author: changes requested"], | |
| 28 | 28 | // Reviews off (#11666): nobody waits for a review, but a verdict on the head still counts. |
| 29 | 29 | ["reviews off, green", { check: "ok", reviewOff: true }, "queue", "green, reviews are off: it lands"], |
| 30 | 30 | ["reviews off, no check", { reviewOff: true }, "queue", "no check yet"], |
| 31 | 31 | ["reviews off, running", { check: "running", reviewOff: true }, "queue", "its check is running"], |
| 32 | ["reviews off, changes asked", { changesRequested: 1, check: "ok", reviewOff: true }, "builder", "changes were asked on this head"], | |
| 32 | ["reviews off, changes asked", { changesRequested: 1, check: "ok", reviewOff: true }, "builder", "waits on its author: changes requested"], | |
| 33 | 33 | ["reviews off, red", { check: "failed", reviewOff: true }, "builder", "its check is red"], |
| 34 | 34 | // No queue lands where autonomy is off (#16452): a ready pull waits for a person's merge. |
| 35 | 35 | ["person lands, approved, running", { approvals: 1, check: "running", personLands: true }, "queue", "approved, its check is running"], |
| @@ -40,7 +40,7 @@ describe("nextActor", () => { | ||
| 40 | 40 | for (const [name, input, who, why] of cases) |
| 41 | 41 | // A hold says so as a flag too (the pull pane reads it as its own state, flow/pull_pane.ts). |
| 42 | 42 | test(name, () => { |
| 43 | const want: Next = name === "held" ? { who, why, held: true } : why.startsWith("changes were asked") ? { who, why, changes: true } : { who, why }; | |
| 43 | const want: Next = name === "held" ? { who, why, held: true } : why.startsWith("waits on its author") ? { who, why, changes: true } : { who, why }; | |
| 44 | 44 | expect(nextActor({ ...base, ...input })).toEqual(want); |
| 45 | 45 | }); |
| 46 | 46 | }); |
test/parity.test.ts +2 −2
| @@ -641,7 +641,7 @@ describe("parity: full control through actions and the API", () => { | ||
| 641 | 641 | "GET", |
| 642 | 642 | `/api/v1/repos/alice/pub/pulls/${n}/reviews`, |
| 643 | 643 | ); |
| 644 | expect(reviews.list.map((r) => r.outdated)).toEqual([false, false]); | |
| 644 | expect(reviews.list.flatMap((r: any) => r.comments).map((r: any) => r.outdated)).toEqual([false, false]); | |
| 645 | 645 | |
| 646 | 646 | // Rewrite line 2 on the head branch: the new-side comment goes stale, the |
| 647 | 647 | // old-side one (anchored to base content) stays current. |
| @@ -654,7 +654,7 @@ describe("parity: full control through actions and the API", () => { | ||
| 654 | 654 | }, |
| 655 | 655 | }); |
| 656 | 656 | reviews = await call("GET", `/api/v1/repos/alice/pub/pulls/${n}/reviews`); |
| 657 | expect(reviews.list.map((r) => [r.side, r.outdated])).toEqual([ | |
| 657 | expect(reviews.list.flatMap((r: any) => r.comments).map((r: any) => [r.side, r.outdated])).toEqual([ | |
| 658 | 658 | ["new", true], |
| 659 | 659 | ["old", false], |
| 660 | 660 | ]); |
test/pull-pane.test.ts +2 −2
| @@ -101,7 +101,7 @@ test("each state says one sentence, offers at most three verbs from the map, and | ||
| 101 | 101 | { |
| 102 | 102 | ...base, |
| 103 | 103 | check: check("ok"), |
| 104 | next: { who: "builder", why: "changes were asked on this head: juniper asked for changes (review 12)", changes: true }, | |
| 104 | next: { who: "builder", why: "waits on its author: changes requested: juniper asked for changes (review 12)", changes: true }, | |
| 105 | 105 | }, |
| 106 | 106 | "Juniper asked for changes (review 12)", |
| 107 | 107 | [], |
| @@ -157,7 +157,7 @@ test("the page draws each verb with its key from the map through its own door, a | ||
| 157 | 157 | test("the changes state is the next actor's flag, not its wording: a reworded reason keeps it, the words alone do not make it", () => { |
| 158 | 158 | const ok = { ...base, check: check("ok") }; |
| 159 | 159 | expect(paneOf({ ...ok, next: { who: "builder", why: "a reviewer wants another pass", changes: true } }).state).toBe("changes"); |
| 160 | expect(paneOf({ ...ok, next: { who: "builder", why: "changes were asked on this head" } }).state).not.toBe("changes"); | |
| 160 | expect(paneOf({ ...ok, next: { who: "builder", why: "waits on its author: changes requested" } }).state).not.toBe("changes"); | |
| 161 | 161 | }); |
| 162 | 162 | |
| 163 | 163 | let dir: string; |
test/pull-waits-for.test.ts +1 −1
| @@ -41,7 +41,7 @@ describe("waitsFor, from the facts", () => { | ||
| 41 | 41 | [{ chapter: "outside Two: the crew builds only what the open chapter holds" }, "chapter", "Green for 7 hours, not landed: held by a chapter, outside Two: the crew builds only what the open chapter holds. To unblock: the owner opens the chapter its issue is in, or moves the issue into the open one."], |
| 42 | 42 | [{ held: true, next: { who: "person", why: "alice holds it: wait for the demo" } }, "held", "Green for 7 hours, not landed: it is held: alice holds it: wait for the demo. To unblock: the holder releases the hold, or a writer merges it."], |
| 43 | 43 | [{ next: { who: "person", why: "allow a new host" } }, "person", "Green for 7 hours, not landed: it waits for a person: allow a new host. To unblock: a person who writes the repository merges it or requests changes."], |
| 44 | [{ next: { who: "builder", why: "changes were asked on this head" } }, "changes", "Green for 7 hours, not landed: changes were asked on this head. To unblock: the builder pushes what the review asked."], | |
| 44 | [{ next: { who: "builder", why: "x" } }, "changes", "Green for 7 hours, not landed: waits on its author: changes requested. To unblock: the builder pushes what the review asked."], | |
| 45 | 45 | ]; |
| 46 | 46 | for (const [over, cause, line] of cases) { |
| 47 | 47 | const w = waitsFor(facts(over), NOW); |
test/review-request.test.ts +52 −3
| @@ -30,6 +30,7 @@ import { pullScreen } from "../src/tui/screens/pull.ts"; | ||
| 30 | 30 | import { local } from "../src/tui/screens/where.ts"; |
| 31 | 31 | import { headlessTerminal } from "../src/tui/term/terminal.ts"; |
| 32 | 32 | import { settleApp } from "./helpers/tui.ts"; |
| 33 | import { nextOfPull } from "../src/flow/next_actor.ts"; | |
| 33 | 34 | import { sweepReviews, waitsForReviewer } from "../src/crew/review.ts"; |
| 34 | 35 | |
| 35 | 36 | describe("asking the crew to review", () => { |
| @@ -269,15 +270,15 @@ describe("asking the crew to review", () => { | ||
| 269 | 270 | ); |
| 270 | 271 | expect(typeof ((await res2.json()) as any).reviewer).toBe("string"); |
| 271 | 272 | |
| 272 | // MCP: a plan by default, a read-only token may plan, the ask on dryRun: false. | |
| 273 | // MCP: it asks by default; `dryRun: true` plans, and a read-only token may only plan. | |
| 273 | 274 | const viaMcp = await greenPull("by-mcp"); |
| 274 | 275 | const args = { app: "alice/engine", pull: viaMcp.number, reviewer: "mason" }; |
| 275 | const planned = await mcp(args, ro); | |
| 276 | const planned = await mcp({ ...args, dryRun: true }, ro); | |
| 276 | 277 | expect(planned.value.says).toContain("Would ask mason"); |
| 277 | 278 | expect(getReviewRequest(app.db, viaMcp.id)).toBeUndefined(); |
| 278 | 279 | expect((await mcp({ ...args, reviewer: "nobody" })).error).toContain("not_reviewer"); |
| 279 | 280 | expect((await mcp({ ...args, pull: 999 })).error).toContain("no_such_pull"); |
| 280 | const done = await mcp({ ...args, dryRun: false }); | |
| 281 | const done = await mcp(args); | |
| 281 | 282 | expect(done.value.says).toBe(`Asked mason to review alice/engine#${viaMcp.number}.`); |
| 282 | 283 | expect(getReviewRequest(app.db, viaMcp.id)!.reviewerId).toBe(mason.id); |
| 283 | 284 | |
| @@ -307,4 +308,52 @@ describe("asking the crew to review", () => { | ||
| 307 | 308 | servers.stop(); |
| 308 | 309 | } |
| 309 | 310 | }); |
| 311 | ||
| 312 | test("a changes-requested review with only a body is found in the pull, the reviews list and the repeat ask (#18181)", async () => { | |
| 313 | const servers: Servers = await serve(app); | |
| 314 | try { | |
| 315 | const rw = createToken(app.db, alice.id, "t18181", "rw").token; | |
| 316 | const get = async (path: string) => | |
| 317 | (await fetch(`${servers.url}/api/v1/repos/alice/engine${path}`, { headers: { authorization: `Bearer ${rw}` } })).json() as Promise<any>; | |
| 318 | const pull = await greenPull("body-only"); | |
| 319 | const sent = submitReview(app.db, { | |
| 320 | issueId: pull.id, | |
| 321 | authorId: quill.id, | |
| 322 | state: "changes_requested", | |
| 323 | body: "HIGH: the engine drops the last frame.\nMEDIUM: no test.", | |
| 324 | commitOid: pull.headOid, | |
| 325 | }); | |
| 326 | expect(sent.ok).toBe(true); | |
| 327 | ||
| 328 | const detail = await get(`/pulls/${pull.number}?diff=0`); | |
| 329 | expect(detail.latestReview).toMatchObject({ state: "changes_requested", reviewer: "quill", current: true }); | |
| 330 | expect(detail.latestReview.body).toContain("HIGH"); | |
| 331 | expect(detail.changesRequested.reviewer).toBe("quill"); | |
| 332 | ||
| 333 | const list = await get(`/pulls/${pull.number}/reviews`); | |
| 334 | expect(list).toHaveLength(1); | |
| 335 | expect(list[0]).toMatchObject({ state: "changes_requested", reviewer: "quill", comments: [] }); | |
| 336 | expect(list[0].body).toContain("drops the last frame"); | |
| 337 | ||
| 338 | const again = await fetch(`${servers.url}/api/v1/repos/alice/engine/pulls/${pull.number}/review-requests`, { | |
| 339 | method: "POST", | |
| 340 | headers: { authorization: `Bearer ${rw}`, "content-type": "application/json" }, | |
| 341 | body: "{}", | |
| 342 | }); | |
| 343 | expect(again.status).toBe(409); | |
| 344 | const refused = (await again.json()) as any; | |
| 345 | expect(refused.error).toBe("already_reviewed"); | |
| 346 | expect(refused.message).toContain("changes requested by quill"); | |
| 347 | expect(refused.message).toContain("HIGH: the engine drops the last frame."); | |
| 348 | expect(refused.message).toContain("Push a change, then ask again."); | |
| 349 | expect(refused.review.state).toBe("changes_requested"); | |
| 350 | ||
| 351 | expect(nextOfPull(app.db, pull, { headOid: pull.headOid, conflicts: 0 }, fresh())!).toMatchObject({ | |
| 352 | who: "builder", | |
| 353 | why: expect.stringContaining("waits on its author: changes requested"), | |
| 354 | }); | |
| 355 | } finally { | |
| 356 | servers.stop(); | |
| 357 | } | |
| 358 | }); | |
| 310 | 359 | }); |
test/reviews-states.test.ts +8 −6
| @@ -492,9 +492,11 @@ describe("review states, and the merge they gate", () => { | ||
| 492 | 492 | ); |
| 493 | 493 | expect(comment.status).toBe(201); |
| 494 | 494 | |
| 495 | const comments = await read<{ anchor: string }[]>( | |
| 496 | await as("ada", "GET", `/api/v1/repos/acme/lib/pulls/${number}/reviews`), | |
| 497 | ); | |
| 495 | const comments = ( | |
| 496 | await read<{ comments: { anchor: string }[] }[]>( | |
| 497 | await as("ada", "GET", `/api/v1/repos/acme/lib/pulls/${number}/reviews`), | |
| 498 | ) | |
| 499 | ).flatMap((r) => r.comments); | |
| 498 | 500 | const anchor = comments[0]!.anchor; |
| 499 | 501 | expect(anchor).toMatch(/^[0-9a-f]{16}$/); |
| 500 | 502 | |
| @@ -568,9 +570,9 @@ describe("review states, and the merge they gate", () => { | ||
| 568 | 570 | }) |
| 569 | 571 | ).status, |
| 570 | 572 | ).toBe(201); |
| 571 | const [first] = await read<{ anchor: string }[]>( | |
| 572 | await as("ada", "GET", `${pull}/reviews`), | |
| 573 | ); | |
| 573 | const [first] = ( | |
| 574 | await read<{ comments: { anchor: string }[] }[]>(await as("ada", "GET", `${pull}/reviews`)) | |
| 575 | ).flatMap((r) => r.comments); | |
| 574 | 576 | expect( |
| 575 | 577 | (await as("ada", "POST", `${pull}/threads/${first!.anchor}/resolve`, {})) |
| 576 | 578 | .status, |
new above
offline
src/core/landing.ts:183 still says 'changes were asked on this head'. Use this one wording everywhere (and update docs/features/flow-waiting.md:27).