Skip to content

Comments

Bugfix: re-create deleted iOS/iPadOS host entries in Fleet if it checks in again via MDM#27231

Merged
mna merged 30 commits intomainfrom
mna-22941-revive-deleted-byob-iphone
Mar 26, 2025
Merged

Bugfix: re-create deleted iOS/iPadOS host entries in Fleet if it checks in again via MDM#27231
mna merged 30 commits intomainfrom
mna-22941-revive-deleted-byob-iphone

Conversation

@mna
Copy link
Member

@mna mna commented Mar 18, 2025

For #22941 and #22391

Checklist for submitter

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.
  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements)
  • If database migrations are included, checked table schema to confirm autoupdate
  • For database migrations:
    • Checked schema for all modified table for columns that will auto-update timestamps during migration.
    • Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects.
    • Ensured the correct collation is explicitly set for character columns (COLLATE utf8mb4_unicode_ci).
  • Added/updated automated tests
  • Manual QA for all new/changed functionality
    See: ABM iPhone not re-enrolling after being deleted from Fleet #22391 (comment) and BYOD iPhone deleted in Fleet never re-appears even though it's still enrolled #22941 (comment)

@mna mna force-pushed the mna-22941-revive-deleted-byob-iphone branch from 9bd4d9a to 7a59e54 Compare March 18, 2025 19:27
@codecov
Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 58.37321% with 87 lines in your changes missing coverage. Please review.

Project coverage is 63.77%. Comparing base (193af72) to head (05e9ce7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
server/service/apple_mdm.go 48.78% 14 Missing and 7 partials ⚠️
server/mdm/apple/apple_mdm.go 16.66% 15 Missing and 5 partials ⚠️
...0250325122638_AddPlatformAndTeamIDToNanoDevices.go 70.68% 12 Missing and 5 partials ⚠️
cmd/fleet/cron.go 0.00% 10 Missing ⚠️
server/datastore/mysql/apple_mdm.go 84.12% 7 Missing and 3 partials ⚠️
cmd/fleet/serve.go 0.00% 6 Missing ⚠️
server/datastore/mysql/testing_utils.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #27231      +/-   ##
==========================================
- Coverage   63.78%   63.77%   -0.01%     
==========================================
  Files        1744     1745       +1     
  Lines      165612   165804     +192     
  Branches     4515     4570      +55     
==========================================
+ Hits       105630   105745     +115     
- Misses      51750    51808      +58     
- Partials     8232     8251      +19     
Flag Coverage Δ
backend 64.58% <58.37%> (-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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

// TODO(iosrevive): (optional), if we want to go out of our way to re-create
// the deleted iDevices ASAP, we could include them in the list of hosts to
// send a push to, so that they checkin early (it can be arbitrarily long
// without a push notification).
Copy link
Member Author

Choose a reason for hiding this comment

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

Pending product decision (asked on Slack here: https://fleetdm.slack.com/archives/C03C41L5YEL/p1742413143321909)

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems like we want it so I'll add to this PR next week to finish this up.

@@ -0,0 +1 @@
* Fixed a bug where BYOD iDevices deleted in Fleet but still enrolled in MDM were not re-created on the next MDM checkin.
Copy link
Member Author

Choose a reason for hiding this comment

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

(not mentioning ABM/ADE devices since it was already working, I just added a test to cover this scenario)

@mna mna marked this pull request as ready for review March 25, 2025 15:58
@mna mna requested a review from a team as a code owner March 25, 2025 15:58
Copy link
Member

@georgekarrv georgekarrv left a comment

Choose a reason for hiding this comment

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

LGTM!

@mna mna merged commit 78c0d67 into main Mar 26, 2025
35 checks passed
@mna mna deleted the mna-22941-revive-deleted-byob-iphone branch March 26, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants