Skip to content

Record PR assignees/requested reviewers and surface them on the pull card#476

Open
danielbeardsley wants to merge 6 commits into
masterfrom
pr-assignees
Open

Record PR assignees/requested reviewers and surface them on the pull card#476
danielbeardsley wants to merge 6 commits into
masterfrom
pr-assignees

Conversation

@danielbeardsley

@danielbeardsley danielbeardsley commented Jul 15, 2026

Copy link
Copy Markdown
Member

Context

Pulldasher tracked a PR's author but neither its assignees nor its requested reviewers. This captures both from GitHub, persists them, sends them to the frontend, and surfaces them on the pull card so people can quickly spot PRs that involve them.

Both fields mirror the existing author handling (getLogin, emitted via toObject()).

Backend / data pipeline

  • models/pull.jsfromGithubApi extracts assignees and requested_reviewers ((data.<field> || []).map(getLogin)); getFromDB reads the mysql2-auto-parsed arrays.
  • models/db_pull.jsJSON.stringifys each into its DB column.
  • Migrations 0020-pulls--add-assignees.sql and 0021-pulls--add-requested-reviewers.sql + schema.sql — two native JSON columns on pulls. All SELECT * reads and the REPLACE INTO write need no other change.
  • Webhook and API ingestion paths both carry these fields, so capture is automatic.

Frontend

  • types.tsassignees: string[] and requested_reviewers: string[] on PullData.
  • pull.tsauthors() (author + assignees, deduped), authoredByMe(), and reviewRequestedFromMe() helpers.
  • Assignees → additional authors: in the title, a blue star if you're the author or an assignee; otherwise the first author's avatar, with all authors listed on hover (Avatar gained an optional title).
  • Requested reviewers → CR-block star: a blue star before the "CR" text when a review is requested from you; its hover lists all requested reviewers.
  • The participants indicator stays participants-only (blue when you're participating, grey otherwise).

Demo & fixtures

  • frontend/dummy-pulls.json — assignees and requested_reviewers on several pulls.
  • pull-card-demo / named-pulls — new Authors and Review Requests example rows (plus factory defaults for the new fields), exercising the multi-author hover and the multi-reviewer star tooltip.

Verification

  • Backend write/read round-trip verified against real mysql2 behavior (write → JSON string; read → array; NULL → []; missing payload → []).
  • Frontend tsc --noEmit and ESLint clean; production webpack build (both entrypoints) succeeds.

Not automated here: applying the migrations to a real DB and driving a live GitHub webhook — run npm run frontend:start to eyeball the indicators against the dummy data.

🤖 Generated with Claude Code

danielbeardsley and others added 4 commits July 15, 2026 14:47
Capture the GitHub `assignees[]` array for pull requests, persist it in
the `pulls` table (JSON-encoded in a new text column), emit it to the
frontend, and show a small person icon on a pull card when the current
user is one of the assignees.

Mirrors the existing Issue-assignee handling (backend/DB) and the
`participants` array (frontend shape + "includes me" conditional UI).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move the "assigned to you" icon from the top-left corner (where it was
hidden behind the commit-status bar) to inline before the pull title.
Add assignees to a few dummy pulls to exercise both UI states.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the separate assignee component with color on the existing
participants icon: green when assigned to you, blue when participating,
grey otherwise. Icon shape still encodes participant quantity, and the
tooltip reflects the assigned state.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Change the `assignees` column from text to a native JSON column. mysql2
auto-parses JSON columns on read, so getFromDB no longer JSON.parses the
value; the write path keeps JSON.stringify to safely populate the column.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@danielbeardsley

danielbeardsley commented Jul 15, 2026

Copy link
Copy Markdown
Member Author
image

Blue = participating, green = assigned

@danielbeardsley

Copy link
Copy Markdown
Member Author

dev_block 👍

Working on adding requested_reviewers here, as that was the actual intent.

Data pipeline (mirrors assignees): capture requested_reviewers from the
GitHub payload, persist to a new JSON column (migration 0021), and emit
to the frontend.

UI: treat assignees as additional authors — blue star when you are the
author or an assignee, otherwise the first author's avatar with all
authors listed on hover. Surface requested_reviewers as a blue star
before the "CR" text when a review is requested from you, whose hover
lists all requested reviewers. The participants indicator reverts to
participants-only.

Expand the pull-card demo with Authors and ReviewRequests examples and
give the dummy data assignees/requested_reviewers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@danielbeardsley

Copy link
Copy Markdown
Member Author
image

We now show the review requests (from you) as a star in the CR block. On hover, we list the requested reviewers.

Extend isMineViaAffiliation to cover pulls where you are an assignee
(via authoredByMe) or a requested reviewer, so Personal View surfaces
them alongside your authored/signed/blocked/participating pulls.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@danielbeardsley

Copy link
Copy Markdown
Member Author

un_dev_block 👍

This now includes requested reviewers. Updates the UI and has the "Personal View" reflect this:

it surfaces pulls you authored, are assigned to, or are a requested reviewer on

@danielbeardsley danielbeardsley changed the title Record PR assignees and surface them on the pull card Record PR assignees/requested reviewers and surface them on the pull card Jul 16, 2026
@danielbeardsley

Copy link
Copy Markdown
Member Author

Though when deploying this, I'm not seeing the requested_reviewers show up in the UI.

The data is in the DB (in dev) but it's not making it to the front-end.

dev_block 👍 I can't work on this right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant