fleet/cmd
Victor Lyuboslavsky b3216a1727
Add CleanupCompletedCampaignTargets to cleanup old campaign targets. (#32385)
Fixes #31432 

- Added campaign target cleanup: Deletes targets from campaigns
completed >24h ago. Uses 10% or 50k min per run, processes in 10k
batches. Added DB index, integrated into hourly cron, includes tests.

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests
- [x] 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


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- New Features
- Automatic cleanup of live query campaign targets 24 hours after
campaign completion to reduce clutter and storage usage.

- Chores
- Added a database index to speed up live query target operations for
improved performance at scale.
- Enhanced scheduled maintenance to log cleanup counts and execution
time for better observability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-08-28 11:04:05 -05:00
..
cpe Add validator for NVD feed items (#29282) 2025-05-22 14:51:52 -05:00
cve Revise generated CPE for Docker Desktop for macOS to match more recent CVEs, make Docker CVE CPEs consistent (#32335) 2025-08-27 10:11:21 -06:00
fleet Add CleanupCompletedCampaignTargets to cleanup old campaign targets. (#32385) 2025-08-28 11:04:05 -05:00
fleetctl Add --line flag to fleetctl get mdm-command-results (#31473) 2025-08-25 17:04:18 -04:00
macoffice Add new archive URL as data source for Mac Office release notes (#26978) 2025-03-10 08:46:18 -05:00
maintained-apps FMA test automation (#31210) 2025-07-31 15:23:36 -05:00
msrc #31474 MSRC has incorrectly named CVEs. This PR removes them from the generated file. (#31851) 2025-08-21 12:41:53 -04:00
osquery-perf add mdm config profile for mac to osquery-perf (#31874) 2025-08-22 09:02:29 +02:00