Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor mail notification #5110

Merged
merged 3 commits into from
Jan 13, 2019
Merged

Conversation

lunny
Copy link
Member

@lunny lunny commented Oct 19, 2018

extract from #4001

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Oct 19, 2018
@lunny lunny added this to the 1.7.0 milestone Oct 19, 2018
@codecov-io
Copy link

codecov-io commented Oct 19, 2018

Codecov Report

Merging #5110 into master will decrease coverage by 0.02%.
The diff coverage is 21.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5110      +/-   ##
==========================================
- Coverage   37.78%   37.75%   -0.03%     
==========================================
  Files         323      325       +2     
  Lines       47596    47638      +42     
==========================================
+ Hits        17986    17988       +2     
- Misses      27025    27056      +31     
- Partials     2585     2594       +9
Impacted Files Coverage Δ
models/issue.go 47.72% <ø> (+0.12%) ⬆️
models/pull.go 50.75% <ø> (+0.1%) ⬆️
modules/notification/ui/ui.go 80.48% <ø> (+21.55%) ⬆️
models/issue_comment.go 46.66% <100%> (+0.05%) ⬆️
modules/notification/notification.go 28.88% <100%> (+0.79%) ⬆️
modules/notification/mail/mail.go 20% <20%> (ø)
modules/notification/base/null.go 9.09% <9.09%> (ø)
models/repo_indexer.go 44.49% <0%> (-3.82%) ⬇️
... 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 e5228b8...b3f3a13. Read the comment docs.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 19, 2018
@lunny
Copy link
Member Author

lunny commented Oct 19, 2018

extract from #4001

Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

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

I don't much like having the multiple empty functions. I guess we need to move to more generic notify interface with typed event objects? Does accepting this PR help with that move or Is there a current bug that needs this?

I guess this PR helps to place things in to standard structure but I think that this might be better shown as a commit in a well structured PR that would compile and pass the tests at each step along the way. Was this extracted from such a larger commit?

@@ -0,0 +1,126 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Could you update the date to 2019?

@lunny
Copy link
Member Author

lunny commented Jan 13, 2019

@zeripath This PR is focus on refactoring. It makes the notification interface clearer to add new feature or find the bugs. But I haven't fix any bug or implement new feature in this PR. I think that's why there are so many blank functions here. I think further PR could do that. This is extract from #4001, but that PR is too big to review.

@zeripath
Copy link
Contributor

OK, can we create a NullNotifier that has these empty methods, then change the definition of mailNotifier to be:

type mailNotifier {
   NullNotifier
}

and then just reimplement the methods that need reimplementing? I appreciate that that just moves these empty methods elsewhere but then implementing a notifier becomes much easier.

@lunny
Copy link
Member Author

lunny commented Jan 13, 2019

@zeripath good idea & done.

Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

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

Thanks @lunny !

@bkcsoft bkcsoft 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 Jan 13, 2019
@bkcsoft bkcsoft 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 Jan 13, 2019
@lafriks lafriks merged commit beab2df into go-gitea:master Jan 13, 2019
@lunny lunny deleted the lunny/notification_mail branch January 13, 2019 14:58
@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/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.

None yet

7 participants