* issue content history
* Use timeutil.TimeStampNow() for content history time instead of issue/comment.UpdatedUnix (which are not updated in time)
* i18n for frontend
* refactor
* clean up
* fix refactor
* re-format
* temp refactor
* follow db refactor
* rename IssueContentHistory to ContentHistory, remove empty model tags
* fix html
* use avatar refactor to generate avatar url
* add unit test, keep at most 20 history revisions.
* re-format
* syntax nit
* Add issue content history table
* Update models/migrations/v197.go
Co-authored-by: 6543 <[email protected]>
* fix merge
Co-authored-by: zeripath <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
* DBContext is just a Context
This PR removes some of the specialness from the DBContext and makes it context
This allows us to simplify the GetEngine code to wrap around any context in future
and means that we can change our loadRepo(e Engine) functions to simply take contexts.
Signed-off-by: Andrew Thornton <[email protected]>
* fix unit tests
Signed-off-by: Andrew Thornton <[email protected]>
* another place that needs to set the initial context
Signed-off-by: Andrew Thornton <[email protected]>
* avoid race
Signed-off-by: Andrew Thornton <[email protected]>
* change attachment error
Signed-off-by: Andrew Thornton <[email protected]>
This PR adds a `ListOptions` type which is not paged but uses absolute values. It is implemented as discussed in Discord.
Extracted from #16510 to clean that PR.
* Add info about list endpoints to CONTRIBUTING.md
* Let all list endpoints return X-Total-Count header
* Add TODOs for GetCombinedCommitStatusByRef
* Fix models/issue_stopwatch.go
* Rrefactor models.ListDeployKeys
* Introduce helper func and use them for SetLinkHeader related func
* chore: rewrite format.
* chore: update format
Signed-off-by: Bo-Yi Wu <[email protected]>
* chore: update format
Signed-off-by: Bo-Yi Wu <[email protected]>
* chore: Adjacent parameters with the same type should be grouped together
* chore: update format.
* refactor models.DeleteComment and delete related reactions too
* use deleteComment for UserDeleteWithCommentsMaxDays in DeleteUser
* nits
* Use time.Duration as other time settings have
* docs
* Resolve Fixme & fix potential deadlock
* Disabled by Default
* Update Config Value Description
* switch args
* Update models/issue_comment.go
Co-authored-by: zeripath <[email protected]>
Co-authored-by: zeripath <[email protected]>
Fixed#8861
* use ajax on PR review page
* handle review comments
* extract duplicate code
FetchCodeCommentsByLine was initially more or less copied from fetchCodeCommentsByReview. Now they both use a common findCodeComments function instead
* use the Engine that was passed into the method
Co-authored-by: 6543 <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
* remove github.com/unknwon/com from models
* dont use "com.ToStr()"
* replace "com.ToStr" with "fmt.Sprint" where its easy to do
* more refactor
* fix test
* just "proxy" Copy func for now
* as per @lunny
* 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 <[email protected]>
* fix test
Signed-off-by: Andrew Thornton <[email protected]>
* Fix broken migration
Signed-off-by: Andrew Thornton <[email protected]>
* fix mssql
Signed-off-by: Andrew Thornton <[email protected]>
* Create temporary table because ... well MSSQL ...
Signed-off-by: Andrew Thornton <[email protected]>
* Create temporary table because ... well MSSQL ...
Signed-off-by: Andrew Thornton <[email protected]>
* Create temporary table because ... well MSSQL ...
Signed-off-by: Andrew Thornton <[email protected]>
* fix mssql
Signed-off-by: Andrew Thornton <[email protected]>
* move session within the batch
Signed-off-by: Andrew Thornton <[email protected]>
* regen the sqlcmd each time round the loop
Signed-off-by: Andrew Thornton <[email protected]>
* as per @lunny
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
* 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 <[email protected]>
* fix test
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
* Create function to group label comments
* Combine multiple label additions into one
* Group removed and added labels in the same comment
* Fix indentation on comments.tmpl
Co-authored-by: zeripath <[email protected]>
Co-authored-by: zeripath <[email protected]>
* Add comment on non-unicode line to force fail
Signed-off-by: Andrew Thornton <[email protected]>
* Just quote/unquote patch
Signed-off-by: Andrew Thornton <[email protected]>
* Invalidate comments when file is shortened
Fix#10686
Signed-off-by: Andrew Thornton <[email protected]>
* handle 1 line
Signed-off-by: Andrew Thornton <[email protected]>
* Add a way to mark Conversation (code comment) resolved
mark Conversation is a way to mark a Conversation is stale
or be solved. when it's marked as stale, will be hided like
stale. all Pull Request writer , Offical Reviewers and poster
can add or remove Conversation resolved mark.
Signed-off-by: a1012112796 <[email protected]>
* fix lint
* Apply suggestions from code review
* Add ResolveDoer
* fix ui
Co-Authored-By: Lauris BH <[email protected]>
Co-Authored-By: 6543 <[email protected]>
* change IsResolved to an function
Add permission check in UpdateResolveConversation
* Apply suggestions from code review
* change return error for permisson check
* add default message for deleted user
* get issue message from comment
* add migration for ``ResolveDoerID`` column
another change:
* block mark pending review as resolved because it's not necessary
Co-authored-by: guillep2k <[email protected]>
* change button color
* resolve button size
* fix code style
* remove unusefull code
Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: guillep2k <[email protected]>
* add request review feature in pull request
add a way to notify specific reviewers to review like github , by add or delet a special type
review . The acton is is similar to Assign , so many code reuse the function and items of
Assignee, but the meaning and result is different.
The Permission style is is similar to github, that only writer can add a review request from Reviewers,
but the poster can recall and remove a review request after a reviwer has revied even if he don't have
Write Premission. only manager , the poster and reviewer of a request review can remove it.
The reviewers can be requested to review contain all readers for private repo , for public, contain
all writers and watchers.
The offical Review Request will block merge if Reject can block it.
an other change: add ui otify for Assignees.
Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Signed-off-by: a1012112796 <[email protected]>
* new change
* add placeholder string
* do some changes follow #10238 to add review requests num on lists also
change icon for review requests to eye
Co-authored-by: Lauris BH <[email protected]>
* introduce GET /notifications/new
* add TEST
* use Sprintf instead of path.Join
* Error more verbose
* return number of notifications if unreaded exist
* 200 http status for available notifications
* Adds functionality to change target branch of created pull requests
Signed-off-by: Mario Lubenka <[email protected]>
* Use const instead of var in JavaScript additions
Signed-off-by: Mario Lubenka <[email protected]>
* Check if branches are equal and if PR already exists before changing target branch
Signed-off-by: Mario Lubenka <[email protected]>
* Make sure to check all commits
Signed-off-by: Mario Lubenka <[email protected]>
* Print error messages for user as error flash message
Signed-off-by: Mario Lubenka <[email protected]>
* Disallow changing target branch of closed or merged pull requests
Signed-off-by: Mario Lubenka <[email protected]>
* Resolve conflicts after merge of upstream/master
Signed-off-by: Mario Lubenka <[email protected]>
* Change order of branch select fields
Signed-off-by: Mario Lubenka <[email protected]>
* Removes duplicate check
Signed-off-by: Mario Lubenka <[email protected]>
* Use ctx.Tr for translations
Signed-off-by: Mario Lubenka <[email protected]>
* Recompile JS
Signed-off-by: Mario Lubenka <[email protected]>
* Use correct translation namespace
Signed-off-by: Mario Lubenka <[email protected]>
* Remove redundant if condition
Signed-off-by: Mario Lubenka <[email protected]>
* Moves most change branch logic into pull service
Signed-off-by: Mario Lubenka <[email protected]>
* Completes comment
Signed-off-by: Mario Lubenka <[email protected]>
* Add Ref to ChangesPayload for logging changed target branches
instead of creating a new struct
Signed-off-by: Mario Lubenka <[email protected]>
* Revert changes to go.mod
Signed-off-by: Mario Lubenka <[email protected]>
* Directly use createComment method
Signed-off-by: Mario Lubenka <[email protected]>
* Return 404 if pull request is not found. Move written check up
Signed-off-by: Mario Lubenka <[email protected]>
* Remove variable declaration
Signed-off-by: Mario Lubenka <[email protected]>
* Return client errors on change pull request target errors
Signed-off-by: Mario Lubenka <[email protected]>
* Return error in commit.HasPreviousCommit
Signed-off-by: Mario Lubenka <[email protected]>
* Adds blank line
Signed-off-by: Mario Lubenka <[email protected]>
* Test patch before persisting new target branch
Signed-off-by: Mario Lubenka <[email protected]>
* Update patch before testing (not working)
Signed-off-by: Mario Lubenka <[email protected]>
* Removes patch calls when changeing pull request target
Signed-off-by: Mario Lubenka <[email protected]>
* Removes unneeded check for base name
Signed-off-by: Mario Lubenka <[email protected]>
* Moves ChangeTargetBranch completely to pull service. Update patch status.
Signed-off-by: Mario Lubenka <[email protected]>
* Set webhook mode after errors were validated
Signed-off-by: Mario Lubenka <[email protected]>
* Update PR in one transaction
Signed-off-by: Mario Lubenka <[email protected]>
* Move logic for check if head is equal with branch to pull model
Signed-off-by: Mario Lubenka <[email protected]>
* Adds missing comment and simplify return
Signed-off-by: Mario Lubenka <[email protected]>
* Adjust CreateComment method call
Signed-off-by: Mario Lubenka <[email protected]>