Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIRFLOW-2875] Escape env vars in tmp config #3721

Closed

Conversation

wdhorton
Copy link
Contributor

@wdhorton wdhorton commented Aug 8, 2018

Make sure you have checked all steps below.

Jira

Description

  • Here are some details about my PR, including screenshots of any UI changes:
    When writing tmp config files, escapes the env variables, since they are read by ConfigParser when the tmp config file is loaded when the task is being run.

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

Commits

  • 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":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • When adding new operators/hooks/sensors, the autoclass documentation generation needs to be added.

Code Quality

  • Passes git diff upstream/master -u -- "*.py" | flake8 --diff

@wdhorton wdhorton force-pushed the escape-env-vars-in-tmp-config branch from 77d55f3 to bfcd5c5 Compare August 8, 2018 17:40
@ashb
Copy link
Member

ashb commented Aug 9, 2018

What if someone is using % interpolation in their config file? Have they already been replaced by the stage we run the replace?

@wdhorton
Copy link
Contributor Author

wdhorton commented Aug 9, 2018

This doesn't affect values that are in the config file, just ones that are being pulled from the env (like AIRFLOW__CELERY__BROKER_URL in my case) and written to the tmp config file with tmp_configuration_copy(). So % interpolation in the config file should continue to work as is.

That said, it looks like I broke a bunch of tests, so I need to figure out how this is having an effect in other places that I didn't expect.

@ashb
Copy link
Member

ashb commented Nov 1, 2018

Closed in favour of #4029 (sorry for missing this!)

@ashb ashb closed this Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants