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

Feat: Support per-launch plan notification template #6064

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

peterxcli
Copy link
Contributor

Tracking issue

Why are the changes needed?

What changes were proposed in this pull request?

Currently we can only define one mail template in config, when some specific workflow state defined in launch plan is reached, then some mails with the mail template in config would sent to recipients.

This PR aims to allow user to define customize notification template for each launch plan.
Demo:

my_notifying_lp = LaunchPlan.create(
    "my_notifying_lp",
    my_workflow_definition,
    default_inputs={"a": 4},
    notifications=[
        Email(
            phases=[WorkflowExecutionPhase.SUCCEEDED],
            recipients_email=["admin@example.com"],
            template="{{ workflow.id }} is ..."
        )
    ],
)

How was this patch tested?

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Signed-off-by: peterxcli <peterxcli@gmail.com>
Signed-off-by: peterxcli <peterxcli@gmail.com>
Signed-off-by: peterxcli <peterxcli@gmail.com>
Signed-off-by: peterxcli <peterxcli@gmail.com>
Copy link

codecov bot commented Nov 30, 2024

Codecov Report

Attention: Patch coverage is 31.81818% with 15 lines in your changes missing coverage. Please review.

Project coverage is 37.09%. Comparing base (ab04192) to head (fde5626).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
flyteidl/gen/pb-go/flyteidl/admin/common.pb.go 0.00% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6064      +/-   ##
==========================================
+ Coverage   37.08%   37.09%   +0.01%     
==========================================
  Files        1318     1318              
  Lines      132284   132347      +63     
==========================================
+ Hits        49062    49100      +38     
- Misses      78950    78975      +25     
  Partials     4272     4272              
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 54.08% <100.00%> (-0.02%) ⬇️
unittests-flytecopilot 30.99% <ø> (ø)
unittests-flytectl 62.29% <ø> (-0.05%) ⬇️
unittests-flyteidl 7.23% <0.00%> (-0.01%) ⬇️
unittests-flyteplugins 53.82% <ø> (+0.09%) ⬆️
unittests-flytepropeller 42.63% <ø> (ø)
unittests-flytestdlib 57.59% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

emailNotification.template -> emailNotification.GetTemplate

Signed-off-by: peterxcli <peterxcli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant