diff --git a/src/prefect/events/schemas/automations.py b/src/prefect/events/schemas/automations.py index 6376c2d90cb2..6c1c8b5c42b9 100644 --- a/src/prefect/events/schemas/automations.py +++ b/src/prefect/events/schemas/automations.py @@ -84,7 +84,7 @@ def as_automation(self) -> "AutomationCore": getattr(self, "name", None) or f"Automation for deployment {self._deployment_id}" ), - description="", + description=getattr(self, "description", ""), enabled=getattr(self, "enabled", True), trigger=trigger, actions=self.actions(), diff --git a/tests/cli/test_deploy.py b/tests/cli/test_deploy.py index 773407e302e5..f3afe2b1e350 100644 --- a/tests/cli/test_deploy.py +++ b/tests/cli/test_deploy.py @@ -5532,6 +5532,7 @@ async def test_initialize_named_deployment_triggers(self): trigger_spec = { "name": "Trigger McTriggerson", "enabled": True, + "description": "This is a test trigger", "match": {"prefect.resource.id": "prefect.flow-run.*"}, "expect": ["prefect.flow-run.Completed"], "match_related": { @@ -5546,7 +5547,7 @@ async def test_initialize_named_deployment_triggers(self): DeploymentEventTrigger( **{ "name": "Trigger McTriggerson", - "description": "", + "description": "This is a test trigger", "enabled": True, "match": {"prefect.resource.id": "prefect.flow-run.*"}, "match_related": { @@ -5736,6 +5737,7 @@ async def test_json_string_trigger(self, docker_work_pool): trigger_spec = { "enabled": True, + "description": "This is a test trigger", "match": {"prefect.resource.id": "prefect.flow-run.*"}, "expect": ["prefect.flow-run.Completed"], "job_variables": {"foo": "bar"}, @@ -5775,6 +5777,7 @@ async def test_json_file_trigger(self, docker_work_pool): trigger_spec = { "enabled": True, + "description": "This is a test trigger", "match": {"prefect.resource.id": "prefect.flow-run.*"}, "expect": ["prefect.flow-run.Completed"], "job_variables": {"foo": "bar"}, @@ -5815,6 +5818,7 @@ async def test_yaml_file_trigger(self, docker_work_pool): trigger_spec = { "enabled": True, + "description": "This is a test trigger", "match": {"prefect.resource.id": "prefect.flow-run.*"}, "expect": ["prefect.flow-run.Completed"], "job_variables": {"foo": "bar"}, @@ -5855,6 +5859,7 @@ async def test_nested_yaml_file_trigger(self, docker_work_pool, tmpdir): trigger_spec = { "enabled": True, + "description": "This is a test trigger", "match": {"prefect.resource.id": "prefect.flow-run.*"}, "expect": ["prefect.flow-run.Completed"], }