Skip to content

List host software endpoint only lists "available to install" software that never received an install request #21082

@mna

Description

@mna

Fleet version:

main at f836722

Web browser and operating system:
N/A


💥  Actual behavior

On the host page, software tab, filtering by "Available for install" only shows the installers (packages or VPP apps) that have never been requested to install on that host, instead of all the available installers.

🧑‍💻  Steps to reproduce

  • Create a team, add a software installer (or VPP app) to that team,
  • Enroll a host in that team
  • In that host's page, software tab, filter by Available for install -> that software should show up.
  • Request an install for that software.
  • Refresh the host's page, filter by Available for install, that software installer does not show up anymore. Remove the filter to view all software, it shows up in "Pending" state (or installed/failed).

🕯️ More info (optional)

Currently, there's a AvailableForInstall field that controls this filter. I'd suggest renaming it to OnlyAvailableForInstall to avoid confusion with the other IncludeAvailableForInstall filter (without changing the query string that sets it, so it's only an internal implementation change).

When OnlyAvailableForInstall is set, both the stmtInstalled and stmtAvailable queries must be executed (with the UNION), but a condition must be added to stmtInstalled so that only rows corresponding to an installer (( hsi.host_id IS NOT NULL OR hvsi.host_id IS NOT NULL )) must be returned.

Currently, only the stmtAvailable query is used, which excludes all installers where an install request has been recorded.

Metadata

Metadata

Assignees

Labels

#g-mdmMDM product group:releaseReady to write code. Scheduled in a release. See "Making changes" in handbook.bugSomething isn't working as documented~backendBackend-related issue.~unreleased bugThis bug was found in an unreleased version of Fleet.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions