PrefectHQ
prefect
BlogDocsChangelog

fix: preserve event template parameters in deployment triggers

#19504Merged
Comparing
fix-trigger-parameters-regression
(
d20e931
) with
main
(
264a9fc
)
CodSpeed Performance Gauge
0%
Untouched
2
Ignored
6

Benchmarks

Passed

bench_import_prefect_flow
benches/bench_import.py
CodSpeed Performance Gauge
0%
1.4 s1.4 s
bench_task_decorator
benches/bench_tasks.py
CodSpeed Performance Gauge
0%
463.9 µs465.4 µs

Ignored

bench_flow_call[options0]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
165.2 ms164.9 ms
bench_flow_decorator
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
6.1 ms6.1 ms
bench_task_call
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-6%
153.9 ms163.2 ms
bench_import_prefect
benches/bench_import.py
Ignored
CodSpeed Performance Gauge
0%
1.1 s1.1 s
bench_task_submit
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-12%
5.1 ms5.8 ms
bench_flow_call[options1]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
107.4 ms107.7 ms

Commits

Click on a commit to change the comparison range
Base
main
264a9fc
-0.16%
fix: preserve event template parameters in deployment triggers closes #19501 this PR fixes a regression introduced in #19414 where event template parameters in deployment triggers (like `{{ event.name }}`) were being stripped out during deployment. <details> <summary>Details</summary> ## Problem PR #19414 moved trigger initialization to occur after `apply_values()` is called on the deploy_config to allow templating of boolean fields like `enabled`. However, `apply_values()` removes keys whose values contain placeholders that aren't in step_outputs (build/push variables). Event template parameters like `{{ event.name }}` and `{{ event.id }}` are runtime templates for the automation, not build-time templates, so they don't exist in step_outputs and were being removed, resulting in empty `parameters: {}` in the automation action. ## Solution - Extract triggers from deploy_config before applying build/push templating - Apply selective templating: template trigger-level fields (like `enabled`) but preserve the `parameters` section untouched - This allows #19348 (boolean templating) to work while fixing #19501 ## Testing Added two comprehensive tests: - Simple event templates: `parameters: {"name": "{{ event.name }}"}` - Complex __prefect_kind structure: `{"template": "{{ event.id }}", "__prefect_kind": "jinja"}` Both test cases now pass, and the original #19348 test still passes. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
d20e931
3 days ago
by zzstoatzz
© 2025 CodSpeed Technology
Home Terms Privacy Docs