ktaborski opened a new issue, #77860:
URL: https://github.com/apache/airflow/issues/77860

   ### Under which category would you file this issue?
   
   Airflow Core
   
   ### Apache Airflow version
   
   3.4.0
   
   ### What happened and how to reproduce it?
   
   The folder tree on the Dags page (added in #68544) only lists bundles that 
have at least one Dag in a subdirectory. GET /ui/dags/folders takes the parent 
of each Dag's relative_fileloc and drops it when the parent is . 
(airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py, 
get_dag_folders). As a result:
   
   A bundle whose Dags all sit at its root never appears in the tree. Its Dags 
show up only under "All Dags", and there is no way to narrow the list to that 
bundle from the tree.
   The bundle level disappears when only one bundle has subfolders. 
buildFolderTreeNodes (ui/src/pages/DagsList/DagFolderTree/buildFolderTree.ts) 
drops the bundle level when the payload holds a single bundle. In a deployment 
with several bundles where only one has subfolders, that bundle's folders are 
shown at the top level with no bundle node. The tree reads as if it covered the 
whole deployment.
   Root-level Dags of a bundle that does have subfolders can't be selected on 
their own. Clicking the bundle node shows the whole bundle, and every folder 
node excludes the root files.
   
   How to reproduce
   Configure two bundles in [dag_processor] dag_bundle_config_list:
   bundle_a with a Dag in a subdirectory, e.g. team_a/etl/dag_a.py
   bundle_b with its Dags at the root only, e.g. dag_b.py
   Open the Dags page.
   The folder tree shows team_a → etl at the top level. There is no node for 
bundle_a and none for bundle_b. dag_b is reachable only through "All Dags".
   
   
[airflow-folder-tree-repro.zip](https://github.com/user-attachments/files/35670159/airflow-folder-tree-repro.zip)
   
   ### What you think should happen instead?
   
   Every bundle that holds readable, non-stale Dags should appear as a node in 
the tree, whether or not it has subfolders. Selecting it should filter by 
bundle_name. Whether to show the bundle level should depend on how many bundles 
the deployment has, not on how many of them have subfolders.
   
   One possible approach: have /ui/dags/folders also return bundles with only 
root-level Dags, for example as an entry with an empty folder, or as a separate 
bundles list. Then build bundle nodes from that list.
   
   
   
   ### Operating System
   
   Linux
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Apache Airflow Provider(s)
   
   _No response_
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Official Helm Chart version
   
   Not Applicable
   
   ### Kubernetes Version
   
   _No response_
   
   ### Helm Chart configuration
   
   _No response_
   
   ### Docker Image customizations
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to