elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.63k stars 8.22k forks source link

[Fleet] Remove showInactive flag from our APIs #147862

Open hop-dev opened 1 year ago

hop-dev commented 1 year ago

Now that we have moved to using runtime fields for statuses, I believe the showInactive flag isn't needed as we can easily use status filters and omit inactive and unenrolled, this will simplify our API a lot as I find the showInactive flag a bit confusing some times.

elasticmachine commented 1 year ago

Pinging @elastic/fleet (Team:Fleet)

jillguyonnet commented 8 months ago

While working on fixes for bulk agent actions in https://github.com/elastic/kibana/pull/177035, I noticed Fleet backend could probably be simplified quite a bit if this flag was removed. An example is querying agents by kuery, which is used by agent actions in bulk selection mode: the showInactive flag is expected and defaults to false, in which case it pushes an extra filtering condition to exclude inactive and unenrolled status.

Another observation which is possibly related (I'm not sure): Fleet currently has some UI logic where the agent breakdown by status above the agents table only shows the inactive and unenrolled status if at least one of them is selected in the status filter:

Screenshot 2024-03-11 at 15 59 56

vs.

Screenshot 2024-03-11 at 15 59 46
jillguyonnet commented 4 months ago

Relevant: https://github.com/elastic/kibana/pull/187960

juliaElastic commented 4 months ago

@jillguyonnet thanks for linking this issue! It made me think about the draft pr that instead of introducing a new flag includeUnenrolled we could indeed get rid of showInactive as well and use status filters. I agree that the meaning of showInactive is confusing.

jillguyonnet commented 4 months ago

instead of introducing a new flag includeUnenrolled we could indeed get rid of showInactive as well and use status filters. I agree that the meaning of showInactive is confusing.

Thanks Julia, and agreed, that would be a good improvement 👍

I added the Spacetime label as I thought that might be a good way to nudge this a bit - cc @kpollich for visibility

juliaElastic commented 3 months ago

I spent some time to refactor to get rid of showInactive based on this pr, but I feel it's adding a lot of complexity to add the status filters everywhere in the kuery. For now I decided on a simpler approach to fix the issue reported here. We can look into this refactor more during a spacetime week.