Fix zipped DAG template loading with safe path handling#60999
Fix zipped DAG template loading with safe path handling#60999soooojinlee wants to merge 19 commits intoapache:mainfrom
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
872e812 to
e8e3fba
Compare
SameerMesiah97
left a comment
There was a problem hiding this comment.
I have left a few comments.
kalluripradeep
left a comment
There was a problem hiding this comment.
Thanks for tackling this issue! The zip-aware loader is a good solution to #59310.
I agree with @SameerMesiah97's feedback:
-
Removing the operator-level override check - This does seem like it could be a breaking change. Could you clarify why this was removed or restore it if it was unintentional?
-
Docstring length - The suggested shorter version would be clearer for IDE tooltips while keeping the details in comments.
Additional observations:
The test coverage looks comprehensive with mixed paths, ordering, and traversal blocking. Good work on the security aspect (path traversal prevention).
One question: Have you tested this with real-world zipped DAGs to ensure backward compatibility with existing deployments?
Looking forward to the updates! 👍
- Restore _should_render_native method that was unintentionally removed - Update _render to use _should_render_native for operator-level render_template_as_native_obj override support - Simplify ZipAwareFileSystemLoader docstring per reviewer suggestion - Move implementation details and issue reference to code comments - Use Python naming convention 'up_to_date' instead of 'uptodate'
c3cfe34 to
06e5ec8
Compare
Switch DAG templating to a zip-aware loader that preserves searchpath order and applies the same path traversal rules as FileSystemLoader. Add tests for mixed paths, ordering, and zip traversal blocking.
- Restore _should_render_native method that was unintentionally removed - Update _render to use _should_render_native for operator-level render_template_as_native_obj override support - Simplify ZipAwareFileSystemLoader docstring per reviewer suggestion - Move implementation details and issue reference to code comments - Use Python naming convention 'up_to_date' instead of 'uptodate'
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
276d69c to
dba2c2e
Compare
providers/edge3/src/airflow/providers/edge3/worker_api/v2-edge-generated.yaml
Show resolved
Hide resolved
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…th' into fix/59310-zipped-dag-template-path
Move _should_render_native back before _do_render_template_fields to minimize diff against main branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…jinlee/airflow into fix/59310-zipped-dag-template-path

Switch DAG templating to a zip-aware loader that preserves searchpath order and applies the same path traversal rules as FileSystemLoader. Add tests for mixed paths, ordering, and zip traversal blocking.
Summary
Test plan
Docs
Breaking changes
Related
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 4.5
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.