fleet icon indicating copy to clipboard operation
fleet copied to clipboard

API Bugs: Team view (fleet/teams/1)

Open RachelElysia opened this issue 3 years ago • 2 comments

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_ids
  • host_ids (blocking #6966) Incorrect counts for keys:
  • user_count
  • host_count

Incorrect counts screenshot: Screen Shot 2022-07-29 at 12 01 23 PM Screen Shot 2022-07-29 at 12 01 11 PM

More info

RachelElysia avatar Jul 29 '22 16:07 RachelElysia

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.

mna avatar Aug 01 '22 17:08 mna

@lukeheath I updated the description, assigned you, and moved the issue to the release board.

noahtalerman avatar Aug 04 '22 21:08 noahtalerman

@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.

lukeheath avatar Aug 17 '22 20:08 lukeheath

@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.

lukeheath avatar Sep 06 '22 19:09 lukeheath