SamWheating opened a new pull request #17924:
URL: https://github.com/apache/airflow/pull/17924


   <!--
   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/
   -->
   
   While trying to fix test failures in 
https://github.com/apache/airflow/pull/17121 I noticed a bug in the way that 
ImportErrors are displayed when users don't have access to view all DAGs.  
   
   Specifically in this piece of code:
   
https://github.com/apache/airflow/blob/0a68588479e34cf175d744ea77b283d9d78ea71a/airflow/www/views.py#L611-L692
   
   The list of filenames that we use to conditionally display ImportErrors 
(`dag_filenames`) is itself filtered to only active DAGs, then paginated and 
then potentially filtered to only paused or not-paused DAGs. 
   
   As a result, a user without read access to all DAGs may see a different 
subset of import errors when they:
    - switch pages
    - filter on paused, non-paused or all DAGs
   
   ### Example:
   
   I made a DAG and a user which only had access to view that DAG.
   
   I introduced an importError in the DAG and it appeared in the UI (as 
expected):
   
   
![image](https://user-images.githubusercontent.com/16950874/131423826-f86ea5d1-9bc2-403a-950e-5505c5b7dbf3.png)
   
   However, when I switched to the `paused` tab, the ImportError disappeared:
   
![image](https://user-images.githubusercontent.com/16950874/131424140-c5855dd3-95ea-4f26-ac36-50104e76c245.png)
   
   ## The Fix
   
   If a user doesn't have permission to view all DAGs, then we can compute the 
list of ImportErrors to be displayed by joining ImportErrors with visible DAGs. 


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to