-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add batching logic when we pull windows profiles to install or remove #26964
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26964 +/- ##
==========================================
- Coverage 64.02% 61.77% -2.25%
==========================================
Files 1701 1701
Lines 162252 162278 +26
Branches 4272 4272
==========================================
- Hits 103874 100250 -3624
- Misses 50319 54062 +3743
+ Partials 8059 7966 -93
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this'll fix the problem, at the expense of complexity that makes it easier to miss the "zero host IDs in the list" nuance. Refactoring that case out into its own function solves that problem, so I think it's worth doing now. I may go ahead and do this since I'm asking for some nontrivial changes, and since we can have another person put eyes on this afterward.
return err | ||
}) | ||
|
||
return result, err | ||
} | ||
|
||
func listMDMWindowsProfilesToRemoveDB( | ||
func (ds *Datastore) listMDMWindowsProfilesToRemoveDB( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same feedback as for the install case. Feels even more like we should do this refactor given that doing so doesn't require us to modify the datastore interface.
…les to install/remove The vast majority of the overlap between "all hosts" and "a subset of hosts" for these functions are in the SQL, so if we extract the SQL out we can split the function into one that only operates on a subset of hosts (and optionally a subset of profiles), and one that only operates on all hosts. This reduces the complexity of both functions, which is important given that we just added complexity via batching. This change winds up with equivalent behavior for both places that call the functions.
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.