Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAG run list: URL in run_id column does not work #39621

Closed
1 of 2 tasks
sbrinkhorst opened this issue May 14, 2024 · 6 comments
Closed
1 of 2 tasks

DAG run list: URL in run_id column does not work #39621

sbrinkhorst opened this issue May 14, 2024 · 6 comments
Labels
area:core area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug

Comments

@sbrinkhorst
Copy link

Apache Airflow version

2.9.1

If "Other Airflow 2 version" selected, which one?

No response

What happened?

In the DAG run view, the URL's of the run_id column don't work.

For example, I have a DAG that ran multiple times. The link in the dag_id column works as expected:
http://localhost:8080/dags/test-task/graph?execution_date=2024-05-14+11%3A39%3A20.673554%2B00%3A00
(It adds &dag_run_id=run_1 to the URL, but that is indeed correct.)

For the same DAG run the link in the run_id column is this: http://localhost:8080/dags/test-task/graph?dag_run_id=run_1

When clicking this it shows me the latest run of the DAG, and the URL is also changed to http://localhost:8080/dags/test-task/grid?dag_run_id=run_29&tab=graph

What you think should happen instead?

The link in the run_id column should take the user to the correct DAG run, because RunId's are unique identifiers of runs.

I'm not entirely sure what the link in the dag_id column should be. I'm fine with that staying as it is now, although I'm not sure what the value is of having the same link twice.

How to reproduce

  • Go to a DAG that ran more than once
  • For a DAG run that wasn't the latest for that DAG, click on the link in the run_id column. This will still take you to the latest run.

Previously there have been issues with selecting the correct DAG run if they were not in the last 25 runs. When doing a fix this should be verified to work.
This file creates two DAGs, one to trigger the other one 29 times. (Should be larger than your default_dag_run_display_number, which is by default 25.)

from airflow import DAG
from airflow.api.common.trigger_dag import trigger_dag
from airflow.operators.python import PythonOperator

def trigger_dags():
    for i in range(1, 30):
        trigger_dag(
            dag_id='test-task',
            run_id=f'run_{i}',
            conf={ 'run': i},
            replace_microseconds=False
        )


with DAG(dag_id="test-trigger", schedule=None) as dag:
    task = PythonOperator(
        task_id='trigger-dags',
        python_callable=trigger_dags
    )

with DAG(dag_id='test-task', schedule=None) as dag2:
    dummy_task = PythonOperator(
        task_id='dummy-task',
        python_callable=lambda params: print(f'this is run nr {params.get("run")}')
    )

Operating System

Debian bookwork

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

Using the official helm chart. I see the problem both on my local k8s cluster (on my mac) and in our EKS cluster.

Anything else?

I've tested it with two different browsers (Brave and Safari), same results.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@sbrinkhorst sbrinkhorst added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels May 14, 2024
Copy link

boring-cyborg bot commented May 14, 2024

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

@RNHTTR
Copy link
Collaborator

RNHTTR commented May 16, 2024

I wonder if the link in the DAG ID column should also take users to the DAG run associated with that row...

@RNHTTR RNHTTR added area:UI Related to UI/UX. For Frontend Developers. and removed needs-triage label for new issues that we didn't triage yet labels May 16, 2024
@RNHTTR
Copy link
Collaborator

RNHTTR commented May 16, 2024

This also appears broken for the Task Instance view.

@sbrinkhorst
Copy link
Author

I wonder if the link in the DAG ID column should also take users to the DAG run associated with that row...

That would be the current behaviour for the "List DAG Run" view. But for the "List Task Instance" view the Dag Id column just takes you to the main page for that DAG (e.g. http://localhost:8080/dags/test-task/graph). I don't have a strong preference for either of them, but I'm in favour of consistency.

I hadn't taken a look at the Task Instance view. The Run Id column indeed uses the same link as on the DAG Run page, so that is broken for exactly the same reasons. So if the URL needs to change that needs to be applied to both pages. But the link in the Task Id column suffers again from the "within last 25 runs" problem. So in my example with 29 runs that link works for run 5 to 29, but for run 1 to 4 it isn't able to select the right DAG/Task and shows a broken grid view page. So that needs fixing too.

@hterik
Copy link
Contributor

hterik commented May 28, 2024

This sounds like same issue as #39642.

@RNHTTR
Copy link
Collaborator

RNHTTR commented May 29, 2024

Closing as a duplicate of #39642

@RNHTTR RNHTTR closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

3 participants