fleet
fleet copied to clipboard
API Bugs: Team view (fleet/teams/1)
Goal
Update the /teams/{id} API routes so that the user_counts and host_counts are correct.
Update the API docs to remove the host_ids and user_ids properties that are not included in the response.
More info
When retrieving https://localhost:8080/api/latest/fleet/teams/1, the following needs to be fixed... Missing keys:
user_idshost_ids(blocking #6966) Incorrect counts for keys:user_counthost_count
Incorrect counts screenshot:

More info
AFAICT those two fields are never filled in any condition on the backend, even though the fields do exist in the Team struct and the doc mentions them. user_count should be easy to fill given that the endpoint loads the list of users. The hosts field is never filled though (at least in that endpoint), nor is the host_count. The doc mentions that the endpoint returns host_ids and user_ids, that appears to be incorrect too, it returns list of objects under hosts (well, it would if it did load them) and users, not just ids.
All that to say, there seems to be important discrepancies between what the doc mentions for that endpoint and what it actually returns.
@lukeheath I updated the description, assigned you, and moved the issue to the release board.
@gillespi314 Here is another API bug that could use some attention. No features are using this property so it's not as pressing, but of course we don't want the API to return incorrect data.
@fx5 I'm assigning you this bug as a first ticket to start getting familiar with the code base. Just let me know if you have any questions or blockers.