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

18531 failed mdm profs #18930

Merged
merged 12 commits into from
May 14, 2024
Merged

18531 failed mdm profs #18930

merged 12 commits into from
May 14, 2024

Conversation

jahzielv
Copy link
Contributor

@jahzielv jahzielv commented May 10, 2024

Related issue: #18531

Checklist for submitter

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

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

@jahzielv
Copy link
Contributor Author

Dev log 2024-05-10

When Roberto and I first talked about a solution to this, we felt that filtering the profiles out here, since we already have a hostProfilesToCleanup list. The profiles in this list are deleted from the DB directly; this is exactly what we want for the case we're solving for. However, during integration testing, I found that simply adding a check there for profiles that had operation Install and had failed wasn't enough. The profiles were being marked with operationRemove and status pending somewhere else. After digging, I found the place where profiles are reassigned during host team transfers. This reassignment was erasing the information we needed (that the profile failed to install). So I added a check here, which would avoid changing the profile and would allow us to filter it out up in the ReconcileAppleProfiles method.

@jahzielv jahzielv marked this pull request as ready for review May 13, 2024 17:56
@jahzielv jahzielv requested a review from a team as a code owner May 13, 2024 17:56
@jahzielv jahzielv requested a deployment to Docker Hub May 13, 2024 19:08 — with GitHub Actions Abandoned
Copy link
Member

@roperzh roperzh left a comment

Choose a reason for hiding this comment

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

very nice catch about the tweak in server/datastore/mysql/apple_mdm.go! left a few minor notes/questions

server/datastore/mysql/apple_mdm.go Outdated Show resolved Hide resolved
server/service/apple_mdm.go Outdated Show resolved Hide resolved
Copy link
Member

@mna mna left a comment

Choose a reason for hiding this comment

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

LGTM once Roberto's comments are addressed!

}
cmd, err = mdmDevice.Acknowledge(cmd.CommandUUID)
require.NoError(t, err)
}
Copy link
Member

Choose a reason for hiding this comment

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

Nit for a future iteration maybe (not a blocker to merge!), just a visual check but it looks like this is the same as the previous processing of the command, would be nice to do this in a loop over a struct that has just the variable parts (I think it's only the assertion of profiles after the acknowledge, VerifyHostMDMProfiles).

mna
mna previously approved these changes May 14, 2024
Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.75%. Comparing base (676a632) to head (c32a03d).
Report is 101 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main   #18930       +/-   ##
===========================================
+ Coverage   52.03%   66.75%   +14.71%     
===========================================
  Files         352      887      +535     
  Lines        8212   108480   +100268     
  Branches     2657        0     -2657     
===========================================
+ Hits         4273    72413    +68140     
- Misses       3917    30181    +26264     
- Partials       22     5886     +5864     
Flag Coverage Δ
backend 66.75% <100.00%> (?)
frontend ?

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.

@georgekarrv
Copy link
Member

@jahzielv I know we said deep freeze but there are still 2 large outstanding items (software delivery and eops load testing) So lets go ahead and merge this one in since it impacts dogfood and would be good to get closed.

@georgekarrv georgekarrv merged commit 6b31b71 into main May 14, 2024
22 checks passed
@georgekarrv georgekarrv deleted the 18531-failed-mdm-profs branch May 14, 2024 19:19
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

4 participants