0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-03 23:22:39 +02:00

5 Commits

Author SHA1 Message Date
yuvrajangadsingh
f8fb20aa75 fix: address review feedback on permissions and poster loading 2026-04-02 16:56:30 +05:30
yuvrajangadsingh
80cea11be0 refactor: drop junction table, add RepoID to Comment model
- 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
2026-04-02 16:56:30 +05:30
yuvrajangadsingh
0f4ebcba10 fix: address review - add archive check, verify repo ownership, remove path fallback 2026-04-02 16:55:52 +05:30
yuvrajangadsingh
17c3b06b21 fix: address lunny's review comments
- use single query with Cols("comment_id").Table("commit_comment")
  instead of loading full CommitComment structs
- remove models/repo/commit_comment.go entirely
2026-04-02 16:55:52 +05:30
yuvrajangadsingh
3a08115768 refactor: use Comment table with junction table for commit comments
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.
2026-04-02 16:55:52 +05:30