Skip to content

crit push doesn't post replies to imported remote comments #442

@tomasz-tomczyk

Description

@tomasz-tomczyk

Repro

Discovered via the GitHub roundtrip integration harness (TestRoundtrip_ReplyToRemoteComment).

  1. A remote (GitHub PR) review comment exists on a line.
  2. Run crit pull — the comment is imported into the local review file with a fresh local string ID and github_id set.
  3. Run crit comment --reply-to <local-id> "ack" — the reply is appended locally under the imported comment's replies.
  4. Run crit push.

Expected: a new GitHub PR review comment is posted with in_reply_to: <parent github_id>, so it appears as a threaded reply.

Actual: crit push posts nothing. Remote comment count is unchanged.

=== RUN   TestRoundtrip_ReplyToRemoteComment
    roundtrip_integration_test.go:189: want 1 new remote item, got 0:
          id=3180419068 parent=0 path=sample.go line=19 body=please address
--- FAIL: TestRoundtrip_ReplyToRemoteComment (11.28s)

Likely cause

crit push probably treats the imported root as already-synced (it has a github_id) and only walks new top-level comments, skipping fresh local replies whose parent has a github_id. Reply-push logic likely only fires for replies whose parent was authored locally.

Sandbox

crit-md/crit-roundtrip-sandbox. Reproduces deterministically against PR #1 with the harness in crit.pr-roundtrip-harness branch (test file: roundtrip_integration_test.go::TestRoundtrip_ReplyToRemoteComment).

Scope

Test-only investigation — production fix tracked here, not in the harness branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions