Fleet UI: Payload-free software installs - #33979
Conversation
ad49960 to
5619f94
Compare
8404c3e to
2cb2296
Compare
✅ Actions performedSummary regeneration triggered. |
|
@coderabbitai summary |
✅ Actions performedSummary regeneration triggered. |
1 similar comment
✅ Actions performedSummary regeneration triggered. |
WalkthroughAdds payload-free/script package support across the app: new SoftwareScriptDetailsModal UI with fetching and actions; script-aware statuses, predicates, and icons; expanded interfaces and setup step types; script package handling in host and software pages; and related tests, styling, and utilities. Some existing modals and components now use combined install/uninstall status types. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User as User
participant HostSW as HostSoftwareLibrary/SelfService
participant Modal as SoftwareScriptDetailsModal
participant Query as react-query
participant API as deviceUserAPI/softwareAPI
User->>HostSW: Click script status (Ran/Failed/Pending)
HostSW->>Modal: Open with {host_display_name?, install_uuid, hostSoftware?, deviceAuthToken?}
Modal->>Query: useQuery(fetchInstallResult)
alt deviceAuthToken provided
Query->>API: deviceUserAPI.getSoftwareInstallResult(install_uuid)
else
Query->>API: softwareAPI.getSoftwareInstallResult(install_uuid)
end
API-->>Query: {status, script_output?, host_display_name?}
Query-->>Modal: data/error/loading
Modal->>User: Show StatusMessage (success/pending/error), contact link?, script output (toggle)
opt Failure on My Device Page
User->>Modal: Click Rerun
Modal-->>HostSW: onRerun(hostSoftwareId)
end
User->>Modal: Cancel/Done
Modal-->>HostSW: onCancel()
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (50)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
WalkthroughAdds script-only package support across UI and types, introduces SoftwareScriptDetailsModal for script install results, updates status models and predicates to unify install/uninstall/script states, threads source-aware logic through activity, host, and software pages, and adjusts setup step typing. Includes tests, styles, helpers, and small comment/typing updates. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI as SoftwareScriptDetailsModal
participant RQ as react-query
participant API as deviceUserAPI/softwareAPI
participant Store as State
User->>UI: Open modal (script package)
UI->>UI: Determine context (My Device vs Fleet)
UI->>RQ: useQuery(fetchInstallResult)
RQ->>API: GET install result (by install_uuid/device token)
API-->>RQ: 200 OK | 404/401 | error
alt 200 OK
RQ-->>UI: installResult
UI->>UI: Validate status (installed/pending_install/failed_install)
UI->>User: Render StatusMessage, RevealButton, output textarea
opt My Device and failed_install
User->>UI: Click Rerun
UI->>Store: onRerun(hostSoftwareId)
end
User->>UI: Close/Done
else 404/401 (My Device)
RQ-->>UI: auth/not found
UI->>User: DeviceUserError
else other errors
RQ-->>UI: error
UI->>User: DataError
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (50)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
WalkthroughAdds script-package support across UI: new SoftwareScriptDetailsModal, script status predicates/icons, and propagation of isScriptPackage/source-aware logic. Migrates many types from SoftwareInstallStatus to SoftwareInstallUninstallStatus and introduces Enhanced variants. Updates Device User setup-step typing and sorting. Extends software pages, host library, and self-service to open script details. Tests and styles included. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant HS as HostSoftwareLibrary/SelfService
participant ISC as InstallStatusCell
participant MOD as SoftwareScriptDetailsModal
participant Q as react-query
participant API as Fleet API
participant DEV as Device-auth API
U->>HS: Click script status (Ran/Failed/Run)
HS->>ISC: Render status cell with onShowScriptDetails
ISC-->>HS: onShowScriptDetails(hostSoftware)
HS->>MOD: Open SoftwareScriptDetailsModal(details)
rect rgba(200,235,255,0.3)
note over MOD: Load script install details
MOD->>Q: useQuery(key, fetchFn)
alt Device page
Q->>DEV: GET /device/.../script_result
DEV-->>Q: result or error
else Fleet UI
Q->>API: GET /hosts/{id}/software/{hostSoftwareId}/script_result
API-->>Q: result or error
end
Q-->>MOD: data | error | loading
MOD-->>U: Show status, host/app, output (reveal), contact option
end
alt Failure from My Device page
U->>MOD: Click Rerun
MOD->>HS: onRerun(hostSoftwareId)
HS-->>U: Trigger reinstall action
else Any status
U->>MOD: Click Done/Cancel
MOD-->>HS: onExit()
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (50)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ghernandez345
left a comment
There was a problem hiding this comment.
just some comments of things i noticed. nothing major requiring change. let me know when its ready for final review and i'll take a look again
| enabled: !!isInstalledByFleet, | ||
| ...DEFAULT_USE_QUERY_OPTIONS, | ||
| staleTime: 3000, | ||
| select: (data) => data.results as ISoftwareScriptResult, |
There was a problem hiding this comment.
im wondering of instead of dynamically handling which request is called we jsut have two use query method calls; one for deviceUserAPI.getSoftwareInstallResult and one for softwareAPI.getSoftwareInstallResult. and enabling one and disabling the other depending on deviceAuthToken. you would have to do the type casting here. what do you think?
There was a problem hiding this comment.
The bulk of the useQuery setup is the same, so I'm wondering why we’d want to introduce two separate calls instead of handling the conditional inside one? This would be the fourth modal that follows this same pattern, so keeping it consistent and avoiding duplicate logic seems cleaner to me. Thoughts @ghernandez345 ?
There was a problem hiding this comment.
lets chat about this one next wed. Its not blocking. its more of a question if having multiple useQuery calls gives us something better than making the request method dynamic. Im not sure it does but thought it was worth asking about it.
There was a problem hiding this comment.
I think at some point we can create one config that has the keys as the statuses and the value being all the different config settings instead of redefining the same key across multiple objects. Would make it easier to see all the settings for a status in one object. thats something for the future, though.
There was a problem hiding this comment.
Ooo that would be nice. like one ui_status object to rule them all each status with the same keys like softwareTitleStatusTooltip selfServiceTableStatusTooltip selfServiceTableStatus selfServiceTableInstallText etc etc all be in one giant config?
There was a problem hiding this comment.
yah something like that. maybe we break it up a bit but the idea being having something that makes it easy to have a status and get the config options needed for that status.
| details={{ | ||
| host_display_name: hostDisplayName, | ||
| install_uuid: | ||
| selectedHostSWScriptDetails.software_package?.last_install |
There was a problem hiding this comment.
whenever I have this, I just do the check before rendering the component. so in this case it would be the check for install_uuid in the same line as the check for selectedHostSWScriptDetails. Then you are always sure to have that value and the Modal component wouldnt need to do some funny typing to handle undefined.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #33979 +/- ##
==========================================
- Coverage 64.23% 64.17% -0.06%
==========================================
Files 2059 2058 -1
Lines 207035 206248 -787
Branches 6826 6992 +166
==========================================
- Hits 132988 132368 -620
+ Misses 63611 63497 -114
+ Partials 10436 10383 -53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Re: failing tests, seems to be BE related off main but already DMed @ghernandez345 saying I'm not going to rebase on main to see if it fixes it until he tells me it's okay since sometimes that removes a github user's review progress.
|


Issue
#33736
Description
Checklist for submitter
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
Testing
Added/updated automated tests
QA'd all new/changed functionality manually
Summary by CodeRabbit