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

Enable custom texts for notifications #3531

Open
Zaubeerer opened this issue Oct 19, 2020 · 4 comments · May be fixed by #3534
Open

Enable custom texts for notifications #3531

Zaubeerer opened this issue Oct 19, 2020 · 4 comments · May be fixed by #3534

Comments

@Zaubeerer
Copy link
Contributor

@Zaubeerer Zaubeerer commented Oct 19, 2020

Current behavior

Slack, email and other notifications provide a standardized text and backend info.

Proposed behavior

Users can add custom texts to the notifications.

Example

Prefect
Failed
awesome-flow is now in a Failed state
Message
Some reference tasks failed.
Prefect notification
@colleague, please analyze possible root causes.

Ideas for Implementation

add kwargs to functions in notifications.py to support a "custom_text"

@madkinsz madkinsz linked a pull request that will close this issue Oct 19, 2020
0 of 3 tasks complete
@madkinsz
Copy link
Contributor

@madkinsz madkinsz commented Oct 19, 2020

Hi! I've implemented a rough draft of what this could look like in #3534 but I think some discussion on the correct API for this would be prudent! Please let me know if something like that would fit your use-case.

@joshmeek thoughts?

This will take additional work to add to all of the notifications and update documentation, this would be a good issue for someone from the community!

@joshmeek
Copy link
Member

@joshmeek joshmeek commented Oct 19, 2020

@madkinsz I'm guessing we would want the template to be "templatable" so I think something similar to what we do for task targets would be a nice implementation. Task targets can take in templatable strings like "{task_name}-{today}" but for the notifications we would run with a slightly different set amount of templatable variables. Looks like tracked_obj, backend_info and state are the reserved values that are available to the notifier at runtime. The notifier also has context available so we could use variables from there.

@madkinsz
Copy link
Contributor

@madkinsz madkinsz commented Oct 29, 2020

Hi all, there are some comments in the relevant PoC PR and this is ready for anyone in the community to work on.

@Zaubeerer
Copy link
Contributor Author

@Zaubeerer Zaubeerer commented Nov 5, 2020

Hey @madkinsz, that looks already like a great framework in which to bring this functionality to live indeed!

Unfortunately, I am still pretty busy at the moment, but if nobody else looks into this, I might be able to finish it in ~10 days :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.