Skip to content

Bump out-of-order migrations not included in v4.90.0 - #50690

Merged
lucasmrod merged 2 commits into
mainfrom
bump-out-of-order-migrations-4.91
Aug 7, 2026
Merged

Bump out-of-order migrations not included in v4.90.0#50690
lucasmrod merged 2 commits into
mainfrom
bump-out-of-order-migrations-4.91

Conversation

@lucasmrod

@lucasmrod lucasmrod commented Aug 6, 2026

Copy link
Copy Markdown
Member

Two migrations merged to main were not included in the v4.90.0 release but have timestamps older than 20260723181411_MultipleCustomPackagesPerTitle (the latest migration shipped in v4.90.0). Databases already on v4.90.0 would never apply them, since goose only runs migrations newer than the current (highest applied) version.

Bumped both to current timestamps via tools/bump-migration:

  • 20260721090128_AddTokenInvalidToABMTokens20260806154139_AddTokenInvalidToABMTokens
  • 20260721160351_AddHostMDMWindowsProfilesStatus20260806154150_AddHostMDMWindowsProfilesStatus

No schema or logic changes — only the file names, Up_/Down_/TestUp_ function names, and the regenerated schema.sql (migration_status_tables versions). Verified that none of the other unreleased migrations (20260724+) depend on the schema these two create, so applying them last is safe.

Checklist for submitter

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

Testing

  • Added/updated automated tests (existing migration tests renamed and re-run against MySQL)

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).

Summary by CodeRabbit

  • Database Updates
    • Added support for tracking whether ABM tokens are invalid.
    • Added Windows MDM profile status tracking and backfilled existing records.
  • Maintenance
    • Updated database migration identifiers and status records to ensure migrations are applied consistently.
  • Tests
    • Updated migration verification tests to match the revised migration identifiers.

Two migrations merged to main were not included in the v4.90.0 release
but have timestamps older than 20260723181411 (the latest migration
shipped in v4.90.0). Databases already on v4.90.0 would never apply
them, since goose only runs migrations newer than the current version.

Bumped via tools/bump-migration:
- 20260721090128_AddTokenInvalidToABMTokens -> 20260806154139
- 20260721160351_AddHostMDMWindowsProfilesStatus -> 20260806154150
@lucasmrod
lucasmrod requested a review from a team as a code owner August 6, 2026 15:54
Copilot AI lite review requested due to automatic review settings August 6, 2026 15:54
getvictor
getvictor previously approved these changes Aug 6, 2026
nulmete
nulmete previously approved these changes Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4891f2a3-15a0-4aed-801e-fd49483538f9

📥 Commits

Reviewing files that changed from the base of the PR and between b72d089 and adb8e2c.

📒 Files selected for processing (1)
  • server/datastore/mysql/schema.sql
🚧 Files skipped from review as they are similar to previous changes (1)
  • server/datastore/mysql/schema.sql

Walkthrough

Two MySQL migrations now use timestamps 20260806154139 and 20260806154150. Their registrations, exported functions, and test names were updated. The migration logic remains unchanged. The migration_status_tables seed data removes the previous migration identifiers and renumbers later rows.

Possibly related PRs

  • fleetdm/fleet#48560: Renames and re-registers the same abm_tokens.token_invalid migration and related metadata.
  • fleetdm/fleet#49849: Updates MySQL migration timestamps, names, tests, and status ordering.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: updating out-of-order migrations excluded from v4.90.0.
Description check ✅ Passed The description explains the migration issue, lists affected migrations, documents the scope, and records relevant testing and database checks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bump-out-of-order-migrations-4.91

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

nulmete added a commit that referenced this pull request Aug 6, 2026
…r it

PR #50690 (open, not yet merged) renames two out-of-order migrations
that shipped after the v4.90.0 cut so they sort after it:
20260721090128_AddTokenInvalidToABMTokens -> 20260806154139, and
20260721160351_AddHostMDMWindowsProfilesStatus -> 20260806154150.

Cherry-picked that rename here so our migration keeps running last,
and bumped 20260804143233_CreateHostMDMAppleDeviceVitals ->
20260806161534 accordingly. Regenerated schema.sql.
@nulmete nulmete mentioned this pull request Aug 6, 2026
7 tasks
@lucasmrod
lucasmrod dismissed stale reviews from nulmete and getvictor via adb8e2c August 7, 2026 10:47
@lucasmrod
lucasmrod requested a review from getvictor August 7, 2026 10:52
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.35%. Comparing base (25cfac3) to head (adb8e2c).

Files with missing lines Patch % Lines
...ables/20260806154139_AddTokenInvalidToABMTokens.go 66.66% 1 Missing ⚠️
.../20260806154150_AddHostMDMWindowsProfilesStatus.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #50690   +/-   ##
=======================================
  Coverage   68.35%   68.35%           
=======================================
  Files        3957     3957           
  Lines      254097   254097           
  Branches    13490    13490           
=======================================
+ Hits       173684   173688    +4     
  Misses      64859    64859           
+ Partials    15554    15550    -4     
Flag Coverage Δ
backend 69.60% <66.66%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@lucasmrod
lucasmrod merged commit 3de43c8 into main Aug 7, 2026
42 of 44 checks passed
@lucasmrod
lucasmrod deleted the bump-out-of-order-migrations-4.91 branch August 7, 2026 11:40
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.

5 participants