Detecting Dags directory and files from branch name

$ airflow-devenv create --branch akhatun/edit-type-dag  --changes-only 
Airflow development environment provisioning parameters:
- instance name: dev-atsuko
- pulled git branch: akhatun/edit-type-dag
- airflow-dags folder: research
- Dag files to render: ['dags/edit_types_dag.py']
$ airflow-devenv create --branch T317210_airflow_deb_creation  --changes-only 
Usage: airflow-devenv create [OPTIONS]

Error: Invalid value for '-c' / '--changes-only': Can not detect dags_folder: more than 1 directory with dags changed, {'analytics', 'research', 'analytics_test', 'platform_eng'}

$ airflow-devenv create --branch T317210_airflow_deb_creation --dags-folder analytics --changes-only
debug: dag folder analytics wasn't found in branch main, re-checking with branch T317210_airflow_deb_creation
debug: filtering only analytics

Airflow development environment provisioning parameters:
- instance name: dev-atsuko
- pulled git branch: T317210_airflow_deb_creation
- airflow-dags folder: analytics
- Dag files to render: ['dags/anomaly_detection/anomaly_detection_dag_factory.py', ...]
  1. Cleaning up and typing code
    • __main__.py to test with :~/airflow-devenv$ python3 -m airflow_devenv
    • removed debug chaining
    • list -> list_cmd
    • logs to click
    • black/mypy
  2. Resolving branch name and checking dags folders
    • setting --branch-name to dev-{unix-name} in manager since click is so bad
    • re-validating dags-folder in against specified branch
  3. Pass the files to filter on
    • Get dags_folder and files from the branch
    • Validate files against the file list if not validated yet

Bug T420730

Edited by Atsuko

Merge request reports

Loading