Skip to content
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

prevent redundant ADE profile assignment #17427

Merged
merged 1 commit into from Mar 6, 2024
Merged

prevent redundant ADE profile assignment #17427

merged 1 commit into from Mar 6, 2024

Conversation

roperzh
Copy link
Member

@roperzh roperzh commented Mar 6, 2024

For #17291, this prevent re-assigning profiles to ABM hosts that already have the right one.

This was happening very frequently for hosts that are in the last page of the /sync request, as there's no indication that the cursor was exhausted and we keept on assigning profiles to those hosts.

This caused profile assignment to eventually fail, presumably due to rate limiting.

Checklist for submitter

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

  • Changes file added for user-visible changes in changes/ or orbit/changes/.
    See Changes files for more information.
  • Added/updated tests
  • Manual QA for all new/changed functionality

For #17291, this prevent re-assigning profiles to ABM hosts that already
have the right one.

This was happening very frequently for hosts that are in the last page
of the `/sync` request, as there's no indication that the cursor was
exhausted and we keept on assigning profiles to those hosts.

This caused profile assignment to eventually fail, presumably due to
rate limiting.
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 93.10345% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 65.50%. Comparing base (30a36b0) to head (21d4f9d).
Report is 11 commits behind head on main.

Files Patch % Lines
server/mdm/apple/apple_mdm.go 93.10% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17427   +/-   ##
=======================================
  Coverage   65.50%   65.50%           
=======================================
  Files        1192     1192           
  Lines      107485   107489    +4     
  Branches     2565     2565           
=======================================
+ Hits        70406    70411    +5     
+ Misses      31711    31710    -1     
  Partials     5368     5368           
Flag Coverage Δ
backend 66.50% <93.10%> (+<0.01%) ⬆️

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

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

@roperzh roperzh marked this pull request as ready for review March 6, 2024 19:55
@roperzh roperzh requested a review from a team as a code owner March 6, 2024 19:55
Copy link
Contributor

@gillespi314 gillespi314 left a comment

Choose a reason for hiding this comment

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

Nice fix!

@@ -34,7 +34,6 @@ import (
"github.com/fleetdm/fleet/v4/server/datastore/mysql"
"github.com/fleetdm/fleet/v4/server/datastore/redis/redistest"
"github.com/fleetdm/fleet/v4/server/fleet"
mdm_types "github.com/fleetdm/fleet/v4/server/fleet"
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird, we were importing package fleet twice?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes 😂 , I noticed we do this in a couple of places

@roperzh roperzh merged commit 9c5b59d into main Mar 6, 2024
21 checks passed
@roperzh roperzh deleted the 17291-ade branch March 6, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants