fleetdm / fleet

Open device management
https://fleetdm.com
Other
5.23k stars 617 forks source link

Host Software API: Surface automatic install policies #30197

Open RachelElysia opened 3 weeks ago

RachelElysia commented 3 weeks ago

Fleet version: All since software titles were added


💥  Actual behavior

I can see automatic install policies attached to installers from the /software/titles page but not from the /hosts/:id/software page

🧑‍💻  Steps to reproduce

  1. Try to look for the automatic_install_policies key while looking at host software (hosts/:id/software API) of a software that has automatic_install_policies set when looking at software (software/ API)
  2. Notice it's always set to null even if it's set on the software title

🕯️ More info (optional)

Here's screenrecordings of the mismatch

First 30 or so seconds only shows there's automatic policies attached to that software title https://github.com/user-attachments/assets/ddb5e4b7-1a75-4bdf-8539-2a5a765a7c81

Shows there's no automatic policies attached to that software title for the particular host https://github.com/user-attachments/assets/31fd1395-c440-46f0-b964-fcb4d8b8a1d1

🛠️ To fix

RachelElysia commented 3 weeks ago

cc: @iansltx

Second backend bug that will be highly noticeable with hackathon work

iansltx commented 3 weeks ago

Pulling back to drafting as, while this means we can't show the automatic policies icon in software library/inventory in the host details view yet, we're no worse off than we are right now. @RachelElysia it still makes sense for the FE to consume the data when it's available, but unlike #30188 this isn't going to be an immediate source of user confusion, so there are items currently in the sprint we don't want to evict in favor of this, and potentially stuff we want to bring in instead of this.

eugkuo commented 2 weeks ago

@RachelElysia I've added the following to this ticket which I think resolves the issue in question?

I'll move this to ready to estimate and add planning poker. If there's other things to do please pull it back so that any remaining items can be addressed. Thanks!

cc @mostlikelee

eugkuo commented 2 weeks ago

Planning poker: https://fleetdm.slack.com/archives/C08RXDH5LHZ/p1750684407360969

Hoping this is FE only.

eugkuo commented 2 weeks ago

@iansltx Coolio. I added a design to this and moved it to ready to estimate, but it can sit there I guess until such time as we want to pull it forward.

iansltx commented 2 weeks ago

@eugkuo This is actually backend-only. FE work for this is already done. This is another ListHostSoftware related case, and we'll want to take care to not have an N+1 here I think.

jahzielv commented 2 weeks ago

Are there plans to create separate web API endpoints for the library and inventory? That could help simplify ListHostSoftware.

iansltx commented 2 weeks ago

@jahzielv In this case, that wouldn't help, as current designs call for showing the "this has auto-install policies" icon on both library and inventory pages within host software details. If we stopped showing installer-related icons on inventory that would clean things up a bit (though this would still need to implement this for the library side) but that'd require a change to the desired fix here.

Re: splitting endpoints, that would be out of scope for this bug, and would need a new issue filed.

jahzielv commented 2 weeks ago

Re: splitting endpoints, that would be out of scope for this bug, and would need a new issue filed.

Oh yeah for sure! I don't think it should be done here, but seeing this ticket made me think about it :D