Skip to content

Conversation

lunny
Copy link
Member

@lunny lunny commented Nov 9, 2018

Will also fix #5297

@lunny lunny added type/bug type/refactoring Existing code has been cleaned up. There should be no new functionality. labels Nov 9, 2018
@lunny lunny force-pushed the lunny/comment_list branch from f7fa13b to a1c66ea Compare November 9, 2018 11:35
@codecov-io
Copy link

codecov-io commented Nov 9, 2018

Codecov Report

Merging #5305 into master will increase coverage by 0.23%.
The diff coverage is 66.58%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5305      +/-   ##
==========================================
+ Coverage   41.45%   41.69%   +0.23%     
==========================================
  Files         414      414              
  Lines       55571    55970     +399     
==========================================
+ Hits        23039    23335     +296     
- Misses      29434    29506      +72     
- Partials     3098     3129      +31
Impacted Files Coverage Δ
models/issue.go 47.88% <0%> (-0.12%) ⬇️
models/issue_comment.go 46.91% <15.62%> (+0.57%) ⬆️
routers/api/v1/repo/issue_comment.go 54.51% <21.05%> (-1.58%) ⬇️
models/issue_comment_list.go 73.88% <73.85%> (+3.61%) ⬆️
models/repo_list.go 66.84% <0%> (-1.06%) ⬇️
routers/repo/view.go 42.07% <0%> (+0.99%) ⬆️
modules/log/event.go 65.98% <0%> (+1.52%) ⬆️
models/unit.go 14.28% <0%> (+14.28%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2262811...87cf98e. Read the comment docs.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 9, 2018
@lunny lunny added this to the 1.7.0 milestone Nov 9, 2018
return err
}

func (c *Comment) loadAttachements(e Engine) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/loadAttachements/loadAttachments/g 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@lunny lunny force-pushed the lunny/comment_list branch from a1c66ea to 25af6ff Compare November 11, 2018 04:57
return nil
}

// loadAttributes loads all attributes, expect for attachments and comments
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/expect/except

@zeripath
Copy link
Contributor

How does this work for issues with a large number of comments?

It looks like this is going to get everything in one go.

@lunny
Copy link
Member Author

lunny commented Nov 12, 2018

@zeripath This should have better performance than before when the issue has a large number of comments. The PR will reduce many database queries when loading comments attributes.

@lunny lunny force-pushed the lunny/comment_list branch from 9ef3ad9 to f5856fb Compare December 21, 2018 14:41
@lafriks
Copy link
Member

lafriks commented Dec 27, 2018

@lunny can you fix remainig issue with 500 error (see drone tests)

@jonasfranz
Copy link
Member

jonasfranz commented Jan 1, 2019

I think this enhancement may be included in a following rc of 1.7.0 since this is not a bug/security issue.

@lunny
Copy link
Member Author

lunny commented Jan 2, 2019

@lafriks @JonasFranzDEV will fix this.

@lunny lunny force-pushed the lunny/comment_list branch from ecac388 to cdf24fb Compare January 3, 2019 16:22
@lunny
Copy link
Member Author

lunny commented Jan 4, 2019

@lafriks @jonasfranz fixed.

@techknowlogick techknowlogick modified the milestones: 1.7.0, 1.8.0 Jan 5, 2019
@lunny lunny force-pushed the lunny/comment_list branch from cdf24fb to e2cecbb Compare January 14, 2019 07:20
@techknowlogick techknowlogick modified the milestones: 1.8.0, 1.9.0 Feb 19, 2019
@lunny lunny force-pushed the lunny/comment_list branch from e2cecbb to 66b687e Compare April 2, 2019 02:19
@lunny
Copy link
Member Author

lunny commented Apr 2, 2019

It's ready to review.

for _, comment := range comments {
if comment.Issue != nil {
_, ok := issues[comment.Issue.ID]
if !ok {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This should be like in other functions:

if _, ok := issues[comment.Issue.ID]; !ok {
    issues[comment.Issue.ID] = comment.Issue
}

@lunny lunny force-pushed the lunny/comment_list branch from 66b687e to fe5f0b7 Compare April 16, 2019 14:38
@lunny
Copy link
Member Author

lunny commented Apr 16, 2019

@lafriks done.
@zeripath please review.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 16, 2019
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 18, 2019
@techknowlogick techknowlogick merged commit dd1acd7 into go-gitea:master Apr 18, 2019
@lunny lunny deleted the lunny/comment_list branch April 18, 2019 06:50
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Page Crash on new issue
8 participants