summaryrefslogtreecommitdiffstats
path: root/services/pull/review.go
Commit message (Collapse)AuthorAgeFilesLines
* Fix a couple of CommentAsPatch issues. (#14804) (#14820)zeripath2021-02-281-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | Backport #14804 * CutDiffAroundLine makes the incorrect assumption that `---` and `+++` always represent part of the header of a diff. This PR adds a flag to its parsing to prevent this problem and adds a streaming parsing technique to CutDiffAroundLine using an io.pipe instead of just sending data to an unbounded buffer. Fix #14711 * Handle unquoted comment patch files When making comment patches unfortunately the patch does not always quote the filename This makes the diff --git header ambiguous again. This PR finally adds handling for ambiguity in to parse patch Fix #14812 * Add in testing for no error There is no way currently for CutDiffAroundLine in this test to cause an error however, it should still be tested. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Send notifications for mentions in pulls, issues, (code-)comments (#14218) ↵Jimmy Praet2021-01-031-2/+25
| | | | | (#14221) Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* always use headCommitID for review comment diff (#14011)Jimmy Praet2020-12-161-7/+7
|
* Replies to outdated code comments should also be outdated (#13217) (#13433)65432020-11-051-24/+59
| | | | | | | | | | | | | | | | | | | | * When replying to an outdated comment it should not appear on the files page This happened because the comment took the latest commitID as its base instead of the reviewID that it was replying to. There was also no way of creating an already outdated comment - and a reply to a review on an outdated line should be outdated. Signed-off-by: Andrew Thornton <art27@cantab.net> * fix test Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add team support for review request (#12039)赵智超2020-10-121-3/+2
| | | | | | | | | | | Add team support for review request Block #11355 Signed-off-by: a1012112796 <1012112796@qq.com> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Fix error create comment on outdated file (#13041)65432020-10-051-1/+4
| | | | | | | * FIX * more specific Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Prevent NPE on commenting on lines with invalidated comments (with ↵zeripath2020-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | migration) (#12549) * Prevent NPE on commenting on lines with invalidated comments Only check for a review if we are replying to a previous review. Prevent the NPE in #12239 by assuming that a comment without a Review is non-pending. Fix #12239 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add hack around to show the broken comments Signed-off-by: Andrew Thornton <art27@cantab.net> * Add migration and remove template hacks Signed-off-by: Andrew Thornton <art27@cantab.net>
* Display pull request head branch even the branch deleted or repository ↵Lunny Xiao2020-03-021-2/+2
| | | | | | | | | | | | | | | | deleted (#10413) * Display pull request head branch even the branch deleted or repository deleted * Merge getHeadRepo/loadHeadRepo and getBaseRepo/loadBaseRepo on pull and fill repo when pr.Issue.Repo is available * retrieve sha from pull head when pull request branch deleted and fix tests * Fix test * Ensure MustHeadRepoName returns empty string if no head repo Co-authored-by: zeripath <art27@cantab.net>
* Some refactor on git diff and ignore getting commit information failed on ↵Lunny Xiao2020-01-281-3/+2
| | | | | | | | | | | | | | migrating pull request review comments (#9996) * Some refactor on git diff and ignore getting commit information failed on migrating pull request review comments * fix test * fix lint * Change error log to warn
* Mark PR reviews as stale at push and allow to dismiss stale approvals (#9532)David Svantesson2020-01-091-5/+26
| | | | | | | Fix #5997. If a push causes the patch/diff of a PR towards target branch to change, all existing reviews for the PR will be set and shown as stale. New branch protection option to dismiss stale approvals are added. To show that a review is not based on the latest PR changes, an hourglass is shown
* remove unused method and rename createcommentWithNoAction (#9367)Lunny Xiao2019-12-161-1/+1
|
* Branch protection: Possibility to not use whitelist but allow anyone with ↵David Svantesson2019-12-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | write access (#9055) * Possibility to not use whitelist but allow anyone with write access * fix existing test * rename migration function * Try to give a better name for migration step * Clear settings if higher level setting is not set * Move official reviews to db instead of counting approvals each time * migration * fix * fix migration * fix migration * Remove NOT NULL from EnableWhitelist as migration isn't possible * Fix migration, reviews are connected to issues. * Fix SQL query issues in GetReviewersByPullID. * Simplify function GetReviewersByIssueID * Handle reviewers that has been deleted * Ensure reviews for test is in a well defined order * Only clear and set official reviews when it is an approve or reject.
* Extract createComment (#9125)Lunny Xiao2019-11-301-2/+1
| | | | | | | | * Extract createComment * fix lint * fix lint
* Fix show single review comments in the PR page (#9143)guillep2k2019-11-241-3/+29
|
* Refactor pull request review (#8954)Lunny Xiao2019-11-141-12/+124
| | | | | | | | | | | | | | | | | | * refactor submit review * remove unnecessary code * remove unused comment * fix lint * remove duplicated actions * remove duplicated actions * fix typo * fix comment content
* Don't send notification on pending reviews (#8943)guillep2k2019-11-131-1/+3
|
* Move pull webhook to notification (#8805)Lunny Xiao2019-11-051-41/+6
| | | | | | * Move pull webhook to notification * fix fmt
* Rename HookQueue to hookQueue (#8778)Lunny Xiao2019-11-021-7/+2
| | | | | | * Rename HookQueue to hookQueue * fix lint
* Move webhook to a standalone package under modules (#8747)Lunny Xiao2019-11-011-2/+3
| | | | | | | | * Move webhook to a standalone package under modules * fix test * fix comments
* Improve webhooks (#8583)John Olheiser2019-10-181-1/+4
| | | | | | | | | | | | | | * Improve webhooks Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update MSTeams and ReviewPayload comment Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add repo.FullName to comments Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix review webhooks (#8570)John Olheiser2019-10-181-13/+27
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Extract actions on new pull request from models to pulls service and move ↵Lunny Xiao2019-09-271-0/+57
code.gitea.io/gitea/modules/pull to code.gitea.io/gitea/services/pull (#8218) * extract actions on new pull request from models to pulls service * improve code * move code.gitea.io/gitea/modules/pull to code.gitea.io/gitea/services/pull * fix fmt * Rename pulls.go to pull.go