Skip to content

fix(mywork): PR cards are structured-only — drop the legacy pr_summaries.summary - #27

Merged
AndresL230 merged 1 commit into
mainfrom
fix/mywork-drop-pr-summary
Jul 7, 2026
Merged

fix(mywork): PR cards are structured-only — drop the legacy pr_summaries.summary#27
AndresL230 merged 1 commit into
mainfrom
fix/mywork-drop-pr-summary

Conversation

@AndresL230

@AndresL230 AndresL230 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Problem

On My Work → Previous activity, a PR card rendered a raw "Summary" excerpt row whenever the capture-time Workers-AI summary fell back to the excerpt (i.e. what/why/impact all null — as happened to PR #321). A prose "Summary" row is the issue/todo surface; PR cards should be What changed / Why / Impact only.

Change — remove pr.summary end-to-end

  • render (web/src/render.ts): prActivityCard renders What changed / Why / Impact only. A PR with no structured summary shows a "No summary recorded" placeholder — the raw excerpt is never rendered.
  • DTO/query: drop summary from MyWorkPr (shared/dashboard.ts) and the getMyWork PR SELECT/mapping (src/tools/mywork.ts).
  • store (src/tools/summarize.ts): storePrSummary no longer mirrors whatsummary; a PR's excerpt fallback is now a content-less marker row (model='excerpt', null structured columns) that Sync retries.
  • schema: 0019_drop_pr_summary.sql drops the (NOT NULL) pr_summaries.summary column. issue_summaries is untouched — issues keep their prose summary.
  • seed + tests + CLAUDE.md updated.

Verification

  • npm run typecheck clean · npm run build:web clean
  • Full suite green: 53 files / 418 tests (migration 0019 applies cleanly in the test D1).

⚠️ Deploy ordering

pr_summaries.summary is still NOT NULL in prod and the new INSERT omits it, so apply the migration before deploying:

npm run db:migrate:remote   # applies 0019 (deploy does NOT auto-apply remote migrations)
npm run deploy

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • PR activity now uses structured summary fields, with a clearer “What changed” display on cards.
    • When no PR summary is available, users now see a “No summary recorded for this PR.” placeholder.
  • Bug Fixes

    • Dashboard and My Work views now consistently show the updated PR summary content.
    • Legacy prose summary fallbacks for PRs were removed, reducing mismatches between stored data and displayed content.

…ies.summary

My Work PR activity cards rendered a raw "Summary" excerpt row whenever the
Workers-AI summary fell back to the excerpt (what/why/impact null). That prose
"Summary" row is the issue/todo surface, not the PR surface. Remove pr.summary
end-to-end:

- render: prActivityCard shows What changed / Why / Impact only; a PR with no
  structured summary shows a "No summary recorded" placeholder (never the excerpt).
- DTO/query: drop `summary` from MyWorkPr and the getMyWork PR SELECT/mapping.
- store: storePrSummary no longer mirrors what→summary; a PR's excerpt fallback is
  now a content-less marker row (model='excerpt', null structured columns).
- schema: 0019 drops the NOT NULL pr_summaries.summary column. issue_summaries is
  untouched — issues keep their prose summary.
- seed + tests + CLAUDE.md updated. Full suite green (53 files / 418 tests).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
canopy 0814e75 Commit Preview URL

Branch Preview URL
Jul 07 2026, 07:47 AM

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 12391aba-1359-40c9-8512-8a7b9cc5e0b7

📥 Commits

Reviewing files that changed from the base of the PR and between d2e6287 and 0814e75.

📒 Files selected for processing (14)
  • CLAUDE.md
  • migrations/0019_drop_pr_summary.sql
  • scripts/seed/build.mjs
  • shared/dashboard.ts
  • shared/rows.ts
  • src/tools/mywork.ts
  • src/tools/summarize.ts
  • test/backfill.test.ts
  • test/dashboard-route.test.ts
  • test/mywork.test.ts
  • test/render.mywork.test.ts
  • test/structured-summary-schema.test.ts
  • test/summarize.test.ts
  • web/src/render.ts

📝 Walkthrough

Walkthrough

Drops the legacy prose summary column from pr_summaries via migration, removing prose-based PR summary handling in favor of structured title/what/why/impact fields. Updates storage logic, type definitions, queries, rendering fallback, seed scripts, documentation, and corresponding tests.

Changes

Structured-only PR summaries

Layer / File(s) Summary
Migration and storage logic
migrations/0019_drop_pr_summary.sql, src/tools/summarize.ts
Migration drops pr_summaries.summary; storePrSummary now inserts structured fields and writes a model='excerpt' marker row with null structured columns on failure instead of prose.
Type and query updates for MyWork
shared/rows.ts, shared/dashboard.ts, src/tools/mywork.ts
PrSummaryRow, MyWorkPr, and PrEventJoinRow drop the summary field; getMyWork SQL join and mapping no longer select/assign it.
PR activity card rendering
web/src/render.ts
prActivityCard replaces the prose “Summary” row with a “What changed” row showing “No summary recorded for this PR.” when pr.what is null.
Seed script and docs
scripts/seed/build.mjs, CLAUDE.md
Seed SQL inserts structured columns instead of prose summary; docs explain the PR vs. issue AI-failure fallback distinction.
Test suite updates
test/backfill.test.ts, test/dashboard-route.test.ts, test/mywork.test.ts, test/render.mywork.test.ts, test/structured-summary-schema.test.ts, test/summarize.test.ts
Assertions updated across the suite to validate structured what/why/impact fields instead of the removed summary field.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • SaplingLearn/canopy#11: Both PRs migrate PR summaries from prose summary to structured what/why/impact fields across storage and rendering.
  • SaplingLearn/canopy#21: Both PRs touch scripts/seed/build.mjs's pr_summaries seeding via buildSeedStatements, replacing prose summary with structured columns.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mywork-drop-pr-summary

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AndresL230
AndresL230 merged commit 2fc1585 into main Jul 7, 2026
1 of 2 checks passed
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