Skip to content

iOS/iPadOS device vitals: expose in GET host API response - #50082

Merged
nulmete merged 2 commits into
49984-ios-ipados-vitalsfrom
49985-ios-ipados-vitals-host-api
Aug 4, 2026
Merged

iOS/iPadOS device vitals: expose in GET host API response#50082
nulmete merged 2 commits into
49984-ios-ipados-vitalsfrom
49985-ios-ipados-vitals-host-api

Conversation

@nulmete

@nulmete nulmete commented Jul 28, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #49985

Exposes the the 29 iOS/iPadOS device vitals fields in GET /hosts/:id and GET /hosts/identifier/:identifier for iOS/iPadOS hosts.

Checklist for submitter

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

Will be added in feature branch.

Testing

  • Added/updated automated tests

  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • New Features

    • Host details for iOS and iPadOS devices now include available Apple MDM device vitals and service subscription information.
    • Vitals are shown only when present, while unsupported platforms and missing data remain omitted.
    • Added support for nested accessibility, organization, MDM options, and attestation details in host responses.
  • Bug Fixes

    • Improved handling of hosts without stored Apple MDM vitals, avoiding errors and incomplete responses.
  • Tests

    • Added coverage for complete, partial, and missing vitals data across host detail endpoints.

@nulmete
nulmete marked this pull request as ready for review July 28, 2026 18:55
@nulmete
nulmete requested a review from a team as a code owner July 28, 2026 18:55
@nulmete

nulmete commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds Apple MDM device-vitals fields to fleet.Host, loads persisted vitals and service subscriptions from MySQL for iOS/iPadOS hosts, and wires loading into host detail responses. JSON fields are conditionally unmarshaled and omitted when unavailable. The datastore interface and mock are extended, while unit and integration tests cover complete, partial, missing-row, platform-gated, and identifier-based responses.

Possibly related issues

  • #39281: Implements the backend host API loading and platform-gated exposure of iOS/iPadOS vitals described by this issue.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the user-visible change and testing, but the required changes file is not yet added and several applicable checklist items are missing. Add the required changes file and complete or remove the applicable checklist sections, including validation, compatibility, isolation testing, and QA details.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy #49985 by adding the 29 fields, loading side-table data, omitting values for non-iOS hosts, and covering both host endpoints.
Out of Scope Changes check ✅ Passed The diff stays focused on iOS/iPadOS vitals exposure, datastore loading, and supporting tests and mocks, with no clear unrelated additions.
Title check ✅ Passed The title clearly identifies exposing iOS/iPadOS device vitals in GET host API responses.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 49985-ios-ipados-vitals-host-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.79570% with 16 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (49984-ios-ipados-vitals@f9a18ff). Learn more about missing BASE report.

Files with missing lines Patch % Lines
server/datastore/mysql/apple_mdm_device_vitals.go 78.57% 7 Missing and 5 partials ⚠️
server/fleet/mdm_apple_device_vitals.go 94.11% 1 Missing and 1 partial ⚠️
server/service/hosts.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##             49984-ios-ipados-vitals   #50082   +/-   ##
==========================================================
  Coverage                           ?   68.11%           
==========================================================
  Files                              ?     3940           
  Lines                              ?   251157           
  Branches                           ?    13277           
==========================================================
  Hits                               ?   171083           
  Misses                             ?    64732           
  Partials                           ?    15342           
Flag Coverage Δ
backend 69.45% <82.79%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nulmete
nulmete force-pushed the 49984-vitals-ack-parsing branch from 140876b to 2d16ab0 Compare August 4, 2026 13:54
@nulmete
nulmete force-pushed the 49985-ios-ipados-vitals-host-api branch from 17ca536 to 4cc022a Compare August 4, 2026 14:05
Base automatically changed from 49984-vitals-ack-parsing to 49984-ios-ipados-vitals August 4, 2026 14:07
nulmete added 2 commits August 4, 2026 11:09
Adds the 29 new host_mdm_apple_device_vitals /
host_mdm_apple_service_subscriptions fields to fleet.Host, loaded for
iOS/iPadOS hosts only and fully omitted (not null) otherwise, wired into
GET /hosts/:id and GET /hosts/identifier/:identifier.
Apple reports CellularTechnology as an integer (0 None, 1 GSM, 2 CDMA,
3 GSM and CDMA). Keep persisting that raw integer and map it to the label
only when serializing the host response, via a MarshalJSON on a named type
(same pattern as fleet.LabelType). An integer outside Apple's documented
set maps to "unknown" rather than failing the whole response.
@nulmete
nulmete force-pushed the 49985-ios-ipados-vitals-host-api branch from 4cc022a to c06a525 Compare August 4, 2026 14:09
@nulmete
nulmete merged commit 806b97e into 49984-ios-ipados-vitals Aug 4, 2026
7 checks passed
@nulmete
nulmete deleted the 49985-ios-ipados-vitals-host-api branch August 4, 2026 14:10
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.

2 participants