fix: atomically dedupe GitHub lifecycle aliases#163
Conversation
|
Warning Review limit reached
Next review available in: 53 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 Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughDispatch lifecycle claims now match equivalent GitHub issue paths, adopt one persisted lifecycle across aliases, return its canonical key, and use that key for orchestrator epoch tracking. Tests cover file and in-memory stores plus legacy persisted watch state. ChangesGitHub lifecycle alias adoption
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Factory
participant StateStore
participant IdentityMatcher
participant LifecycleRecord
Factory->>StateStore: claim dispatch lifecycle by requested key
StateStore->>IdentityMatcher: match GitHub issue identity
IdentityMatcher->>LifecycleRecord: inspect existing lifecycle entries
LifecycleRecord-->>IdentityMatcher: canonical lifecycle entry
IdentityMatcher-->>StateStore: canonical key and lifecycle
StateStore-->>Factory: claim with persisted key and epoch
Factory->>Factory: record epoch under canonical key
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to atomically adopt existing GitHub lifecycles across Relayfile issue aliases, ensuring that logical GitHub identities are matched before creating new rows. The changes include updates to the state stores, the addition of matching logic in a new helper file, and comprehensive test coverage. The review feedback suggests several improvements to the new helper functions: adding defensive checks to prevent runtime TypeErrors when accessing issue paths, optimizing the matching function to run in a single pass (O(N) complexity) instead of sorting, and defensively handling potentially missing updatedAtMs values to avoid NaN comparison results.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Prevents Relayfile by-id and slugged meta.json paths for the same GitHub issue from creating separate durable dispatch lifecycles.
The state-store claim now resolves the logical GitHub identity under the same mutation lock, adopts the existing persisted key, and returns that actual key for lease fencing. Historical duplicate cleanup remains covered.
Verification: