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

Various fixes for issue mail notifications #7165

Merged
merged 2 commits into from
Jun 11, 2019

Conversation

silverwind
Copy link
Member

Various fixes for issue mail notifications

  • Send individual mails for actions and comments
  • Send mail for new issues/prs without a comment
  • Use correct sender for reopen/close actions
  • Hopefully fixed all bugs related to missing mails

Fixes: #7124
Fixes: #5977

- Send individual mails for actions and comments
- Send mail for new issues/prs without a comment
- Use correct sender for reopen/close actions
- Hopefully fixed all bugs related to missing mails

Fixes: go-gitea#7124
Fixes: go-gitea#5977
@codecov-io
Copy link

codecov-io commented Jun 9, 2019

Codecov Report

Merging #7165 into master will decrease coverage by 0.01%.
The diff coverage is 27.02%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7165      +/-   ##
==========================================
- Coverage   41.72%   41.71%   -0.02%     
==========================================
  Files         449      449              
  Lines       61112    61130      +18     
==========================================
  Hits        25500    25500              
- Misses      32300    32316      +16     
- Partials     3312     3314       +2
Impacted Files Coverage Δ
modules/notification/mail/mail.go 22.64% <0%> (ø) ⬆️
models/issue_mail.go 51.54% <40.9%> (-3.22%) ⬇️
models/issue_comment.go 47.05% <8.33%> (-0.43%) ⬇️
modules/log/event.go 64.46% <0%> (-1.53%) ⬇️

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 74690f6...def90c9. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 9, 2019
@techknowlogick techknowlogick added this to the 1.9.0 milestone Jun 10, 2019
if len(issue.Content) > 0 {
if err = mailIssueCommentToParticipants(e, issue, doer, issue.Content, nil, mentions); err != nil {
log.Error("mailIssueCommentToParticipants: %v", err)
}
Copy link
Member

Choose a reason for hiding this comment

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

return?

Copy link
Member Author

Choose a reason for hiding this comment

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

Same here, it's intended.

if len(c.Content) > 0 {
if err = mailIssueCommentToParticipants(e, issue, c.Poster, c.Content, c, mentions); err != nil {
log.Error("mailIssueCommentToParticipants: %v", err)
}
Copy link
Member

Choose a reason for hiding this comment

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

return?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, sending two mails is intended. One for each action (comment and close/reopen).

Copy link
Member Author

Choose a reason for hiding this comment

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

If it's just a comment, the switch below will not hit a case and only 1 mail is sent.

Copy link
Member

Choose a reason for hiding this comment

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

One action sending two mails is annoying.

Copy link
Member Author

@silverwind silverwind Jun 10, 2019

Choose a reason for hiding this comment

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

I don't think so. It's not one action after all if a user clicks "comment and close". Also it does match GitHub's behaviour, they also send two mails on "comment and close".

Copy link
Member Author

Choose a reason for hiding this comment

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

Example of GitHub sending two mails for "comment and close":

image

@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 Jun 11, 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 Jun 11, 2019
@zeripath zeripath merged commit 499a8a1 into go-gitea:master Jun 11, 2019
jeffliu27 pushed a commit to jeffliu27/gitea that referenced this pull request Jul 18, 2019
- Send individual mails for actions and comments
- Send mail for new issues/prs without a comment
- Use correct sender for reopen/close actions
- Hopefully fixed all bugs related to missing mails

Fixes: go-gitea#7124
Fixes: go-gitea#5977
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue closure email has wrong From header Issue closure with empty comment does not generate E-Mail
7 participants