- Remove commit_comment junction table, query Comment directly via
repo_id + commit_sha + type filter
- Add RepoID column to Comment (migration v326)
- Add reqRepoCodeWriter permission checks to all commit comment routes
- Fix delete auth: use CanWrite(TypeCode) instead of IsAdmin()
- Fix CanComment: gate on write access, not read
- Guard LoadIssue against IssueID=0 (commit comments have no issue)
- Extract duplicated markdown rendering loop in commit.go
- Fix template dict keys: use "root" instead of "."
- Show delete button for users with code write access
- Add unit tests for create, delete, get, find operations
- use single query with Cols("comment_id").Table("commit_comment")
instead of loading full CommitComment structs
- remove models/repo/commit_comment.go entirely
Per @lunny's feedback, rework to reuse the existing Comment table
instead of a standalone commit_comment table. The junction table
(commit_comment) now only stores repo_id, commit_sha, comment_id.
Actual comment data (content, tree_path, line, patch, poster) lives
in the Comment table with Type = CommentTypeCommitComment (39).
This gives commit comments reactions, attachments, and all existing
comment infrastructure for free.