Repository navigation
fix(ingest): scope body ledger rows to their PR or issue - #1270
Conversation
ledgerRowsForSource matched on repo + source only, and every PR and issue in a repo has a "body" source. Reconciling any one body therefore detached the imported attachments of every other PR and issue in the repo. Match on kind and number too, like the adopt ledger does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CvhtYD1ej6agd8LiARpXp
|
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 2
🚫 Excluded labels (none allowed): 1
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Requested by Zach · project thread
Why
ledgerRowsForSourcematched rows onrepo+sourceonly. Every PR and issue in a repo has a"body"source, so reconciling any one body detached the imported attachments of every other PR and issue in that repo.Found while verifying #1269 on sunny-sdk/sunny#3332. Its two imports were ledgered at 16:20 and then detached at 16:52, even though both images are still in the description and the PR hadn't changed since 16:09. Every older imported row for sunny-sdk/sunny is detached the same way. After #1269, a detached import also drops out of the managed comment, so the bug is now visible on GitHub, not only in the index.
What
ledgerRowsForSource(db, repo, kind, num, source)now matcheskindandnumtoo, the same way the adopt ledger (adoptLedgerRowsForSource) already does.Rows already detached by this bug reattach the next time their target reconciles: a body edit, or
uploads ingest --pr N.Tests
apps/apivitest: 3503 passed.pnpm typecheckand prettier pass.Generated by Claude Code