You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/08/08 06:23:57 UTC

[GitHub] [airflow] jml opened a new pull request #5757: [AIRFLOW-5100] Use safe_mode configuration setting by default

jml opened a new pull request #5757: [AIRFLOW-5100] Use safe_mode configuration setting by default
URL: https://github.com/apache/airflow/pull/5757
 
 
   The scheduler calls `list_py_file_paths` to find DAGs to schedule. It does so
   without passing any parameters other than the directory. This means that
   it *won't* discover DAGs that are missing the words "airflow" and "DAG" even
   if DAG_DISCOVERY_SAFE_MODE is disabled.
   
   Since `list_py_file_paths` will refer to the configuration if
   `include_examples` is not provided, it makes sense to have the same behaviour
   for `safe_mode`.
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Airflow Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
   
   ### Description
   
   See above. There are no UI changes.
   
   ### Tests
   
   I stared at the code a long time and couldn't figure out a good place to test.
   
   - `list_py_file_paths` doesn't have direct tests
     - adding a test for this particular branch might be OK, but feels a bit like a [change detector test](https://testing.googleblog.com/2015/01/testing-on-toilet-change-detector-tests.html)
     - If you can point me to a context manager to temporarily override a configuration setting, I could probably write some direct tests that use `tests/dags/` as the source of DAGs
   - `SchedulerJob` is actually exhibiting the bug, and is where the behaviour needs to be correct
     - There's no obvious API to exercise that would let me test this
     - I could theoretically extract a `_make_processor_agent` from `_execute`, and assert things about its return value, but I don't want spend time on that without a core contributor approving it first
     - I would still need a context manager to temporarily override configuration settings 
   
   ### Commits
   
   - [x] My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   
   ### Documentation
   
   - [x] In case of new functionality, my PR adds documentation that describes how to use it.
     - All the public functions and the classes in the PR contain docstrings that explain what it does
     - If you implement backwards incompatible changes, please leave a note in the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so we can assign it to a appropriate release
   
   ### Code Quality
   
   - [x] Passes `flake8`
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services