fleet/server
Jonathan Katz 2f951b06a8
Add migration to fix mismatched software titles (#40078)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves: #35528 (followup)
This migration should fix `.pkg` installers that have a mismatched
software title, as well as software (versions) that are using the wrong
title. It's a little bit risky, as it could modify `software`,
`software_installers`, and `software_titles` data.

For software versions it just checks if the title's source is not the
same as the software. For installers it uses installers with
platform=`darwin` where the title's source isn't `apps`, which should
probably be the only case after the previous migration to convert titles
with source `pkg_packages` to `apps`.

Changefile was already added for 35528 in a previous PR.

# Checklist for submitter

## Testing

- [x] Added/updated automated tests
- [ ] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually
2026-02-19 11:39:04 -05:00
..
acl/activityacl Activity bounded context: Complete read operations (#38555) 2026-02-09 15:29:12 -06:00
activity slog migration: platform/mysql and related logic (#40072) 2026-02-19 08:27:24 -06:00
archtest Refactor endpoint_utils for modularization (#36484) 2025-12-31 09:12:00 -06:00
authz Add new Technician role (#39564) 2026-02-11 15:00:10 -03:00
aws_common Feat 1817 add iam auth to mysql and redis (#32488) 2025-09-04 10:08:47 -05:00
bindata Allow users to be readded if they were ever removed (#1945) 2021-09-07 13:33:40 -03:00
config Added OTEL log export support (#39279) 2026-02-06 18:57:28 -06:00
contexts Safely split incoming request headers, remove support for token presence in request body (#39427) 2026-02-18 08:50:04 -08:00
cron Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
datastore Add migration to fix mismatched software titles (#40078) 2026-02-19 11:39:04 -05:00
dev_mode Only allow FLEET_DEV_* env vars when --dev is passed, allow overriding configs one at a time in dev (#38652) 2026-01-27 14:32:56 -06:00
errorstore Fixed potential panic in error handler when Redis is down. (#31643) 2025-08-06 17:14:31 +02:00
fleet Fix: certificate field too long error due to osquery not encoding non-ascii characters (#40095) 2026-02-19 13:05:04 -03:00
goose Use UTC timestamps for DB migrations (#36228) 2025-11-24 15:49:10 -06:00
health Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
launcher Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
live_query Improve performance when recording schedule query results (#38524) 2026-01-27 10:33:47 -06:00
logging Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
mail [Bug fix] Unclear error message: Update users email via API (#36579) 2025-12-02 10:52:31 -06:00
mdm Added Country:US to new CA certs created by Fleet. (#40081) 2026-02-19 09:26:22 -06:00
mock Vulnerabilities cron optimization (#39820) 2026-02-18 13:59:15 -06:00
platform slog migration: platform/mysql and related logic (#40072) 2026-02-19 08:27:24 -06:00
policies Use lighter Team call when it's obviously safe to do so, comment potential areas for further improvement (#35587) 2025-11-17 17:25:45 -06:00
ptr Clean up android app config data layer, fix no-team persist bug (#37740) 2025-12-30 09:35:41 -06:00
pubsub Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
service Fix: certificate field too long error due to osquery not encoding non-ascii characters (#40095) 2026-02-19 13:05:04 -03:00
shellquote Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
sso End-user authentication for Window/Linux setup experience: backend (#34835) 2025-10-31 11:16:42 -05:00
test Add new Technician role (#39564) 2026-02-11 15:00:10 -03:00
variables DCSW: Support all IDP variables in Windows config profiles (#34707) 2025-10-24 10:10:58 -03:00
version Move external dependency fleetdm/kolide-kit to monorepo (#15861) 2024-01-02 18:22:52 -03:00
vulnerabilities Vulnerabilities cron optimization (#39820) 2026-02-18 13:59:15 -06:00
webhooks Policy enable bypass (#39350) 2026-02-12 09:01:36 -05:00
websocket Enable errcheck linter for golangci-lint (#8899) 2022-12-05 16:50:49 -06:00
worker Switched Android from go-kit/log to slog (#39785) 2026-02-13 08:45:28 -06:00
utils.go Fix CleanupExpiredHosts to prevent deletion of DEP-assigned hosts (#28313) 2025-04-18 12:49:03 -05:00
utils_test.go feature: target profiles by labels (#16202) 2024-01-26 11:00:58 -05:00