BasPH opened a new pull request #14641:
URL: https://github.com/apache/airflow/pull/14641


   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   This PR removes airflow.cfg from the Airflow Configuration view, and shows 
_only_ the rendered view, with the goal to remove confusion about which 
configuration is currently active.
   
   My motivation is that I often encounter people not knowing that you can 
scroll down to see the active configuration, thinking the airflow.cfg (which is 
displayed first) is the configuration currently active (which are defaults that 
might be overridden by env vars).
   
   Summary of changes:
   
   - UI shows only rendered config
   - UI shows an info message in case `AIRFLOW__WEBSERVER__EXPOSE_CONFIG=False`
   - I didn't know about this, but there was an argument `raw=true`, returning 
the `airflow.cfg` in text format. To make things consistent, I altered this 
behaviour to return the running configuration (not airflow.cfg).
   
   Screenshots of old & new behaviours:
   
   ### **1. `AIRFLOW__WEBSERVER__EXPOSE_CONFIG=False` and access 
`/configuration`**
   
   - Previously:
   
   
![image](https://user-images.githubusercontent.com/6249654/110203331-e2690300-7e6d-11eb-980b-4c8a18e40836.png)
   
   - New:
   
   
![image](https://user-images.githubusercontent.com/6249654/110173893-97180b80-7dff-11eb-9d96-066c85c1b8d6.png)
   
   ### **2. `AIRFLOW__WEBSERVER__EXPOSE_CONFIG=False` and access 
`/configuration?raw=true`**
   
   - Previously: returns HTTP 200 and text file:
   
   
![image](https://user-images.githubusercontent.com/6249654/110203399-52778900-7e6e-11eb-986e-1397f461495b.png)
   
   - New: returns 204, with header named `Reason` containing message "Your 
Airflow administrator chose not to expose the configuration..."
   
   
![image](https://user-images.githubusercontent.com/6249654/110202625-4be71280-7e6a-11eb-9970-63d8a0777ee0.png)
   
   ### **3. `AIRFLOW__WEBSERVER__EXPOSE_CONFIG=True` and access 
`/configuration`**
   
   - Previously:
   
   
![image](https://user-images.githubusercontent.com/6249654/110203504-ea757280-7e6e-11eb-8da1-a9488d1e6021.png)
   
   - New: Displays only running configuration, no more (non active) defaults in 
airflow.cfg
   
   
![image](https://user-images.githubusercontent.com/6249654/110200174-e8a2b380-7e5c-11eb-807d-e33fe915d8a3.png)
   
   **4. `AIRFLOW__WEBSERVER__EXPOSE_CONFIG=True` and access 
`/configuration?raw=true`**
   
   - Previously: returns text file with content of airflow.cfg (not running 
configuration)
   
   
![image](https://user-images.githubusercontent.com/6249654/110203565-2577a600-7e6f-11eb-9252-079e77da1516.png)
   
   - New: Returns running configuration as JSON
   
   
![image](https://user-images.githubusercontent.com/6249654/110202576-eb57d580-7e69-11eb-95aa-4148c02c0a0b.png)
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)**
 for more information.
   In case of fundamental code change, Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals))
 is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party 
License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in 
[UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to