-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Integrating composite triggers with the DeploymentTrigger
YAML representation
#12413
Conversation
✅ Deploy Preview for prefect-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Do you think it'd be a good idea to add some integration tests like in our
test_deployments.py
TestDeploymentBasicInterface
TestDeploymentApply
and like tests for malformed triggers that are missing required fields?
That's a great call, @serinamarie, I'll try to get some of those in today |
It turns out that we do have a set of integration tests over in I'm still not satisfied with how this works, so I'm going to do some more work on it to reflect the real triggers class hierarchy |
As I was starting to write more tests for DeploymentTrigger, I realized that I was effectively reproducing tests for validation that Pydantic would do for us if we just matched the hierarchy correctly. Unfortunately there's no way to inject a few fields into a base class for another class hierarchy, so I'm reproducing the full hierarchy and its validate rules here.
f808c80
to
159d02d
Compare
@@ -207,6 +207,93 @@ def test_compound_deployment_trigger_as_automation(): | |||
) | |||
|
|||
|
|||
def test_deeply_nested_compound_deployment_trigger_as_automation(): |
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 wasn't apparent to me the first time that just backporting the
Trigger
hierarchy andTriggerTypes
wasn't enough to get them to be available in deployments. This adds them to theDeploymentTrigger
schema so that folks can define them in theirprefect.yaml
files and get full support of the nested triggers.