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

Add task documentation to details tab in grid view. #39899

Merged
merged 4 commits into from
Jun 10, 2024

Conversation

tirkarthi
Copy link
Contributor

@tirkarthi tirkarthi commented May 28, 2024

closes: #39676
closes: #12750
related: #39676

This PR enhances the task detail API to return doc_md in API. It follows a similar approach to task dependency check component to hit the API and display the documentation as an accordion like notes so that it can be expanded/collapsed as needed.

Documentation accordion expanded

image

Documentation accordion collapsed

image

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels May 28, 2024
@tirkarthi tirkarthi mentioned this pull request May 28, 2024
2 tasks
@bbovenzi bbovenzi added this to the Airflow 2.10.0 milestone May 28, 2024
@bbovenzi
Copy link
Contributor

Let's rebase and see if that fixes the CI errors?

@eladkal eladkal added the type:improvement Changelog: Improvements label May 28, 2024
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Three small things you might change if you need to fix the tests anyway.

Before merge I'd like to ask if we need to support the other doc formats as well. Currently in the "legacy" views as described in https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/dags.html#dag-task-documentation it is also supported to add plain text, JSON, YAML and RST - I am not sure whether somebody really uses these but the current version only supports MD. I am okay with this but the documentation might need to be adjusted. At least the legacy pages show also the JSON, YAML, plain text and RST (as plain text though).

Can I kindly request to adjust the docs?

airflow/api_connexion/openapi/v1.yaml Outdated Show resolved Hide resolved
airflow/www/static/js/api/useTaskDetail.tsx Outdated Show resolved Hide resolved
@tirkarthi
Copy link
Contributor Author

Thanks @jscheffl for pointing that out. I tried making something like a multi level accordion but it looks cluttered to me. Also there is json renderer used for dag run conf but rst might need a renderer. I feel this needs a separate discussion of it's own to build the UX and probably taken as a separate PR with doc_md being the more common one useful in this PR.

image

@tirkarthi
Copy link
Contributor Author

@bbovenzi I have rebased with latest main branch but the tests still seem to fail due to fab provider related issues which are not related to the PR.

Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then... okay yeah also don't want to generate a (new) cluttered view. Was mainly looking at documentation which pointed to more options than markdown.

For me it is okay to adjust the documentation in a follow-up clean PR where the legacy pages are removed and thus the documentation display either need to be extended or documentation adjusted that only doc_md will be displayed on UI.

@bbovenzi
Copy link
Contributor

Then... okay yeah also don't want to generate a (new) cluttered view. Was mainly looking at documentation which pointed to more options than markdown.

For me it is okay to adjust the documentation in a follow-up clean PR where the legacy pages are removed and thus the documentation display either need to be extended or documentation adjusted that only doc_md will be displayed on UI.

Let's go with just doc_md. The UI is allowed to have opinions sometimes.

@tirkarthi
Copy link
Contributor Author

Fab tests keep failing though other PRs seem to pass after multiple rebases to this PR. Any idea?

@bbovenzi
Copy link
Contributor

bbovenzi commented Jun 4, 2024

Let's rebase again and see if the test failures persists?

@tirkarthi
Copy link
Contributor Author

I also noticed report where one another PR also has failing provider tests.

#40034 (comment)

@jscheffl
Copy link
Contributor

jscheffl commented Jun 5, 2024

I also noticed report where one another PR also has failing provider tests.

#40034 (comment)

Hope that #40059 fixed it.

@tirkarthi
Copy link
Contributor Author

tirkarthi commented Jun 6, 2024

I have rebased and it still fails.

@potiuk
Copy link
Member

potiuk commented Jun 6, 2024

One more fix is needed (I wrongly used return instead of exit for the check): #40089

@tirkarthi tirkarthi force-pushed the grid-task-doc branch 2 times, most recently from 0fe3719 to 2f3df3c Compare June 7, 2024 14:04
@jscheffl
Copy link
Contributor

GREEN - ready to get merged (finally)?

@bbovenzi bbovenzi merged commit 587a574 into apache:main Jun 10, 2024
47 of 49 checks passed
@tirkarthi
Copy link
Contributor Author

Thank you very much all for constant updates to the PR. Happy to see this finally merged.

romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Jul 26, 2024
* Add task documentation to details tab in grid view.

* Fix tests.

* Fix tests.

* Fix PR comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues type:improvement Changelog: Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output tasks doc in the UI Task level documentation in other place than Task Details
6 participants