Conversation
gillespi314
reviewed
Apr 8, 2023
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #11084 +/- ##
==========================================
- Coverage 60.14% 60.10% -0.05%
==========================================
Files 527 528 +1
Lines 55103 55263 +160
==========================================
+ Hits 33143 33217 +74
- Misses 18943 19021 +78
- Partials 3017 3025 +8
... and 2 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
gillespi314
previously approved these changes
Apr 9, 2023
Contributor
gillespi314
left a comment
There was a problem hiding this comment.
Looks good! I had one question on the team delete scenario.
gillespi314
approved these changes
Apr 9, 2023
9 tasks
jacobshandling
pushed a commit
to jacobshandling/fleet
that referenced
this pull request
Apr 15, 2023
### Related tickets fleetdm#10775 fleetdm#10678 fleetdm#11024 fleetdm#11026 ### What's happening - Implemented the hashing mechanism defined by @mna in fleetdm#10678, however this mechanism is mainly relevant for batch profile updates via the CLI, we can't leverage it when a host switches teams. - Modified `BulkSetPendingMDMAppleHostProfiles` so when two profiles with the same identifier are sheduled both for removal and update, the function will now mark only the `install` as `pending` so it's picked by the cron, and will `DELETE` the `remove` entry from the database so it's not picked by the cron and never sent to the user. - `GetHostMDMProfiles` and consequently the profiles returned in `GET /api/_version_/fleet/hosts` return `host_mdm_apple_profiles.state = NULL` as "Enforcing (pending", the distinction between `status = 'pending'` and `status IS NULL` is only useful for the cron, for users both mean the same thing, and all our profile aggregations already behave this way. - Using the solution implemented by @gillespi314 in fleetdm#10998 we're now deleting the host row from `host_disk_encryption_keys` if a host is moved from a team that enforces disk encryption to a team that doesn't. # Checklist for submitter If some of the following don't apply, delete the relevant line. - [x] Added/updated tests - [x] Manual QA for all new/changed functionality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related tickets
#10775
#10678
#11024
#11026
What's happening
BulkSetPendingMDMAppleHostProfilesso when two profiles with the same identifier are sheduled both for removal and update, the function will now mark only theinstallaspendingso it's picked by the cron, and willDELETEtheremoveentry from the database so it's not picked by the cron and never sent to the user.GetHostMDMProfilesand consequently the profiles returned inGET /api/_version_/fleet/hostsreturnhost_mdm_apple_profiles.state = NULLas "Enforcing (pending", the distinction betweenstatus = 'pending'andstatus IS NULLis only useful for the cron, for users both mean the same thing, and all our profile aggregations already behave this way.host_disk_encryption_keysif a host is moved from a team that enforces disk encryption to a team that doesn't.Checklist for submitter
If some of the following don't apply, delete the relevant line.