Skip to content

Conversation

Mayank77maruti
Copy link

@Mayank77maruti Mayank77maruti commented Feb 14, 2025

Fixes #23725
/claim #23725

Signed-off-by: Mayank Mohapatra <[email protected]>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 14, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Feb 14, 2025
Signed-off-by: Mayank Mohapatra <[email protected]>
Signed-off-by: Mayank Mohapatra <[email protected]>
Signed-off-by: Mayank Mohapatra <[email protected]>
@lunny
Copy link
Member

lunny commented Feb 14, 2025

Maybe we should use #30278

@Mayank77maruti
Copy link
Author

Mayank77maruti commented Feb 23, 2025

@lunny can you please take a look.
If I am going in the correct direction.

@jonnytest1
Copy link

i think we should go the event route 🤔 under https://gitea/user/settings/hooks/gitea/new u can specify a list of events for which a webhook is triggered - i think including it there would be the right step - maybe extend the event system with "should send email by default" or something like it, which should then be sub/unsubscibable in user settings

@lunny
Copy link
Member

lunny commented Mar 1, 2025

I think #33694 will replace this one. Or this one should depend on #33694 .

@ChristopherHX
Copy link
Contributor

I want to clarify #33694 is workflow_job tied to starting / finishing of jobs not workflows.

You cannot implement this by listening for independent job completion.

The email should afaik depend on workflow_run (completed) webhook / notifier, which I initially planned to do as well.
That would however require this notifier added here to also trigger for workflow started, but skip the email in this case.

@jonnytest1
Copy link

i think it would be a good idea to implement this email listening as centrally as possible - i.e. listen to all events and (maybe hardcoded for now) only send email on that one example , then its easier to make it user customizable in the future, no ?

@ChristopherHX
Copy link
Contributor

to implement this email listening as centrally as possible

Yes adding a webhook category for Email, then allow a text fields to provide golang templates to generate the subject, body + a custom filter expression (based on webhook json fields) would technically be a really powerfull and customizable feature for keep up to date. (Bad User Experience, good Developer Experience)

Then provide a preconfigured list for each webhook to choose the Email style for the event. (Better User Experience)

Would then depend on a webhook for workflow completion to be added.

I'm only active in this PR thread, because my PR has been referenced here. I don't even have EMail set up in my instance so I will be silent here

@jonnytest1
Copy link

i was more thinking a central event pipeline that then feeds into webhook and email seperately 🤔 it would allow to configure email obver webhook tho ^^ (which might also be a neat first workaround so the current issue doenst blow the scope up too much )

@jonnytest1
Copy link

jonnytest1 commented Mar 2, 2025

apparently action events are part of this :
image

if u run a workflow like this:

image

got me this:

image

(its not really detailed enough for a perfect status email (since the step isnt in it) , but for everyone looking for a quick workaround settings up a mini server that waits for this webhook and then sends an email might be a decent alternative)

@wxiaoguang
Copy link
Contributor

Read the related code again, I can see that we have "Add workflow_run api + webhook (#33964)" now, so there are new notification functions like "WorkflowRunStatusUpdate".

The new PR "Send email on Workflow Run Success/Failure #34982" utilizes the new functions, so I think we can continue there? Thank you all.

@wxiaoguang wxiaoguang added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jul 8, 2025
@wxiaoguang
Copy link
Contributor

Thank you very much for the PR, the improved implementation is done in Send email on Workflow Run Success/Failure #34982 🙏

@wxiaoguang wxiaoguang closed this Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Actions - send Email on Success/Failure
7 participants