tg pr comment (and tg issue comment) write records that Tangled's appview silently drops, so the comment never shows up on the PR or issue page. It looks like it worked -- tg prints the new record's at-uri and exits 0 -- but the comment is gone.
What's happening #
tg writes comments as sh.tangled.repo.pull.comment / sh.tangled.repo.issue.comment records. Tangled deprecated both collections. In appview/ingester.go, the handlers for them are no-ops on create/update:
// ingestPullComment ingests legacy sh.tangled.repo.pull.comment deletions
func (i *Ingester) ingestPullComment(e *jmodels.Event, l *slog.Logger) error {
switch e.Commit.Operation {
case jmodels.CommitOperationCreate, jmodels.CommitOperationUpdate:
// no-op. sh.tangled.repo.pull.comment is deprecated
case jmodels.CommitOperationDelete:
// ... deletes still processed
}
}
Same for ingestIssueComment. Deletes still go through, but anything you create is ignored. The record sits on your PDS, valid and well-formed, and the appview never reads it. I only noticed because a comment I posted with tg pr comment never rendered, and I had to go read the ingester to find out why.
What Tangled uses now #
Comments live in sh.tangled.feed.comment (FeedComment), which the appview ingests via ingestComment. It's a different shape:
subjectis acom.atproto.repo.strongRef(uri + cid) pointing at the pull or issue, not a barepull/issueat-uri string.bodyis a union (sh.tangled.markup.markdown), not a plain string.pullRoundIdxis an integer, required when the subject is a pull -- this is how a comment attaches to a specific review round.
tg v0.4.0 doesn't have the feed.comment schema at all. It only vendors the deprecated pulls/comment.json and issue/comment.json, so there's no code path that writes a comment the current appview will accept.
The fix #
tg pr comment and tg issue comment need to write sh.tangled.feed.comment records: build a strongRef to the pull/issue (which means resolving the subject's current cid), wrap the body in the markdown union, and set pullRoundIdx for pulls. Until then both subcommands are effectively broken -- they report success and produce nothing.
Repro: tg pr comment <rkey> -R <owner>/<repo> -b "test" on any open PR, then check the PR page. The comment won't be there, but the record exists on your PDS.
Found on tg 0.4.0 while commenting on a PR from the CLI.
oh the joys of a moving platform 😉 appreciate the reports, I'll fix these soon!