Skip to content

DAG triggering page does not reflect conf parameter in the URL query string #32859

@jsgh7276

Description

@jsgh7276

Apache Airflow version

2.6.3

What happened

I've found some unexpected behaviors of airflow webserver UI, when visiting DAG triggering page with conf in the URL query string.

  1. conf in the URL is not applied to the triggering page param text input.
  2. Cannot edit the actual DagRun conf when I trigger the DAG from triggering page with conf in the URL query string.

I have this simple DAG below, and I wanted to guide coworkers to trigger this DAG with specific conf included.

with DAG(
        dag_id="example_dag",
        default_args={
            "depends_on_past": False,
            "wait_for_downstream": False,
            "email_on_failure": False,
            "email_on_retry": False
        },
        description="This is example dag",
        start_date=datetime(2023, 6, 2),
        schedule=None,
        catchup=False,
        params={
            "key1": "default value 1",
            "key2": "default value 2"
        }
) as dag:

    t1 = BashOperator(
        task_id="example_task",
        bash_command="echo hello"
    )

    t1

So I provided the triggering URL http://webserver.url:8080/trigger?dag_id=example_dag&conf={"key1":"value1","key2":"value2"}.
But when visiting the URL, UI does not reflect the passed conf parameter in the query string.

As you can see in the screenshot below, pre-populated texts are just showing default params of the DAG, not the conf in the URL query.
image

Moreover, when I trigger the DAG by clicking the blue button in the above page, that DagRun gets conf in the URL query string. In other words, text input in the triggering page does not affect DagRun when the user visit the page with conf query string included. (This problem was also reproduced on airflow version 2.5.2)

What you think should happen instead

I suggest the text input in triggering page should reflect the passed conf in the query string.
Also, when the DagRun is triggered at the triggering page where conf is included in URL, I think DagRun should utilize conf in the text input, not in the URL.

How to reproduce

It is reproducible with above DAG example and the example URL(http://webserver.url:8080/trigger?dag_id=example_dag&conf={"key1":"value1","key2":"value2"}).

Operating System

CentOS Linux, MacOS

Versions of Apache Airflow Providers

apache-airflow-providers-common-sql==1.5.1
apache-airflow-providers-ftp==3.4.1
apache-airflow-providers-http==4.4.1
apache-airflow-providers-imap==3.2.1
apache-airflow-providers-mysql==4.0.2
apache-airflow-providers-sqlite==3.4.1

Deployment

Virtualenv installation

Deployment details

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

affected_version:2.6Issues Reported for 2.6affected_version:main_branchIssues Reported for main brancharea:UIRelated to UI/UX. For Frontend Developers.kind:bugThis is a clearly a bugpriority:lowBug with a simple workaround that would not block a release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions