-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Modal Confirmation Dialog before rerun of tasks in 'Running', 'Restarting', and 'Up_for_retry' states. #55660
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
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
|
The backend should return an error on an erroneous second clear action. Let's not do a UI-only bandaid solution. |
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.
Cool, thanks for the PR.
As mentioned by Brent, we can do that on the server side.
We can add a flag to the server, default behavior stays the same. (we don't want to break the API backward compat), and the front-end set the appropriate flag value to prevent reclearing if dag is already runing.
...ore/src/airflow/ui/src/components/Clear/TaskInstance/ClearTaskInstanceConfirmationDialog.tsx
Outdated
Show resolved
Hide resolved
|
Also we should probably do something similar for Runs. |
…nning, up_for_retry, or restarting state.
7f8daa2 to
fb4e814
Compare
…n confirmation dialogue.
…and ui still not communicating. MIGHT revert to previous commit.
…that will not run the instance until the instance is not running.
jason810496
left a comment
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 the PR!
The tests are required for the Airflow Core change, thanks!
airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py
Outdated
Show resolved
Hide resolved
…o router. Followed suggestion about attribute access.
airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py
Outdated
Show resolved
Hide resolved
…nningTasks in dags.json in the en locale.
pierrejeambrun
left a comment
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, a few more comments.
airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/ClearTaskInstanceDialog.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/datamodels/task_instances.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py
Outdated
Show resolved
Hide resolved
…ent_running_tasks' addition to ti, instead, it is passed as a parameter in clearTaskInstance.
pierrejeambrun
left a comment
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.
Looking good. A few last comments and we should be good to merge.
airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py
Outdated
Show resolved
Hide resolved
…Error code 400 is still being raised in the router.
…f trying to clear a running task.
jason810496
left a comment
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 update and please not be hesitate to resolve the addressed comments.
The test for airflow-core/src/airflow/models/taskinstance.py change is required.
airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py
Outdated
Show resolved
Hide resolved
|
Hello, This is how the PR currently looks like: chrome_VkmgN56gJw.mp4Since the current state of this PR is a little bit different from the expected outcome stated in the PR description, I will make a new PR that uses this PR's code. The will be new PR's goal will still be the same however in the description, instead of a modal pop-up, it will be a checkbox instead. |
|
So should we close this PR in favor of the other one? |
If possible, yes. |
|
Closing as requested @KlarenceNicolasCatalan |
Why
This is a pull request based on the raised issue #54379.
Summary of the issue:
A UI implementation of a workaround that seeks to prevent duplicate runs of the same task instance by adding another confirmation pop-up before re-running tasks in a running, restarting, or up-for-retry state.
What
The pop-up confirmation works by checking the state of the task instance when requesting a rerun. If the task instance is in a running, restarting, or up-for-retry state, then it will display a second confirmation pop-up. Otherwise, it will not show the second pop-up confirmation dialog.
Here is a sample of the modal confirmation dialog when a task is running:
chrome_tBE1fBd92x.mp4
Here is a sample where the modal will not display when trying to re-run a task in other states other than running, restarting, and up-for-retry:
chrome_YoFXuWnYl3.mp4
Here is another, longer sample that simulates 2 users trying to re-run the same task:
axhSsOHNIc.mp4