Repository navigation
Keep ZIP-archived Dags active when dag_discovery_safe_mode is False - #68518
Conversation
2e35a34 to
11741f4
Compare
11741f4 to
942843f
Compare
942843f to
13d95bc
Compare
13d95bc to
78350c2
Compare
78350c2 to
a9790a8
Compare
This comment was marked as spam.
This comment was marked as spam.
a9790a8 to
2283633
Compare
There was a problem hiding this comment.
Nice catch fixing both spots here. One gap: there's no regression test for the _find_files_in_bundle fix, only for _get_observed_filelocs. Could you add a parametrized test mirroring the existing one, asserting a keyword-less .py file is included/excluded based on dag_discovery_safe_mode? Otherwise a future change could silently reintroduce that half of the bug.
2283633 to
48af3f7
Compare
This comment was marked as spam.
This comment was marked as spam.
Vamsi-klu
left a comment
There was a problem hiding this comment.
@vatsrahul1001 Addressed your feedback: added parametrized test_find_files_in_bundle_respects_dag_discovery_safe_mode in 48af3f76bf8d55fdbbc703e290b0d0b8dbbfcea7 (safe_mode on/off for keyword-less .py discovery). Ready for another look.
This comment was marked as spam.
This comment was marked as spam.
|
LGTM!, can be merged after code owner review @ephraimbuddy @jedcunningham |
ephraimbuddy
left a comment
There was a problem hiding this comment.
LGTM
The tests bypass the config wiring. Can you make it use it?
The Dag file processor parsed and activated keyword-less Dags inside ZIP archives but then immediately deactivated them, because the scan that decides which files still exist ignored dag_discovery_safe_mode and always applied the airflow/dag keyword heuristic. Resolve the setting once and use it consistently for discovery and the deactivation scan, and log the effective value so a misconfigured processor is diagnosable. closes: apache#66104
The file-discovery and observed-file paths must both honor safe mode so wrapped Dag files are not silently skipped by a future regression.
Review asked for one-line comments and no issue numbers in code, since the PR link already carries that context.
a45c514 to
8ef84d4
Compare
Keep the PR current so review and CI are not hundreds of commits stale. Co-authored-by: Cursor <[email protected]>
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
…e is False (#68518) * Keep ZIP-archived Dags active when dag_discovery_safe_mode is False The Dag file processor parsed and activated keyword-less Dags inside ZIP archives but then immediately deactivated them, because the scan that decides which files still exist ignored dag_discovery_safe_mode and always applied the airflow/dag keyword heuristic. Resolve the setting once and use it consistently for discovery and the deactivation scan, and log the effective value so a misconfigured processor is diagnosable. closes: #66104 * Cover safe-mode filtering in Dag bundle discovery The file-discovery and observed-file paths must both honor safe mode so wrapped Dag files are not silently skipped by a future regression. * Shorten review-flagged comments in Dag discovery safe mode change Review asked for one-line comments and no issue numbers in code, since the PR link already carries that context. * Validate configured Dag discovery safe mode --------- (cherry picked from commit 786dd79) Co-authored-by: deepinsight coder <[email protected]> Co-authored-by: Cursor <[email protected]>
…e is False (#68518) (#71714) * Keep ZIP-archived Dags active when dag_discovery_safe_mode is False The Dag file processor parsed and activated keyword-less Dags inside ZIP archives but then immediately deactivated them, because the scan that decides which files still exist ignored dag_discovery_safe_mode and always applied the airflow/dag keyword heuristic. Resolve the setting once and use it consistently for discovery and the deactivation scan, and log the effective value so a misconfigured processor is diagnosable. closes: #66104 * Cover safe-mode filtering in Dag bundle discovery The file-discovery and observed-file paths must both honor safe mode so wrapped Dag files are not silently skipped by a future regression. * Shorten review-flagged comments in Dag discovery safe mode change Review asked for one-line comments and no issue numbers in code, since the PR link already carries that context. * Validate configured Dag discovery safe mode --------- (cherry picked from commit 786dd79) Co-authored-by: deepinsight coder <[email protected]> Co-authored-by: Cursor <[email protected]>
…e is False (#68518) (#71714) * Keep ZIP-archived Dags active when dag_discovery_safe_mode is False The Dag file processor parsed and activated keyword-less Dags inside ZIP archives but then immediately deactivated them, because the scan that decides which files still exist ignored dag_discovery_safe_mode and always applied the airflow/dag keyword heuristic. Resolve the setting once and use it consistently for discovery and the deactivation scan, and log the effective value so a misconfigured processor is diagnosable. closes: #66104 * Cover safe-mode filtering in Dag bundle discovery The file-discovery and observed-file paths must both honor safe mode so wrapped Dag files are not silently skipped by a future regression. * Shorten review-flagged comments in Dag discovery safe mode change Review asked for one-line comments and no issue numbers in code, since the PR link already carries that context. * Validate configured Dag discovery safe mode --------- (cherry picked from commit 786dd79) Co-authored-by: deepinsight coder <[email protected]> Co-authored-by: Cursor <[email protected]>
Related #66104.
When
[core] dag_discovery_safe_modeisFalse, Dags defined in ZIP archives whose source does not contain theairflow/dagkeywords were parsed and activated by the Dag file processor but then immediately deactivated on the next scan._get_observed_filelocsexpanded ZIP members with a hardcodedsafe_mode=True, so keyword-less members were absent from the observed set anddeactivate_deleted_dagsmarked them stale.Changes:
dag_discovery_safe_modeonce onDagFileProcessorManagerand use it for both file discovery (_find_files_in_bundle) and the observed-filelocs scan (_get_observed_filelocs), fixing the hardcodedTrue.dag_discovery_safe_modeper bundle. In separate-process deployments (Helm/OpenShift) the flag must be set on the dag-processor and the component restarted; otherwise Dags appear afterairflow dags reserializeand disappear on the next scan (the plain-.py symptom in the issue). The log makes that misconfiguration diagnosable.Tested: new parametrized regression test
test_get_observed_filelocs_respects_dag_discovery_safe_mode(keyword-less ZIP member is observed when safe_mode is False, filtered when True).Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines
Important
🛠️ Maintainer triage note for @Vamsi-klu · by
@potiuk· 2026-07-02 17:46 UTCHelpful heads-up from the maintainers — please address before this PR can be reviewed (see the Pull Request quality criteria):
main. Please rebase onto the latestmainand resolve them.The ball is in your court — you've been assigned to this PR. Fix the above, then mark it Ready for review.
Automated triage — may be imperfect; a maintainer takes the next look.