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

Update Airflow 2 UI links for Airflow 3 #46902

Open
1 of 2 tasks
tirkarthi opened this issue Feb 19, 2025 · 1 comment
Open
1 of 2 tasks

Update Airflow 2 UI links for Airflow 3 #46902

tirkarthi opened this issue Feb 19, 2025 · 1 comment
Labels
AIP-38 Modern Web Application area:core area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug kind:feature Feature Requests

Comments

@tirkarthi
Copy link
Contributor

Apache Airflow version

main (development)

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

No response

What happened?

Airflow 2 has email_on_failure and other actions that generate links to Airflow 2 UI. This will result in 404 in Airflow 3 once old UI is removed and should be updated. Some of the links I found

@property
def log_url(self) -> str:
"""Log URL for TaskInstance."""
run_id = quote(self.run_id)
base_url = conf.get_mandatory_value("webserver", "BASE_URL")
map_index = f"&map_index={self.map_index}" if self.map_index >= 0 else ""
_log_uri = (
f"{base_url}"
f"/dags"
f"/{self.dag_id}"
f"/grid"
f"?dag_run_id={run_id}"
f"&task_id={self.task_id}"
f"{map_index}"
"&tab=logs"
)
if self.logical_date:
base_date = quote(self.logical_date.strftime("%Y-%m-%dT%H:%M:%S%z"))
_log_uri = f"{_log_uri}&base_date={base_date}"
return _log_uri

@property
def mark_success_url(self) -> str:
"""URL to mark TI success."""
base_url = conf.get_mandatory_value("webserver", "BASE_URL")
return (
f"{base_url}"
"/confirm"
f"?task_id={self.task_id}"
f"&dag_id={self.dag_id}"
f"&dag_run_id={quote(self.run_id)}"
"&upstream=false"
"&downstream=false"
"&state=success"
)

What you think should happen instead?

No response

How to reproduce

  1. Create a dag with email_on_failure = True .
  2. Check failure email link to have log url to Airflow 3 UI.

Operating System

Ubuntu 20.04

Versions of Apache Airflow Providers

No response

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

@tirkarthi tirkarthi added AIP-38 Modern Web Application area:core kind:bug This is a clearly a bug labels Feb 19, 2025
@dosubot dosubot bot added area:UI Related to UI/UX. For Frontend Developers. kind:feature Feature Requests labels Feb 19, 2025
@aditya0yadav
Copy link
Contributor

please assign this to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AIP-38 Modern Web Application area:core area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug kind:feature Feature Requests
Projects
None yet
Development

No branches or pull requests

2 participants