BMAA: Add personal enrollment type including aggregate counts#31091
BMAA: Add personal enrollment type including aggregate counts#31091JordanMontgomery merged 24 commits intomainfrom
Conversation
…Device) enrollment
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #31091 +/- ##
=======================================
Coverage 64.03% 64.03%
=======================================
Files 1905 1906 +1
Lines 187623 187655 +32
Branches 5415 5448 +33
=======================================
+ Hits 120136 120169 +33
+ Misses 58047 58042 -5
- Partials 9440 9444 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gillespi314
left a comment
There was a problem hiding this comment.
Looks good! Feel free to address comments in a follow up PR as you see fit :)
Does this also cover filtering hosts by the new status? I didn't see any changes to transport so I'm assuming that's still on our list as something that @ghernandez345 can work on adding that and supplementing related tests?
| - "host_serial": Serial number of the host (Apple enrollments only, always empty for Microsoft). Only for company-owned hosts. | ||
| - "enrollment_id": Enrollment identifier of the personal (BYOD) host (iPhone, iPad and Android enrollments only, null for other platforms). | ||
| - "host_display_name": Display name of the host. | ||
| - "personal_host": Whether the host is personal or company-owned. |
There was a problem hiding this comment.
Do we need this personal_host boolean? It seems like we can infer that this is a personal device based on the presence or absence of enrollment_id. Also, we may want to disambiguate enrollment_id (to avoid collisions with other activity types). Maybe byod_identifier is more distinctive?
There was a problem hiding this comment.
if we do switch this lets remember to upate the global activities UI as it currently relies on personal_host to render correctly
There was a problem hiding this comment.
This is what Marko specified so I can ask in design review. Enrollment ID is technically the term Apple uses here though
There was a problem hiding this comment.
I agree with @gillespi314 about inferring this from the presence of an enrollment_id rather than adding an extra boolean, but am not super opposed to personal_host if it's too late to change. (Would prefer we called it byod_host since that's more in line with our usual terminology.)
Sorry to ask for changes this late in the game! I was never requested for review on #30186 so this is my first time seeing this
There was a problem hiding this comment.
No worries. What I am gonna do is split these activity/doc changes out so someone else can tighten up the spec and get them merged in later this week
| assert.True(t, entry.IsPersonalEnrollment, "is_personal_enrollment should be true for host_id 7") | ||
| assert.Equal(t, "On (personal)", *entry.EnrollmentStatus) | ||
| case 8: | ||
| assert.True(t, entry.IsPersonalEnrollment, "is_personal_enrollment should be true for host_id 6") |
There was a problem hiding this comment.
Nit: Seems like the host_id is wrong in the message. Consider using a format string based on entry.HostID?
There was a problem hiding this comment.
You're right. I came back and updated this test after wanting to add more cases and messed it up. Will fix
| // Fetch the hosts we enrolled and check their details. Specifically we want to verify that MDM | ||
| // shows a personal enrollment via all 3 endpoints(list hosts, host details and host MDM | ||
| // details) since they query for the information slightly differently |
There was a problem hiding this comment.
Quick double-check: There are a few other endpoints that also return similar data that you may want to spot check. For example:
https://fleetdm.com/docs/rest-api/rest-api#get-host-by-identifier
https://fleetdm.com/docs/rest-api/rest-api#list-hosts-in-a-label
https://fleetdm.com/docs/rest-api/rest-api#targets
Potentially others too that I don't remember off the top of my head (but I think they are documented in the code comments on the other host endpoints).
| // Note I am explicitly not re-enrolling the iPhone here as I don't believe that particular | ||
| // device and enrollment type actually supports re-enrollment like this |
There was a problem hiding this comment.
Did this comment come back as a result of merge conflicts?
There was a problem hiding this comment.
Good catch. It must have. The actual command to re-enroll was there even though this comment said otherwise. Thanks for catching that
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
SELECT *is avoided, SQL injection is prevented (using placeholders for values in statements)COLLATE utf8mb4_unicode_ci).