Skip to content

Cancel upcoming activities #25540

@marko-lisica

Description

@marko-lisica

Goal

User story
As an IT admin,
I want to cancel upcoming activities
so that I can prioritize important activities or cancel wrong actions.

Key result

One queue for MDM commands, software, and scripts

Original requests

#20712

Context

Changes

Product

Engineering

  • Test plan is finalized
  • Feature guide changes: CUA: Guide #27534
  • Database schema migrations: N/A
  • Load testing: N/A

ℹ️  Please read this issue carefully and understand it. Pay special attention to UI wireframes, especially "dev notes".

QA

Risk assessment

  • Requires load testing: no
  • Risk level: Low / High: low
  • Risk description: Introducing the unified queue was high risk and required load testing, but since those are now complete additional load testing is not required for the cancelation feature.

Test plan

Make sure to go through the list and consider all events that might be related to this story, so we catch edge cases earlier.

UI

  • Make sure that user can cancel upcoming activities on the host details page, by hovering over the upcoming activity and clicking ❌ icon.
  • Make sure that confirmation modal with details about activity that's being canceled pops up when user hit cancel icon
  • Once the user confirms the cancel action, a success or error flash message should appear on the screen and upcoming activities should be refetched.
  • Make sure that when user cancels activity it's tracked in host's past activity (and global past activities) as one of canceled_run_script, canceled_install_app_store_app, canceled_install_software, canceled_uninstall_software, or canceled_uninstall_app_store_app activity.
  • Make sure that when Windows or Linux host is locked and the lock script is canceled, LOCK PENDING badge from host details is cleared and lock activity isn't logged to host's past and global activity feed.
  • Make sure that when Windows or Linux host is wiped (Windows wipe is via MDM, not in the upcoming queue at the moment) and the wipe script is canceled, WIPE PENDING badge from host details is cleared and lock activity isn't logged to host's past and global activity feed.
  • Make sure that if the user cancels installed_software or uninstalled_software activity, on the host details > software, the status of that software is changed from pending to whatever it was before.
  • Make sure that if the user cancels installed_app_store_app or uninstalled_app_store_app activity, on the host details > software, the status of that software is changed from pending to whatever it was before.
  • Make sure that if the user cancels ran_script activity, on the host details > run script modal, status of that script is changed from pending to whatever it was before.
  • Make sure that pending status count on the software title details page is updated after installed_software or installed_app_store_app is canceled.
  • Make sure that only users with maintainer or admin role can cancel host's upcoming activities.
  • Make sure that when 1st activity in the upcoming queue is canceled, results from that activity isn't tracked in the host's past or global feed, just activity about cancelation is tracked in host's past feed.
  • Make sure that when installing software if the host isn't in the target anymore (team change or labels change) software install upcoming activity is canceled by Fleet and not tracked as canceled activity in the host's past feed.
  • Make sure that if host record is deleted from Fleet, and it's enrolled again, all previous upcoming and past activities are deleted and don't affect new enrollment.
  • If user cancel upcoming activity and it's running or is about to run in setup experience flow, Fleet should show failed status for those activities (software or script) and proceed to next one.
  • Make sure that if a Lock or Wipe activity is next to run (first in queue), the server prevents cancelling it and the expected error message is displayed.

API

  • Make sure that user can cancel upcoming activity via API: DELETE /api/v1/fleet/hosts/:id/activities/upcoming/:activity_id
  • Make sure that cancelable flag in the upcoming activity response is deleted.

Happy path ✅

  1. Go to host details page, scroll to activities card, then select upcoming activities (assuming there's a few upcoming activities feed)
  2. Cancel 3rd upcoming activity in the list.
  3. It was successful, activities are refetched, and cancel is tracked in the host's past activity feed (and the global feed).
  4. Now, cancel 1st activity in the upcoming queue
  5. It was successful, activities are refetched, and canceled activity isn't tracked in the host's past feed, nor in the global feed. Only activity about cancelation is tracked in the host's past activity feed (and the global feed).

Testing notes

Confirmation

  1. Engineer: Added comment to user story confirming successful completion of test plan.
  2. QA: Added comment to user story confirming successful completion of test plan.

Metadata

Metadata

Assignees

Labels

#g-mdmMDM product group:productProduct Design department (shows up on 🦢 Drafting board)storyA user story defining an entire feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions