-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Add support for favorite/pin dags to dashboard #51264
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
base: main
Are you sure you want to change the base?
Conversation
airflow-core/src/airflow/ui/src/pages/Dashboard/FavoriteDags/FavoriteDags.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general in my view. Besides th i18n also DB migration is missing allowing to upgrade existing setups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, LGMT.
FYI: https://github.com/apache/airflow/blob/main/contributing-docs/14_metadata_database_updates.rst for fixing database migrations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
A few comments
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dashboard/FavoriteDags/FavoriteDagCard.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dashboard/FavoriteDags/FavoriteDags.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/components/DagActions/FavoriteDagButton.tsx
Show resolved
Hide resolved
The DB migration should be present now. Let me know if anything is still missing or incomplete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for all the hard work.
A few minor suggestions, but looking good overall.
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dashboard/FavoriteDags/FavoriteDags.tsx
Outdated
Show resolved
Hide resolved
Hello @pierrejeambrun @bbovenzi, I just pushed a new commit that corrects the majority of the problems you pointed out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
We're getting closer, a few suggestions
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dashboard/FavoriteDags/FavoriteDags.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dashboard/FavoriteDags/FavoriteDags.tsx
Outdated
Show resolved
Hide resolved
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py
Outdated
Show resolved
Hide resolved
Hello @pierrejeambrun, I just pushed a new commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, a few suggestions but that's looking great 🎉
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dashboard/FavoriteDags/FavoriteDags.tsx
Outdated
Show resolved
Hide resolved
Hello @pierrejeambrun, Your requests should be fixed. |
airflow-core/src/airflow/ui/src/pages/Dashboard/FavoriteDags/FavoriteDags.tsx
Outdated
Show resolved
Hide resolved
Hello @bbovenzi, I just pushed some changes that should cover your requests. |
airflow-core/src/airflow/ui/src/components/DagActions/FavoriteDagButton.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we need a rebase too
Hello @bbovenzi, The rebase is done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really promising, and I think users will love it.
A few suggestions and things to fix before we can merge
We need to fix it for FabAuthManager
. If you run breeze with --auth-manager FabAuthManager
you will see that the server returns error 500. (apparently we need to cast the user_id
at some point because SQLAchemy is not happy about it)
airflow-core/src/airflow/ui/src/pages/Dashboard/FavoriteDags/FavoriteDagCard.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dashboard/FavoriteDags/FavoriteDagCard.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dashboard/FavoriteDags/FavoriteDagCard.tsx
Outdated
Show resolved
Hide resolved
Hello @pierrejeambrun, I just pushed some changes that should resolve the issues you pointed out. |
Co-authored-by: Mariana Isabel Marçal Santana <[email protected]>
…ssions. Co-authored-by: Mariana Isabel Marçal Santana [email protected]
Co-authored-by: Mariana Isabel Marçal Santana <[email protected]>
The favorited DAGs by an user, are stored persistently in the database. Co-authored-by: Mariana Isabel Marçal Santana <[email protected]>
Fix deleted DAGs being shown as favorites. Review the display structure of the favorite DAGs in the dashboard. Co-authored-by: Mariana Isabel Marçal Santana <[email protected]>
Co-authored-by: Mariana Isabel Marçal Santana <[email protected]>
Co-authored-by: Mariana Isabel Marçal Santana <[email protected]>
Co-authored-by: Mariana Isabel Marçal Santana <[email protected]>
Create new tests for the favorite/unfavorite endpoints. Add favorite button to the dag header. Other small fixes. Co-authored-by: Mariana Isabel Marçal Santana <[email protected]>
Co-authored-by: Mariana Isabel Marçal Santana <[email protected]>
The DAGs can be favorited in the DAGs list menu and are displayed in the Dashboard for easier access.
Information about the favorited DAGs is stored by user in the database and retrieved with API calls.
Dashboard view with 3 favorited DAGs (2 of them with previous DAG runs):
DAGs list menu view with some of the DAGs favorited:
cc @pierrejeambrun @bbovenzi
Closes: #45207