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

Add notification interface and refactor UI notifications #5085

Merged
merged 3 commits into from
Oct 18, 2018

Conversation

lunny
Copy link
Member

@lunny lunny commented Oct 15, 2018

This pull request create a notification interface so that all notifications, i.e. ui, actions, webhooks, mails and etc. will only need to implement the interface. So that the code will be more easy. This is extract from #4001. It's the first step of serval pull requests from #4001. I think it will be easier to review.

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

codecov-io commented Oct 15, 2018

Codecov Report

Merging #5085 into master will increase coverage by <.01%.
The diff coverage is 37.43%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5085      +/-   ##
=========================================
+ Coverage   37.39%   37.4%   +<.01%     
=========================================
  Files         306     307       +1     
  Lines       45397   45552     +155     
=========================================
+ Hits        16977   17037      +60     
- Misses      25962   26060      +98     
+ Partials     2458    2455       -3
Impacted Files Coverage Δ
routers/api/v1/repo/pull.go 13.2% <0%> (-0.08%) ⬇️
models/issue.go 48.15% <0%> (-0.17%) ⬇️
routers/repo/pull_review.go 0% <0%> (ø) ⬆️
models/review.go 63.57% <100%> (+0.52%) ⬆️
routers/api/v1/repo/issue_comment.go 57.51% <100%> (+0.27%) ⬆️
routers/repo/pull.go 33.96% <100%> (ø) ⬆️
modules/notification/notification.go 28.08% <26.19%> (-50.49%) ⬇️
routers/repo/issue.go 32.14% <26.66%> (ø) ⬆️
modules/notification/ui/ui.go 58.92% <58.92%> (ø)
routers/api/v1/repo/issue.go 30.08% <66.66%> (+0.32%) ⬆️
... and 3 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 dd62ca7...ef91809. 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 15, 2018
modules/notification/notification.go Show resolved Hide resolved
modules/notification/base/base.go Show resolved Hide resolved
@@ -1014,6 +1014,8 @@ func UpdateIssueStatus(ctx *context.Context) {
ctx.ServerError("ChangeStatus", err)
return
}

notification.NotifyIssueChangeStatus(ctx.User, issue, isClosed)
Copy link
Member

Choose a reason for hiding this comment

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

Only send notifications if status really change. In my understanding this will send a notification if isClosed = true and the issue is already closed.

@jonasfranz
Copy link
Member

Thank you for this PR. I think this re-factoring is really needed!

@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 Oct 16, 2018
@lunny
Copy link
Member Author

lunny commented Oct 18, 2018

@BetaCat0 done.

@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 Oct 18, 2018
@lunny lunny merged commit ea619b3 into go-gitea:master Oct 18, 2018
@lunny lunny deleted the lunny/notification_ui branch October 18, 2018 11:23
@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.

5 participants