Skip to content

Add label information to host summary response#5573

Merged
gillespi314 merged 5 commits into
mainfrom
issue-4738-host-summary-label-ids
May 10, 2022
Merged

Add label information to host summary response#5573
gillespi314 merged 5 commits into
mainfrom
issue-4738-host-summary-label-ids

Conversation

@gillespi314
Copy link
Copy Markdown
Contributor

Issue #4738

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes (in changes/ and/or orbit/changes/).
  • Documented any API changes (docs/Using-Fleet/REST-API.md)
  • Added/updated tests
  • Manual QA for all new/changed functionality

@gillespi314 gillespi314 requested a review from a team as a code owner May 4, 2022 19:12
@gillespi314 gillespi314 changed the title Add label information host summary response Add label information to host summary response May 4, 2022
michalnicp
michalnicp previously approved these changes May 4, 2022
"offline_count": 141,
"mia_count": 0,
"new_count": 0,
"all_linux_count": 1204,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q regarding platform query argument of GET /api/v1/fleet/host_summary:

  1. Couldn't the all_linux_count be deduced by calling GET /api/v1/fleet/host_summary?platform=linux?
  2. Does the all_linux_count make sense on a call like GET /api/v1/fleet/host_summary?platform=darwin?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasmrod We'd like to get all counts with a single request. While we could deduce the count using the platform query, it would require multiple requests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, it's just that now the API arguments and return values are starting to cause confusion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasmrod, just checking to see if you are ok with merging this PR in its current form or do you feel that there is more to discuss?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just that now the API arguments and return values are starting to cause confusion

Agreed. Looking at the responses, I'm not sure that we need the platform argument any longer, since as far as I can see no additional information is provided when including that argument. With that in mind, when this is implemented on the frontend I expect we'll be able to make a single request to host-summary and not make additional requests with the platform argument when a platform is selected. @gillespi314 Does that sound right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just checking to see if you are ok with merging this PR in its current form or do you feel that there is more to discuss?

Yes, approved.

I can see the value of the all_linux_count. Basically to avoid having the caller (UI) implement heuristics to understand what a "linux" host is and then count (that is, check the returned platforms, e.g. "redhat", "debian", "linux" string, etc.). This way, that thing is defined by the backend only.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment thread server/service/hosts.go
}

// TODO: should query for "All linux" label be updated to use `platform` from `os_version` table
// so that the label tracks the way platforms are handled here in the host summary?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in Slack, +1 to create an issue to fix this.

lucasmrod
lucasmrod previously approved these changes May 4, 2022
Copy link
Copy Markdown
Member

@lucasmrod lucasmrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, left a question around the platform query argument and the all_linux_count return field.

@gillespi314 gillespi314 dismissed stale reviews from lucasmrod and michalnicp via d42b6cc May 5, 2022 01:17
@gillespi314 gillespi314 temporarily deployed to Docker Hub May 5, 2022 01:17 Inactive
@gillespi314 gillespi314 temporarily deployed to Docker Hub May 5, 2022 01:20 Inactive
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 5, 2022

Codecov Report

Merging #5573 (22a73cb) into main (a534967) will increase coverage by 0.00%.
The diff coverage is 78.57%.

@@           Coverage Diff           @@
##             main    #5573   +/-   ##
=======================================
  Coverage   58.17%   58.18%           
=======================================
  Files         357      358    +1     
  Lines       33008    33052   +44     
=======================================
+ Hits        19204    19230   +26     
- Misses      11874    11892   +18     
  Partials     1930     1930           
Impacted Files Coverage Δ
server/fleet/datastore.go 0.00% <ø> (ø)
server/fleet/labels.go 0.00% <ø> (ø)
server/datastore/mysql/labels.go 67.09% <50.00%> (-0.17%) ⬇️
server/service/hosts.go 69.32% <85.00%> (+0.47%) ⬆️
server/fleet/hosts.go 71.69% <100.00%> (ø)
ee/fleetctl/updates.go 53.58% <0.00%> (-0.31%) ⬇️
orbit/pkg/update/update.go 2.64% <0.00%> (-0.05%) ⬇️
orbit/cmd/orbit/orbit.go 1.68% <0.00%> (-0.02%) ⬇️
orbit/pkg/update/options.go 0.00% <0.00%> (ø)
cmd/fleetctl/preview.go 51.42% <0.00%> (+1.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a534967...22a73cb. Read the comment docs.

@gillespi314 gillespi314 temporarily deployed to Docker Hub May 5, 2022 01:29 Inactive
@gillespi314 gillespi314 merged commit d172128 into main May 10, 2022
@gillespi314 gillespi314 deleted the issue-4738-host-summary-label-ids branch May 10, 2022 15:32
Desmi-Dizney added a commit that referenced this pull request May 16, 2022
@Desmi-Dizney
Copy link
Copy Markdown
Contributor

Desmi-Dizney added a commit that referenced this pull request May 18, 2022
* Editor pass - Add label information to host summary response

Editor pass for:
-  #5573

* Update issue-4738-host-summary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants