Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rendering nested task fields (#18516)
When we are referring ``{{task}}` in jinja templates we can also refer some of the fields, which are templated. We are not able to solve all the problems with such rendering (specifically recursive rendering of the fields used in JINJA templating might be problematic. Currently whether you see original, or rendered field depends solely on the sequence in templated_fields. However that would not even explain the rendering problem described in #13559 where kwargs were defined after opargs and the rendering of opargs **should** work. It turned out that the problem was with a change introduced in #8805 which made the context effectively holds a DIFFERENT task than the current one. Context held an original task, and the curren task was actually a locked copy of it (to allow resolving upstream args before locking). As a result, any changes done by rendering templates were not visible in the task accessed via {{ task }} jinja variable. This change replaces the the task stored in context with the same copy that is then used later during execution so that at least the "sequential" rendering works and templated fields which are 'earlier' in the list of templated fields can be used (and render correctly) in the following fields. Fixes: #13559
- Loading branch information