fix(repair): pick_freshest compares commit_ts; add latest-commit-wins example#152
fix(repair): pick_freshest compares commit_ts; add latest-commit-wins example#152mason-sharp wants to merge 2 commits into
Conversation
pick_freshest resolved its `key` only from the stripped diff row, but
commit_ts (and other spock metadata) are moved into n1Meta/n2Meta during
diff loading. So `pick_freshest: {key: commit_ts}` found nil on both sides
and fell back to `tie` every time, never actually comparing timestamps.
Resolve the key via lookupValue, which falls back to the metadata map, so
`key: commit_ts` compares commit timestamps while ordinary data columns
(e.g. updated_at) keep working.
Tests:
- unit: commit_ts-from-meta (both directions), one-side-null (the side with
a timestamp wins), both-null (tie), and app-column-from-row.
- integration: one-pass latest-commit-wins end-to-end (newer commit_ts side
wins) and pick_freshest by an app-level column (subscription_date).
Add examples/repair-plan-latest-wins.yaml (fully commented, one-pass pick_freshest by commit_ts, shared across tables via a YAML anchor, with opt-in alternatives and a per-table override) and a "5g" section to advanced-repair-examples.md documenting the pattern, per-case resolution, and the caveats: positional n1/n2, track_commit_timestamp, string comparison, last-write-wins, and when commit_ts actually goes NULL.
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 4 critical (4 false positives) |
🟢 Metrics 8 complexity · 8 duplication
Metric Results Complexity 8 Duplication 8
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
pick_freshest with key: commit_ts never actually compared commit timestamps — it read the key from the stripped diff row (where commit_ts has been moved into spock_metadata), found nil on both sides, and fell back to tie every time. This fixes it and documents a one-pass "latest commit wins" repair pattern.
Changes
Notes