fix(github,linear): emit comments as directory records to prevent file/dir collisions - #165
Conversation
…file/dir collision A GitHub issue comment and a Linear comment were emitted as flat leaf files (`issues/<n>__<slug>/comments/<id>.json`, `/linear/comments/<name>__<id>.json`) — the same latent shape that wedged Slack mounts (dea03fc, f5ca1ce, PR #162): once any child resource nests under the comment id (GitHub exposes per-comment reactions at /repos/{o}/{r}/issues/comments/{id}/reactions; Linear has per-comment emoji reactions — the webhook normalizer already recognizes 'reaction' payloads — and threaded replies), one name must be both a file and a directory, which cannot be materialized on a POSIX mount (`mkdir ... : not a directory`) and wedges the whole mirror. Apply the Slack directory-record pattern to both adapters: GitHub: - `githubIssueCommentPath` → `comments/<id>/meta.json`; add `githubIssueCommentLegacyPath` + `githubIssueCommentReadCandidatePaths` (mirrors slack threadReplyPath / threadReplyLegacyPath / slackThreadReplyReadCandidatePaths). - `mapIssueComment` and `computeScopedPath('issue_comment')` emit the directory record. - `ISSUE_COMMENT_WRITEBACK_PATH` accepts both `<id>/meta.json` and the legacy `<id>.json`, so patches against either mirror generation route. - Regenerated `resources.ts` / discovery `.adapter.md`: issue-comments pathPattern matches `/meta.json`, idPattern accepts the `meta` stem (handler re-derives the numeric id from the full path, like slack messages). - LAYOUT.md prompt documents the comment directory record. Linear: - `linearCommentPath` → `/linear/comments/<name>__<id>/meta.json`; add `linearCommentLegacyPath` + `linearCommentReadCandidatePaths`. - Comment delete tombstones target both the directory record and the legacy flat leaf so pre-migration mirrors are cleaned. - Linear writeback needs no route change: comment create drafts live in the separate `/linear/issues/{issueId}/comments/` tree. - LAYOUT.md prompt + discovery read-path docs updated. Both: regression tests pinning the directory-record path, the child-nesting invariant, and the read-candidate fallback order, mirroring the slack collision tests. New docs/architecture/writeback-resource-patterns.md explains the collision and the migration recipe so future adapters don't reintroduce the flat-leaf shape. Writeback-paths catalog: no regeneration needed — resource path templates are unchanged (`writeback-paths check` clean). Full repo suite green (85 turbo tasks); writeback discovery (82 endpoints), digest contracts, and internal-dependency checks clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reached
More reviews will be available in 54 minutes and 6 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (46)
✨ 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 |
|
Implemented fixes for the PR and downstream breakage I found. Key fixes:
Addressed comments
Advisory NotesNone. VerificationLocal verification passed on the current working tree:
I’m not printing |
|
Implemented the scoped PR fixes I found. Changes made:
Addressed comments
Advisory NotesNone. Local validation:
|
|
Implemented fixes from the PR review and verified them locally. Key fixes:
Addressed comments
Advisory Notes
Verification passed:
|
Incorporates dropbox folders/shared-folders/shared-links resources added upstream plus updated github/linear comment dir-record path patterns. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
Backports the Slack thread-reply collision fix (dea03fc / f5ca1ce, PR #162) to the two adapters with the same latent pattern. Both emit comments as flat
comments/{id}.jsonleaves; any future child resources nesting undercomments/{id}/(GitHub exposes per-comment reactions as a child collection; Linear has per-comment emoji reactions and threaded replies) would collide on POSIX mounts — the exact failure that broke Slack mirrors.issues/<n>__<slug>/comments/<id>/meta.json(githubIssueCommentPath+ legacy/read-candidate helpers);ISSUE_COMMENT_WRITEBACK_PATHaccepts both new and legacy forms so patches route for either mirror generation.linearCommentPath→/linear/comments/<name>__<id>/meta.jsonwith legacy read candidates; delete tombstones target both forms. Writeback routes unchanged (create drafts live in the separate per-issue tree).[current, legacy].docs/architecture/writeback-resource-patterns.mddocuments the collision risk + 7-step directory-record migration recipe for future adapter authors.Tests
Collision regression tests in both adapters (directory-record path, child-nesting invariant, read-candidate fallback) + directory-record writeback patch test. Full repo green: 85 turbo test tasks (github 286, linear 131, slack 93), discovery verification, digest contracts, typecheck.
scripts/writeback-discovery-data.mjs— merge one, regenerate, then merge the other.🤖 Generated with Claude Code