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

DRAFT - [ADVISOR-2670] Add cancel task #52

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johnsonm325
Copy link
Collaborator

This PR allows a task, that has not been completed, to be cancelled. If a task status is "Running", the kebab dropdown on the completed tasks table should include "Cancel" instead of delete. The same is true if you view the details page of a completed task. The kebab in the right of the top header should include "Cancel" instead of delete.

After clicking cancel, there are a number of things you will see in the modal. You will have the option to:

  • Cancel a task - this will simply cancel but leave all details of the completed task in the table
  • Cancel and delete a task - this will remove the task from your table and the backend will handle cancelling and deleting.

Additionally, a task can only cancel jobs on systems that are connected via Satellite. A system with any other means of connection cannot be cancelled. Therefore, when entering the cancel modal, if any system is NOT connected via Satellite, there will be a sentence in the modal body stating, "Tasks running on systems connected with rhc cannot be cancelled." Likewise, if a task is running on systems ONLY connected via Satellite, that sentence will not be visible.

Now, at this point, cancelling isn't working properly. The backend is not able to properly cancel a task. So, when you cancel a task, you'll notice the task returns a status of "Cancelled", but the jobs will still say they are "Running". This much is normal. What we would expect is to eventually see those jobs return as "Cancelled" if they are connected via Satellite, and some other status if they are connected via rhc. But what currently happens is all systems finish their runs and the status of the task completes and the "Run end" value includes a successful run completion time.

The frontend code should work fine when the backend code is implemented.

This PR allows a task, that has not been completed, to be cancelled. If a task status is "Running", the kebab dropdown on the completed tasks table should include "Cancel" instead of delete. The same is true if you view the details page of a completed task. The kebab in the right of the top header should include "Cancel" instead of delete.

After clicking cancel, there are a number of things you will see in the modal. You will have the option to: Cancel a task - this will simply cancel but leave all details of the completed task in the table Cancel and delete a task - this will remove the task from your table and the backend will handle cancelling and deleting.

Additionally, a task can only cancel jobs on systems that are connected via Satellite. A system with any other means of connection cannot be cancelled. Therefore, when entering the cancel modal, if any system is NOT connected via Satellite, there will be a sentence in the modal body stating, "Tasks running on systems connected with rhc cannot be cancelled." Likewise, if a task is running on systems ONLY connected via Satellite, that sentence will not be visible.

Now, at this point, cancelling isn't working properly. The backend is not able to properly cancel a task. So, when you cancel a task, you'll notice the task returns a status of "Cancelled", but the jobs will still say they are "Running". This much is normal. What we would expect is to eventually see those jobs return as "Cancelled" if they are connected via Satellite, and some other status if they are connected via rhc. But what currently happens is all systems finish their runs and the status of the task completes and the "Run end" value includes a successful run completion time.

The frontend code should work fine when the backend code is implemented.
@johnsonm325 johnsonm325 requested a review from a team September 16, 2022 19:39
@codecov-commenter
Copy link

Codecov Report

Base: 84.32% // Head: 83.84% // Decreases project coverage by -0.48% ⚠️

Coverage data is based on head (8993749) compared to base (216db69).
Patch coverage: 76.47% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #52      +/-   ##
==========================================
- Coverage   84.32%   83.84%   -0.49%     
==========================================
  Files          45       45              
  Lines         957      978      +21     
  Branches      294      305      +11     
==========================================
+ Hits          807      820      +13     
- Misses        133      141       +8     
  Partials       17       17              
Impacted Files Coverage Δ
...nents/CompletedTaskDetails/CompletedTaskDetails.js 85.29% <ø> (ø)
...nts/DeleteCancelTaskModal/DeleteCancelTaskModal.js 74.19% <60.00%> (-25.81%) ⬇️
...letedTaskDetailsKebab/CompletedTaskDetailsKebab.js 100.00% <100.00%> (ø)
...ponents/CompletedTasksTable/CompletedTasksTable.js 100.00% <100.00%> (ø)
...ts/CompletedTasksTable/hooks/useActionResolvers.js 100.00% <100.00%> (ø)
src/SmartComponents/completedTaskDetailsHelpers.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@johnsonm325 johnsonm325 changed the title [ADVISOR-2670] Add cancel task DRAFT - [ADVISOR-2670] Add cancel task Oct 11, 2022
@Fewwy
Copy link

Fewwy commented Nov 25, 2022

@johnsonm325 Reviewed the PR - sent you a message on slack

@gkarat gkarat marked this pull request as draft December 14, 2022 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants