-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Send email on Workflow Run Success/Failure #34982
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
base: main
Are you sure you want to change the base?
Conversation
replace #33601 |
This comment was marked as resolved.
This comment was marked as resolved.
outdatedAnd by reading the history discussions: I think the concern is not addressed? It looks right, the concerns in "Actions - send Email on Success/Failure #33601" should all be addressed. 🙏 |
Is the new table |
@lunny The use of |
I also think it should reuse the existing setting system, instead of introducing a new system. And the existing system is indeed not clear, it needs refactoring and improvements. |
probably just add a "previousRunFailed" property to the event then it should be easy to make conditions for it based on user configuration |
|
||
recipients := make([]*user_model.User, 0) | ||
|
||
if !sender.IsGiteaActions() && !sender.IsGhost() && sender.IsMailable() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why checking sender's preference rather than receivers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lunny Currently in the code the sender is the receiver. Only the sender goes receiver list.
#34982 (comment)
#34982 (comment)
Any further review please? |
I will complete my review by Monday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great on my end
unrelated: only configureing gitea for me with enabled mails, could be better documented that the email service needs to be enabled additionally to the mailer itself
ctx.ServerError("GetUserNotificationSettings", err) | ||
return | ||
} | ||
actionsNotify := fineGrainedPreference[user_model.SettingsEmailNotificationGiteaActions].SettingValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will panic if the setting key doesn't exist.
The user setting system really needs a complete refactor
} | ||
} | ||
|
||
func SendActionsWorkflowRunStatusEmail(ctx context.Context, sender *user_model.User, repo *repo_model.Repository, run *actions_model.ActionRun) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why there are two SendActionsWorkflowRunStatusEmail
sendActionsWorkflowRunStatusEmail
for different purposes ...
Is it possible to make them have different names?
Closes #23725
/claim #23725