Repository navigation
Closed
Labels
AIP-38Modern Web ApplicationModern Web Applicationaffected_version:main_branchIssues Reported for main branchIssues Reported for main brancharea:UIRelated to UI/UX. For Frontend Developers.Related to UI/UX. For Frontend Developers.area:corekind:bugThis is a clearly a bugThis is a clearly a bug
Milestone
Description
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
airflow/airflow/models/taskinstance.py
Lines 2035 to 2054 in bb56052
| @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 |
airflow/airflow/models/taskinstance.py
Lines 2056 to 2069 in bb56052
| @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
- Create a dag with
email_on_failure = True. - 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
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
AIP-38Modern Web ApplicationModern Web Applicationaffected_version:main_branchIssues Reported for main branchIssues Reported for main brancharea:UIRelated to UI/UX. For Frontend Developers.Related to UI/UX. For Frontend Developers.area:corekind:bugThis is a clearly a bugThis is a clearly a bug
Activity
aditya0yadav commentedon Feb 20, 2025
please assign this to me
tirkarthi commentedon Feb 26, 2025
Thanks @aditya0yadav, assigned.
tirkarthi commentedon Mar 7, 2025
@aditya0yadav Please let me know if you are you still working on this? If not I can raise a PR for this before the RC release. Thanks.
aditya0yadav commentedon Mar 7, 2025
@tirkarthi by tommorow i will raise the pr
aditya0yadav commentedon Mar 9, 2025
do i have to change the test for the task instance right
tirkarthi commentedon Mar 9, 2025
Yes, the tests test_log_url and test_mark_success_url in test_taskinstance.py should be updated .
aditya0yadav commentedon Mar 10, 2025
Closes #47550.
If any changes are needed, please let me know.
tirkarthi commentedon Mar 10, 2025
@aditya0yadav You have two PRs with one containing only test change. The fix and test case update should be part of same PR. Please also test the URLs constructed to be valid.
#47542
#47550
aditya0yadav commentedon Mar 10, 2025
Sorry, it happened by mistake