[PR #3748] [MERGED] Pull request review/approval and comment on code #17069

Closed
opened 2025-11-02 12:25:34 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/3748
Author: @lafriks
Created: 4/2/2018
Status: Merged
Merged: 8/6/2018
Merged by: @jonasfranz

Base: masterHead: feat/approval


📝 Commits (10+)

  • 85e1ad5 Initial ui components for pull request review
  • 623a9f6 Add Review
  • aeb0577 Replace ReviewComment with Content
  • 2c18552 Add load functions
  • 9544c46 Add create review comment implementation
  • 0f772d1 Simplified create and find functions for review
  • 4ad563d Moved "Pending" to first position
  • 17af2d1 Add GetCurrentReview to simplify fetching current review
  • 75b7d9b Preview for listing comments
  • e252d3b Move new comment form to its own file

📊 Changes

40 files changed (+2010 additions, -89 deletions)

View changed files

📝 custom/conf/app.ini.sample (+2 -0)
📝 docs/content/doc/features/comparison.en-us.md (+2 -2)
📝 models/error.go (+22 -0)
📝 models/fixtures/comment.yml (+21 -0)
models/fixtures/review.yml (+32 -0)
📝 models/git_diff.go (+195 -11)
📝 models/git_diff_test.go (+105 -0)
📝 models/issue_comment.go (+282 -17)
📝 models/issue_comment_test.go (+18 -0)
📝 models/migrations/migrations.go (+3 -1)
models/migrations/v72.go (+31 -0)
📝 models/models.go (+1 -0)
📝 models/pull.go (+58 -6)
models/review.go (+256 -0)
models/review_test.go (+107 -0)
📝 modules/auth/repo_form.go (+39 -0)
📝 modules/setting/setting.go (+2 -0)
📝 modules/templates/helper.go (+26 -0)
📝 options/locale/locale_en-US.ini (+23 -3)
📝 public/css/index.css (+1 -1)

...and 20 more files

📄 Description

This is merge of my started work on PR approval feature and @lunny comment on code.

Will obsolete #2583 and resolve #124 and #3580

Screenshot:
attels

Work needs to be done:

  • Implement UI for code review and comments
  • Implement database changes and needed handlers
  • Review display in comment section
  • Add tests

EDIT by @JonasFranzDEV :
TODOs and other stuff from the merged PR lafriks/gitea#2:

This comment will summarize all progress and updates.

Reviews

Reviews should bundle all code comments created for the initial review. All code comments created for this review are linked to the review model.

Comment types

CommentTypeCode: A comment at a line of a code of a PR
CommentTypeReview: Notifies the participants about the review

TODO

  • Render code comments on the right place
  • Add support for comments on both sides
  • Show code comments in the "conversation" after a review got submitted
  • Show single code comment in the "conversation" (won't be implemented, because it would make the comment list bloated. GitHub only shows single comments in the diff view too)
  • Remove dummy data from "code comment form" (line, path, side)
  • Add support for "Add single comments"
  • Order/Separate code comments by thread/review (not implemented, see #4389)
    • At the moment only the first comment for a line gets shown in the conversation. No replies!
  • Blocked by go-gitea/git#116
  • Edit comments
  • Delete comments
  • Show actions / notifications for review comments
  • Show actions / notifications for review (without comments) (not implemented, see #4388)
  • Fix some problems with invalidating comments written for the previous code
  • Improve UI
    • Show comments only on one side (split view)
    • "Cancel" button functionality
    • Show add comment button only at PR diff views
    • Show forms only to signed in users
    • Preview tab is broken
    • Add icon is shown at hunk line

Preview(s)

comments_and_review
review comments
comment at conversation detail

EDIT END


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/3748 **Author:** [@lafriks](https://github.com/lafriks) **Created:** 4/2/2018 **Status:** ✅ Merged **Merged:** 8/6/2018 **Merged by:** [@jonasfranz](https://github.com/jonasfranz) **Base:** `master` ← **Head:** `feat/approval` --- ### 📝 Commits (10+) - [`85e1ad5`](https://github.com/go-gitea/gitea/commit/85e1ad593af5683a6b06db5b11a174b14308eff4) Initial ui components for pull request review - [`623a9f6`](https://github.com/go-gitea/gitea/commit/623a9f6e3c5047215cbb91d180fc0f19d5e109b6) Add Review - [`aeb0577`](https://github.com/go-gitea/gitea/commit/aeb057755aae700838dd78281be07f5f37858f94) Replace ReviewComment with Content - [`2c18552`](https://github.com/go-gitea/gitea/commit/2c1855257698bb61b4704b5bc8e8f9efae52b65c) Add load functions - [`9544c46`](https://github.com/go-gitea/gitea/commit/9544c46052114a1d11ed821f855969c4770f8aa7) Add create review comment implementation - [`0f772d1`](https://github.com/go-gitea/gitea/commit/0f772d1bf487c372ae90a507cb304537df53f1f7) Simplified create and find functions for review - [`4ad563d`](https://github.com/go-gitea/gitea/commit/4ad563d66f2b0a62c744ef47e420c269ea1fe690) Moved "Pending" to first position - [`17af2d1`](https://github.com/go-gitea/gitea/commit/17af2d17be915d9c9df092b391a5cbfa90ebf44c) Add GetCurrentReview to simplify fetching current review - [`75b7d9b`](https://github.com/go-gitea/gitea/commit/75b7d9b86aa424d4e12f94bd494d53ac546e9af5) Preview for listing comments - [`e252d3b`](https://github.com/go-gitea/gitea/commit/e252d3bdb54a3344f59ea2ce179a1925806e130d) Move new comment form to its own file ### 📊 Changes **40 files changed** (+2010 additions, -89 deletions) <details> <summary>View changed files</summary> 📝 `custom/conf/app.ini.sample` (+2 -0) 📝 `docs/content/doc/features/comparison.en-us.md` (+2 -2) 📝 `models/error.go` (+22 -0) 📝 `models/fixtures/comment.yml` (+21 -0) ➕ `models/fixtures/review.yml` (+32 -0) 📝 `models/git_diff.go` (+195 -11) 📝 `models/git_diff_test.go` (+105 -0) 📝 `models/issue_comment.go` (+282 -17) 📝 `models/issue_comment_test.go` (+18 -0) 📝 `models/migrations/migrations.go` (+3 -1) ➕ `models/migrations/v72.go` (+31 -0) 📝 `models/models.go` (+1 -0) 📝 `models/pull.go` (+58 -6) ➕ `models/review.go` (+256 -0) ➕ `models/review_test.go` (+107 -0) 📝 `modules/auth/repo_form.go` (+39 -0) 📝 `modules/setting/setting.go` (+2 -0) 📝 `modules/templates/helper.go` (+26 -0) 📝 `options/locale/locale_en-US.ini` (+23 -3) 📝 `public/css/index.css` (+1 -1) _...and 20 more files_ </details> ### 📄 Description This is merge of my started work on PR approval feature and @lunny comment on code. Will obsolete #2583 and resolve #124 and #3580 Screenshot: ![attels](https://user-images.githubusercontent.com/165205/38217623-b8da6334-36d7-11e8-9486-fa32b9421530.png) Work needs to be done: * [x] Implement UI for code review and comments * [x] Implement database changes and needed handlers * [x] Review display in comment section * [x] Add tests **EDIT by @JonasFranzDEV** : TODOs and other stuff from the merged PR lafriks/gitea#2: **This comment will summarize all progress and updates.** ## Reviews Reviews should bundle all code comments created for the initial review. All code comments created for this review are linked to the review model. ## Comment types `CommentTypeCode`: A comment at a line of a code of a PR `CommentTypeReview`: Notifies the participants about the review ## TODO - [x] Render code comments on the right place - [x] Add support for comments on both sides - [x] Show code comments in the "conversation" after a review got submitted - [x] ~~Show single code comment in the "conversation"~~ *(won't be implemented, because it would make the comment list bloated. GitHub only shows single comments in the diff view too)* - [x] Remove dummy data from "code comment form" (line, path, side) - [x] Add support for "Add single comments" - [x] ~~Order/Separate code comments by thread/review~~ *(not implemented, see #4389)* - **At the moment only the first comment for a line gets shown in the conversation. No replies!** - [x] ~~Blocked by go-gitea/git#116~~ - [x] Edit comments - [x] Delete comments - [x] Show actions / notifications for review comments - [x] ~~Show actions / notifications for review (without comments)~~ *(not implemented, see #4388)* - [x] Fix some problems with invalidating comments written for the previous code - Improve UI - [x] Show comments only on one side (split view) - [x] "Cancel" button functionality - [ ] Show add comment button only at PR diff views - [x] Show forms only to signed in users - [x] Preview tab is broken - [x] Add icon is shown at hunk line ## Preview(s) ![comments_and_review](https://user-images.githubusercontent.com/5757182/40015385-7af6b836-57b3-11e8-825a-6249e4954f5f.gif) ![review comments](https://user-images.githubusercontent.com/5757182/39921167-2c85ed7a-551a-11e8-816b-3a797015c725.png) ![comment at conversation detail](https://user-images.githubusercontent.com/5757182/40052986-ebb704c2-583f-11e8-8aa1-6d5c07e59044.png) **EDIT END** --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:25:34 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17069