Skip to content

Mark Task Groups as Success/Failure#30478

Merged
bbovenzi merged 14 commits into
apache:mainfrom
tquazi:taskgroup-actions
Apr 27, 2023
Merged

Mark Task Groups as Success/Failure#30478
bbovenzi merged 14 commits into
apache:mainfrom
tquazi:taskgroup-actions

Conversation

@tquazi

@tquazi tquazi commented Apr 5, 2023

Copy link
Copy Markdown
Contributor

closes: #30220

This pull request adds ability to mark task groups as success/failure and have that propagate to the tasks within that task group. This feature is designed to provide a more efficient way to adjust the status of multiple tasks at once, especially for complex workflows with large numbers of tasks.

One of the primary use cases for this feature is when certain tasks in a task group have failed due to unexpected issues. Instead of manually setting the status of each failed task to "failed", users can mark the entire task group as "failed", and the system will automatically propagate this status to all tasks within the group. Similarly, in the case of a manual DAG run triggered through the UI or the API, where certain tasks or sensors may not matter for that run, users can easily mark the entire task group as "success" to avoid having to set each task individually.

I have tested this feature. Please let me know if there are any further changes or improvements that you would like me to make before merging this pull request.

Thank you for your time and consideration.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg Bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Apr 5, 2023
@tquazi

tquazi commented Apr 5, 2023

Copy link
Copy Markdown
Contributor Author

Here is the screenshot of the UI Layout:
image

@tquazi

tquazi commented Apr 5, 2023

Copy link
Copy Markdown
Contributor Author

fyi @eladkal @pierrejeambrun Please review

Comment thread airflow/models/dag.py Outdated
@bbovenzi bbovenzi added this to the Airflow 2.6.0 milestone Apr 5, 2023

@bbovenzi bbovenzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewing the UI code and testing locally. This looks good.
Ultimately, I'd like these actions to live in the REST API instead of the webserver.

After this is merged I'll rebase my actions PR: #30373

@tquazi
tquazi marked this pull request as draft April 5, 2023 15:09
@tquazi
tquazi marked this pull request as ready for review April 5, 2023 21:06

@jedcunningham jedcunningham left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This also needs test coverage.

Comment thread airflow/models/dag.py Outdated
Comment thread airflow/models/dag.py Outdated
@tquazi

tquazi commented Apr 6, 2023

Copy link
Copy Markdown
Contributor Author

This also needs test coverage.

I have added Test Cases for dag.set_task_group_state and view._mark_task_group_state.

Comment thread airflow/models/dag.py Outdated
Comment thread airflow/models/dag.py Outdated
Comment thread airflow/www/views.py Outdated
Comment thread airflow/www/views.py Outdated
Comment thread airflow/models/dag.py Outdated
tquazi added 4 commits April 14, 2023 23:12
1. Added Test Cases for dag.set_task_group_state and view._mark_task_group_state.
2. Added new method dag.set_task_group_state, which can be used when setting the state on a task group.
@tquazi
tquazi force-pushed the taskgroup-actions branch from d7f3760 to 97b99d2 Compare April 15, 2023 17:23
tquazi added 5 commits April 15, 2023 13:27
1. Added Test Cases for dag.set_task_group_state and view._mark_task_group_state.
2. Added new method dag.set_task_group_state, which can be used when setting the state on a task group.
@tquazi
tquazi force-pushed the taskgroup-actions branch from 97b99d2 to aeb2d66 Compare April 15, 2023 17:27
@tquazi

tquazi commented Apr 15, 2023

Copy link
Copy Markdown
Contributor Author

image

@tquazi
tquazi requested a review from ashb April 15, 2023 20:19
@set92 set92 mentioned this pull request Apr 24, 2023
6 tasks
@bbovenzi
bbovenzi merged commit 1132da1 into apache:main Apr 27, 2023
@boring-cyborg

boring-cyborg Bot commented Apr 27, 2023

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@NilsJPWerner

Copy link
Copy Markdown
Contributor

Will this change still work now that the task group button actions have been moved in the ui?

@bbovenzi

Copy link
Copy Markdown
Contributor

Will this change still work now that the task group button actions have been moved in the ui?

Yep!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues type:new-feature Changelog: New Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

set tasks as successful/failed at their task-group level.

8 participants