Bump migration timestamps after 4.88 cherry-pick#48617
Conversation
The 4.88.0 patch cherry-picked migrations 20260624210253 (AddHostMDMAppleEnrollmentPermissions) and 20260624210311 (RenamePersonalEnrollmentStatus). Eight migrations on main were NOT cherry-picked into 4.88 but had earlier timestamps, which violates the release rule (docs/Contributing/workflows/releasing-fleet.md): migrations not cherry-picked in a patch must have a later timestamp than those that were. This would break the 4.88.0 -> 4.89.0 upgrade path (out-of-order migrations). Bump the 8 non-cherry-picked migrations to timestamps after the cherry-picked ones, preserving their relative order, and regenerate schema.sql.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
Pull request overview
Adjusts database migration ordering on main to prevent out-of-order / missing-migration errors when upgrading customers from 4.88.0 (which included two later-timestamp migrations via cherry-pick) to 4.89.0+. This PR renames eight previously-earlier main migrations to new timestamps while preserving their relative order, and regenerates schema.sql accordingly.
Changes:
- Bumped timestamps (and corresponding
Up_*/Down_*function names + test names) for 8 non-cherry-picked migrations so they sort after the4.88.0cherry-picked migrations. - Updated generated
server/datastore/mysql/schema.sqlmigration list to reflect the new versions. - Removed all references to the old migration versions (confirmed no remaining
Up_/Down_symbol references or old-timestamp files).
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| server/datastore/mysql/schema.sql | Regenerated schema to reflect the updated migration versions/order. |
| server/datastore/mysql/migrations/tables/20260702013102_AddCertAndAndroidAppVariableTracking.go | Renamed migration registration and Up_/Down_ functions to new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013102_AddCertAndAndroidAppVariableTracking_test.go | Updated migration test name to match new timestamp (drives test harness version detection). |
| server/datastore/mysql/migrations/tables/20260702013101_AddSupportSoftwareCategory.go | Renamed migration registration and Up_/Down_ functions to new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013101_AddSupportSoftwareCategory_test.go | Updated migration test name to match new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013100_AddBYODFleetAndADUEEnrollment.go | Renamed migration registration and Up_/Down_ functions to new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013100_AddBYODFleetAndADUEEnrollment_test.go | Updated migration test name to match new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013059_AddPolicyGateToSetupExperienceResults.go | Renamed migration registration and Up_/Down_ functions to new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013058_AddAndroidProfileVariableTracking.go | Renamed migration registration and Up_/Down_ functions to new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013058_AddAndroidProfileVariableTracking_test.go | Updated migration test name to match new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013057_CreateSoftwareTitleTeamPins.go | Renamed migration registration and Up_/Down_ functions to new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013057_CreateSoftwareTitleTeamPins_test.go | Updated migration test name to match new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013056_AddSetupExperienceSoftwareInstallers.go | Renamed migration registration and Up_/Down_ functions to new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013056_AddSetupExperienceSoftwareInstallers_test.go | Updated migration test name to match new timestamp. |
| server/datastore/mysql/migrations/tables/20260702013055_AddWindowsMDMConfigProfilesPendingDelete.go | Renamed migration registration and Up_/Down_ functions to new timestamp. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (15)
WalkthroughThis PR renames nine existing MySQL migration files' Up/Down functions and their Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #48617 +/- ##
==========================================
+ Coverage 67.99% 68.03% +0.03%
==========================================
Files 3678 3678
Lines 233668 233785 +117
Branches 12413 12413
==========================================
+ Hits 158894 159048 +154
+ Misses 60471 60433 -38
- Partials 14303 14304 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Related issue: Resolves NA (release hygiene — migration ordering)
What & why
The
4.88.0patch cherry-picked two migrations,20260624210253_AddHostMDMAppleEnrollmentPermissionsand20260624210311_RenamePersonalEnrollmentStatus. Eight migrations onmainwere not cherry-picked into 4.88 but had earlier timestamps than those two:This violates the rule in
docs/Contributing/workflows/releasing-fleet.md:Left as-is, a customer on
4.88.0(who applied migrations through20260624210311) upgrading to4.89.0would hit these 8 as out-of-order/missing migrations older than their highest-applied version.Fix
Bumped the 8 non-cherry-picked migrations to new timestamps (
20260702013055–20260702013102) usingtools/bump-migration, preserving their relative order, so they now sort after the cherry-picked migrations and20260626120000_CompressWindowsMDMResponsesColumn. Regeneratedschema.sql.Verified
20260626120000_CompressWindowsMDMResponsesColumn(the only other non-cherry-picked migration, already correctly ordered) touches onlywindows_mdm_responses— none of the 8 moved migrations touch that table, so no dependency inversion is introduced by the reorder. None of these 10 migrations shipped in4.87.1, so no released database is affected.rc-patch-fleet-v4.88.0needs no change. This lands onmainand should be reflected onrc-minor-fleet-v4.89.0.Checklist for submitter
Database migrations
tools/bump-migration; function names updated to match new timestamps.schema.sqlviamake dump-test-schema; migrations apply cleanly in the new order.Testing
go build ./server/datastore/mysql/migrations/...andgo vetpass; schema regeneration ran all migrations successfully in order.Summary by CodeRabbit
New Features
Bug Fixes