Pull Request

A pull request's status, checks and reviewers.

Handle leads without an email domain #482

northwind/leads · agent/fix-missing-domain → main

Open
  • +42−7in 3 files
  • Grace Liu approved
  • Grace LiuRequiredApproved
  • Priya NairCommented
1 of 4 checks failedChecks
  • Failedlint2 problems in src/leads/domain.tsRequired
  • Passedunit testsRequired
  • Passedtype checkRequired
  • Skippedpreview deployOnly for changes to the web app

1 thing blocks merging

  • The lint check failed.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/pull-request

Usage

import type { Outcome } from "./ui/uicontext/components/domain/Outcome.ts"import { PullRequestCard, type PullRequestCheck } from "./ui/uicontext/components/kit/PullRequest.ts"
const Message = UiSchema.TaggedEnum({ RequestedMerge: {} })// the app owns the pull request; the card asks to merge and shows the answer through `outcome`export const PullRequest = (h: Html.H<typeof Message.Type>, checks: ReadonlyArray<PullRequestCheck>, outcome: Outcome | null) =>	PullRequestCard(h, {		props: {			id: "482",			title: "Handle leads without an email domain",			number: "#482",			head: "agent/fix-missing-domain",			base: "main",			state: "open",			checks,			requiredApprovals: 1,			reviewers: [{ name: "Grace Liu", state: "approved" }],			can: ["merge"],			outcome,		},		onEmit: { RequestedMerge: () => Message.RequestedMerge(), RequestedReview: () => undefined, RequestedRerun: () => undefined },	})

Examples

What blocks a merge

The merge box lists what stands in the way, from mergeable, checks, reviewers and requiredApprovals; Merge stays off until nothing does.

Move invoices to the new ledger #490

northwind/billing · ledger-v2 → main

Open
  • +1,204−388in 31 files
  • Theo RobinsonChanges requested
  • Maya ChenRequiredPending
1 of 3 checks failedChecks
  • Failedunit tests3 of 412 failedRequired
  • RunningintegrationRequired
  • PassedlintRequired

5 things block merging

  • It conflicts with main. Resolve the conflicts to merge.
  • The unit tests check failed.
  • 1 check is still running.
  • Theo Robinson requested changes.
  • Needs approval from Maya Chen.

Retry webhook deliveries with backoff #487

northwind/hooks · retry-backoff → main

Open
  • Grace LiuApproved
1 check passedChecks
  • Passedunit tests

Ready to merge

Draft, merged, closed and refused

state follows the pull request on the code host; reason says why it closed, how it merged, or why the agent couldn't open it.

Add a CSV export to the reports page #493

northwind/reports · agent/csv-export → main

Draft
  • +86−4in 4 files
  • No review yet
1 check passedChecks
  • Passedunit tests

Opened by the agent for Maya Chen

Fix the timezone in weekly digests

northwind/digest · agent/digest-tz → main

Opening…

Add the company size to new contacts #479

northwind/leads · agent/company-size → main

Merged

Merged into main by Grace Liu on Nov 28.

  • +118−12in 6 files
  • Grace Liu approved

Cache the pricing table #471

northwind/billing

Closed

Closed by Theo Robinson: the pricing service caches it now.

Bump the payment library

northwind/payments

Not opened

API reference

Props

PullRequestCard props
NameTypeDefaultDescription
idrequiredstring—The pull request's id in the app, sent back with RequestedReview
titlerequiredstring—The pull request's title
numberstring—"#482"
hrefstring—Where the pull request opens on the code host
repositorystring—"acme/web"
headstring—The branch with the changes: "fix/login-redirect"
basestring—The branch it merges into: "main"
staterequired"pending" | "draft" | "open" | "merged" | "closed" | "refused"—The pull request's lifecycle on the code host, not a run: pending (being opened), draft, open, merged, closed, or refused (the agent wasn't allowed to open it; see reason)
reasonstring—Why it was refused or closed: "This repository isn't granted to the agent."
diff{ additions, deletions, files }—How many lines were added and removed, in how many files
checksPullRequestCheck[]—The checks run on it, each passed, failed, pending or skipped
review{ state, text }—Where review stands, with an optional line such as "Ada approved"
reviewers{ name, state, required }[]—Each reviewer and where their review stands
requiredApprovalsnumber—Approving reviews the base branch requires
mergeable"clean" | "conflicts" | "behind" | "checking"—Whether the branch merges cleanly into the base: checking while the host works it out
mergeLabelstring"Merge""Merge", "Squash and merge"; "Merge" by default
attributionstring—Whose name it is under and who asked: "Opened by the agent as Ada Lovelace"
owner{ label, href }—The session or run that owns it
notestring—A verdict or note: "The auto-reviewer would approve"
canrequired("review" | "merge" | "rerun")[]—What the person may do: "review" asks for a review, "merge" merges, "rerun" re-runs a failed check
reviewLabelstring—"Ask the agent to review", "Request review"
outcomeOutcome | null—The app's answer to the last request: "review", "merge", or "rerun:<check name>"
agentIdstringpr:<id>This card's id for agents, unique on the page; pr:<id> by default

Events

PullRequestCard events
EventPayloadDescription
RequestedReview{ id: string }Ask for a review of this pull request; answer through outcome with request "review"
RequestedMerge{ id: string }Merge it into the base; answer through outcome with request "merge"
RequestedRerun{ id: string; check: string }Run a failed check again; answer through outcome with request rerun:<check>

Agent actions

What agents can do with PullRequestCard
ActionDescription
ClickedReviewAsk for a review of the pull request
ClickedMergeasks firstMerge the pull request into its base; only when nothing blocks it
ClickedRerunRun a failed check again, by its name

Accessibility

  • The card is an article named by its title, a heading. Its state and each check's status are written in words, not shown by color alone.
  • Request review is a real button, disabled when a review can't be asked for, and a refusal shows its reason.
  • Agents read the state, checks and review, and the one action they can take is asking for a review.

Source