fleet/server/service
Victor Lyuboslavsky 7deade8057
Activity bounded context: /api/latest/fleet/activities (2 of 2) (#38478)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #37806 

Removed `ds.ListActivities` from the legacy datastore and updated
code/tests to use the new activity bounded context instead.

The changes to `cron.go` and most changes to `mysql/activities_test.go`
will eventually be migrated to the activity bounded context. The current
changes are an intermediate step.

The issues tracked by https://github.com/fleetdm/fleet/issues/38234 will
be addressed in additional/parallel PRs shortly.

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
  - Done in the previous PR

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually


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

## Summary by CodeRabbit

* **Refactor**
* Migrated activity retrieval from direct datastore calls to a
service-based architecture for improved maintainability and consistency.
* Enhanced system context handling for background automation tasks to
ensure proper authorization during scheduled operations.
* Streamlined activity recording for automated processes with dedicated
system identity tracking.

* **Tests**
* Updated test infrastructure with new helpers for activity service
integration across test suites.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Ian Littman <iansltx@gmail.com>
2026-01-23 07:42:09 -06:00
..
async OpenTelemetry minor improvements (#32324) 2025-08-28 19:32:46 -05:00
calendar Update Google Calendar event bodies and relevant previews in the Fleet UI (#28715) 2025-05-01 13:12:53 -07:00
conditional_access_microsoft_proxy Microsoft Compliance Partner backend changes (#29540) 2025-06-11 14:22:46 -03:00
contract Add missing platform_like during orbit enrollment (#32671) 2025-09-05 16:05:19 -03:00
externalsvc
integrationtest Moved common_mysql package to server/platform/mysql (#38017) 2026-01-08 13:17:19 -06:00
middleware Moved common endpointer packages to platform dir. (#37780) 2026-01-06 14:23:07 -06:00
mock Add missing platform_like during orbit enrollment (#32671) 2025-09-05 16:05:19 -03:00
modules/activities Activity bounded context: /api/latest/fleet/activities (2 of 2) (#38478) 2026-01-23 07:42:09 -06:00
osquery_utils update windows verifier to allow non-atomic profiles (#38390) 2026-01-20 11:37:26 -05:00
redis_key_value
redis_lock
redis_policy_set
schedule Added OTEL span for worker jobs. (#36057) 2025-11-21 11:28:47 -06:00
testdata Renew test certs (#38395) 2026-01-15 12:18:19 -07:00
activities.go Activity bounded context: /api/latest/fleet/activities (2 of 2) (#38478) 2026-01-23 07:42:09 -06:00
activities_test.go Activity bounded context: /api/latest/fleet/activities (1 of 2) (#38115) 2026-01-19 09:07:14 -05:00
appconfig.go Conditional Access bypass config and activity (#38453) 2026-01-20 15:20:24 -05:00
appconfig_test.go Ability to set fleet desktop alternative browser host in org settings (#38409) 2026-01-19 16:25:22 -04:00
apple_mdm.go Fleet UI: Fixed hover color of links in error flash messages (#38634) 2026-01-22 11:25:21 -05:00
apple_mdm_cmd_results.go Bugfix: apply a special-case for Xcode VPP app verification (#38539) 2026-01-21 17:16:13 -05:00
apple_mdm_ddm_test.go Updated SQL modes in tests to match production. (#31445) 2025-08-03 08:18:13 +02:00
apple_mdm_test.go Fix VPP versions to be valid semantic versions (#38227) 2026-01-15 17:06:45 -03:00
base_client.go End-user authentication for Window/Linux setup experience: agent (#34847) 2025-11-03 16:41:57 -06:00
base_client_errors.go End-user authentication for Window/Linux setup experience: agent (#34847) 2025-11-03 16:41:57 -06:00
base_client_errors_test.go Improved orbit debug logs when response contains a large HTML page. (#33195) 2025-09-19 17:00:19 -05:00
base_client_test.go TPM osquery-perf support (#30994) 2025-07-18 10:19:05 -03:00
build_tags_test.go
calendar.go Moved common endpointer packages to platform dir. (#37780) 2026-01-06 14:23:07 -06:00
campaigns.go API + auth + UI changes for team labels (#37208) 2025-12-29 21:28:45 -06:00
campaigns_test.go API + auth + UI changes for team labels (#37208) 2025-12-29 21:28:45 -06:00
carves.go Fix GCS for remaining features that use S3 (#32743) 2025-09-09 11:22:04 -03:00
carves_test.go
certificate_authorities.go HCA: fix generate GitOps missing todo comment and include secrets parsing (#32640) 2025-09-05 16:35:21 +03:00
certificate_authorities_test.go Add backend support for Smallstep CA (#32872) 2025-09-25 10:03:36 -05:00
certificate_templates.go Android certificate crud: validate variable replacement (#36648) 2025-12-05 12:14:14 -06:00
certificate_templates_test.go Added validation for empty certificate subject name. (#38114) 2026-01-09 13:45:35 -06:00
certificates.go Added validation for empty certificate subject name. (#38114) 2026-01-09 13:45:35 -06:00
client.go send categories from gitops (#38294) 2026-01-14 11:04:02 -05:00
client_android_certificates.go Added subject name to certificate template list endpoint response (#37028) 2025-12-11 05:38:59 -06:00
client_appconfig.go
client_carves.go
client_certificate_authorities.go gitops, basic apis, and table for android certificate templates (#35788) 2025-11-24 15:44:06 -06:00
client_debug.go
client_hosts.go
client_labels.go gitops changes for team labels (#37801) 2026-01-06 17:47:30 -04:00
client_live_query.go
client_live_query_test.go
client_mdm.go Support command status for commands and host for results in fleetctl (#37133) 2025-12-12 19:26:07 -04:00
client_mdm_test.go
client_packs.go
client_policies.go
client_profiles.go Fix macos_setup not always being exported correctly by generate-gitops (#30504) 2025-07-02 09:07:58 -03:00
client_queries.go
client_scripts.go Remove PUT endpoint, update to always use POST for setup experience scripts (#35818) 2025-11-17 11:29:23 -05:00
client_secret_variables.go Add backend APIs for adding, deleting and listing secret variables (#31936) 2025-08-14 19:33:47 -03:00
client_sessions.go Added scim/details endpoint (#28007) 2025-04-10 14:08:45 -05:00
client_setup.go
client_software.go Use custom icons in GitOps for Fleet Maintained Apps (#38497) 2026-01-20 11:56:40 -05:00
client_targets.go
client_teams.go Allow setting software icons via GitOps (#32886) 2025-09-26 15:59:48 -05:00
client_test.go gitops changes for team labels (#37801) 2026-01-06 17:47:30 -04:00
client_trigger.go
client_users.go
conditional_access_idp.go Okta IdP Apple profile endpoint + fixes (#35526) 2025-11-14 13:49:08 -06:00
conditional_access_idp_test.go Okta IdP Apple profile endpoint + fixes (#35526) 2025-11-14 13:49:08 -06:00
conditional_access_microsoft.go Add easy to understand errors when setting up Entra conditional access (#33453) 2025-09-25 22:52:28 -03:00
cron_schedules.go
cron_schedules_test.go
debug_handler.go Revise auth requirements for debug endpoints (#38173) 2026-01-12 10:37:06 -06:00
debug_handler_test.go Revise auth requirements for debug endpoints (#38173) 2026-01-12 10:37:06 -06:00
device_client.go Ability to set fleet desktop alternative browser host in org settings (#38409) 2026-01-19 16:25:22 -04:00
device_client_test.go Ability to set fleet desktop alternative browser host in org settings (#38409) 2026-01-19 16:25:22 -04:00
devices.go Add host identifier filter to MDM command results endpoint (#37158) 2025-12-12 14:17:21 -06:00
devices_endpoint_test.go Elide some more fields (#36802) 2025-12-05 17:01:44 -06:00
devices_test.go Ability to set fleet desktop alternative browser host in org settings (#38409) 2026-01-19 16:25:22 -04:00
devices_url_auth_test.go Add new self-service auth method for iOS/iPadOS (#36659) 2025-12-05 10:16:46 -05:00
endpoint_campaigns.go Refactoring service layer. Part 1 (#25945) 2025-02-03 11:23:26 -06:00
endpoint_middleware.go Fix debug log lines (#37831) 2026-01-05 10:32:14 -03:00
endpoint_middleware_test.go Refactor endpoint_utils for modularization (#36484) 2025-12-31 09:12:00 -06:00
endpoint_setup.go Improved error message when trying to apply CAs via gitops without a premium license (#37981) 2026-01-08 11:07:38 +00:00
endpoint_setup_test.go Apply starter library during for fleetctl preview server (#30519) 2025-07-16 08:12:32 -06:00
endpoint_utils.go Moved common endpointer packages to platform dir. (#37780) 2026-01-06 14:23:07 -06:00
endpoint_utils_test.go Moved common endpointer packages to platform dir. (#37780) 2026-01-06 14:23:07 -06:00
frontend.go Moved common endpointer packages to platform dir. (#37780) 2026-01-06 14:23:07 -06:00
frontend_test.go IdP Authentication before BYOD (#32017) 2025-08-18 18:31:53 +02:00
full_test.go
global_policies.go API + auth + UI changes for team labels (#37208) 2025-12-29 21:28:45 -06:00
global_policies_test.go API + auth + UI changes for team labels (#37208) 2025-12-29 21:28:45 -06:00
global_schedule.go Microsoft Compliance Partner backend changes (#29540) 2025-06-11 14:22:46 -03:00
global_schedule_test.go 21855 – Paginate and filter Queries on the server, update platform filtering from compatible to targeted platforms (#24446) 2024-12-11 10:50:28 -08:00
handler.go Implement trusted proxies config (#38471) 2026-01-19 22:13:37 -06:00
handler_test.go New rate limit algorithm for Fleet Desktop endpoints (#33344) 2025-09-26 15:03:50 -03:00
hosts.go 33509 feature branch (#38038) 2026-01-08 16:37:46 -05:00
hosts_test.go Activity bounded context: /api/latest/fleet/activities (2 of 2) (#38478) 2026-01-23 07:42:09 -06:00
http_auth_test.go Added scim/details endpoint (#28007) 2025-04-10 14:08:45 -05:00
integration_android_certificate_templates_test.go Renew android certificates backend (#37959) 2026-01-08 13:02:33 -07:00
integration_android_software_test.go IPA: validate conflicts with other installers, return proper error (#38005) 2026-01-13 10:30:03 -05:00
integration_certificate_authorities_test.go Expand integration tests for SCEP proxy retries; add missing changes file (#35473) 2025-11-12 15:05:49 -06:00
integration_core_test.go Activity bounded context: /api/latest/fleet/activities (2 of 2) (#38478) 2026-01-23 07:42:09 -06:00
integration_desktop_test.go Ability to set fleet desktop alternative browser host in org settings (#38409) 2026-01-19 16:25:22 -04:00
integration_ds_only_test.go
integration_enterprise_test.go Activity bounded context: /api/latest/fleet/activities (2 of 2) (#38478) 2026-01-23 07:42:09 -06:00
integration_enterprise_vulns_test.go os_versions endpoint performance improvements (#34897) 2025-11-03 13:07:44 -06:00
integration_install_test.go Cloudfront signing for in-house apps (#37650) 2026-01-05 16:30:31 -05:00
integration_live_queries_test.go Updated SQL modes in tests to match production. (#31445) 2025-08-03 08:18:13 +02:00
integration_logger_test.go Improve Microsoft endpoint validation (#38180) 2026-01-12 15:28:45 -05:00
integration_mdm_commands_test.go 33509 feature branch (#38038) 2026-01-08 16:37:46 -05:00
integration_mdm_ddm_test.go allow removal of config profiles when MDM is off (#37473) 2025-12-18 17:14:32 -04:00
integration_mdm_dep_test.go Bugfix: Fix query to ignore host_software_installs rows where host is deleted (#38250) 2026-01-14 08:32:30 -05:00
integration_mdm_lifecycle_test.go Add integration tests for VPP app auto updates (#38337) 2026-01-15 17:03:58 -03:00
integration_mdm_profiles_test.go Fleet UI: Fixed hover color of links in error flash messages (#38634) 2026-01-22 11:25:21 -05:00
integration_mdm_release_worker_test.go Wait for expected profiles to be sent before releasing device (#31381) 2025-07-31 17:50:57 +02:00
integration_mdm_setup_experience_test.go Add custom VPP app support (#37969) 2026-01-08 13:13:04 -06:00
integration_mdm_test.go Activity bounded context: /api/latest/fleet/activities (2 of 2) (#38478) 2026-01-23 07:42:09 -06:00
integration_smtp_test.go
integration_software_titles_test.go move deletion into block that only executes when the package itself changes (#38595) 2026-01-21 16:59:40 -05:00
integration_sso_test.go Activity bounded context: /api/latest/fleet/activities (1 of 2) (#38115) 2026-01-19 09:07:14 -05:00
integration_vpp_install_test.go Bugfix: apply a special-case for Xcode VPP app verification (#38539) 2026-01-21 17:16:13 -05:00
invites.go Migrate from aws-sdk-go v1 to v2 (#30308) 2025-06-30 17:45:39 -03:00
invites_test.go Allow opting in users to email verification on login (#24273) 2024-12-05 08:37:10 -06:00
jitter.go
jitter_test.go Update to Go 1.24.1 (#27506) 2025-03-31 11:14:09 -05:00
labels.go Change parameter name from populate_device_status to include_device_status per doc PR review (#37996) 2026-01-07 16:57:57 -05:00
labels_test.go Moved common_mysql package to server/platform/mysql (#38017) 2026-01-08 13:17:19 -06:00
labels_util.go Address backend review feedback from #37208 (#37742) 2025-12-30 08:48:55 -03:00
linux_mdm.go Implement BitLocker "action required" status (#31451) 2025-08-05 11:23:27 -05:00
linux_mdm_test.go Update GET /hosts/:id/encryption_key to return archived key when current key is unavailable (#30396) 2025-07-02 14:57:25 -05:00
live_queries.go service.errorer to fleet.Errorer (#26362) 2025-02-14 16:19:34 -06:00
mail_test.go Allow opting in users to email verification on login (#24273) 2024-12-05 08:37:10 -06:00
maintained_apps.go Fix FMAs on Render (#37557) 2025-12-23 13:01:32 -05:00
mdm.go Moved common endpointer packages to platform dir. (#37780) 2026-01-06 14:23:07 -06:00
mdm_profiles.go ARCW: Add Renewal ID verification and support in windows profiles (#37179) 2025-12-12 13:14:59 -04:00
mdm_profiles_test.go ARCW: Add Renewal ID verification and support in windows profiles (#37179) 2025-12-12 13:14:59 -04:00
mdm_scep.go
mdm_test.go Allow <Atomic> windows profiles (#38272) 2026-01-14 14:44:47 -05:00
mem_failing_policies_set_test.go
metrics.go
metrics_appconfig.go
metrics_change_email.go
metrics_invites.go
metrics_labels.go API + auth + UI changes for team labels (#37208) 2025-12-29 21:28:45 -06:00
metrics_sessions.go Replace home-made SAML implementation with https://github.com/crewjam/saml (#28486) 2025-07-07 15:13:46 -03:00
metrics_users.go
microsoft_mdm.go handle non atomic windows profiles when sending and receiving (#38332) 2026-01-19 11:16:28 -05:00
microsoft_mdm_test.go handle non atomic windows profiles when sending and receiving (#38332) 2026-01-19 11:16:28 -05:00
orbit.go gate orbit enrollment to windows/linux only (#38207) 2026-01-14 08:41:50 -06:00
orbit_client.go End-user authentication for Window/Linux setup experience: agent (#34847) 2025-11-03 16:41:57 -06:00
orbit_client_test.go
orbit_test.go Added new global activity when disk encryption key is escrowed (#31634) 2025-08-08 12:14:48 -04:00
osquery.go Refactor endpoint_utils for modularization (#36484) 2025-12-31 09:12:00 -06:00
osquery_test.go Compute, ingest, persist, and serve .app bundle executable hashes and paths (#38118) 2026-01-14 09:18:35 -08:00
packs.go service.errorer to fleet.Errorer (#26362) 2025-02-14 16:19:34 -06:00
packs_test.go
queries.go API + auth + UI changes for team labels (#37208) 2025-12-29 21:28:45 -06:00
queries_test.go API + auth + UI changes for team labels (#37208) 2025-12-29 21:28:45 -06:00
scheduled_queries.go service.errorer to fleet.Errorer (#26362) 2025-02-14 16:19:34 -06:00
scheduled_queries_test.go
scim.go Added scim/details endpoint (#28007) 2025-04-10 14:08:45 -05:00
scripts.go Add "batch script host results" API (#32174) 2025-08-27 16:39:43 -05:00
scripts_encoding.go Fix FMAs on Render (#37557) 2025-12-23 13:01:32 -05:00
scripts_encoding_test.go Fix FMAs on Render (#37557) 2025-12-23 13:01:32 -05:00
scripts_test.go Regen mocks and use the new func names (#35655) 2025-11-12 17:01:16 -05:00
secret_variables.go Prevent IT admins from deleting a secret variable in use (#32161) 2025-08-22 11:22:37 -03:00
secret_variables_test.go Add backend APIs for adding, deleting and listing secret variables (#31936) 2025-08-14 19:33:47 -03:00
service.go Use same MDM unenroll endpoint for Android and Apple (#37363) 2025-12-18 15:59:46 -04:00
service_appconfig.go Add support for publishing logs to NATS. (#36527) 2026-01-06 09:10:32 -03:00
service_appconfig_test.go Migrate from aws-sdk-go v1 to v2 (#30308) 2025-06-30 17:45:39 -03:00
service_campaign_test.go
service_campaigns.go Full-stack: Granular host count data for live queries/policies (#27258) 2025-03-19 09:53:55 -07:00
service_errors.go gitops, basic apis, and table for android certificate templates (#35788) 2025-11-24 15:44:06 -06:00
service_users.go Refactor endpoint_utils for modularization (#36484) 2025-12-31 09:12:00 -06:00
sessions.go Moved common endpointer packages to platform dir. (#37780) 2026-01-06 14:23:07 -06:00
sessions_test.go Regen mocks and use the new func names (#35655) 2025-11-12 17:01:16 -05:00
setup_experience.go manual agent install should only block macOS SE software (#38434) 2026-01-20 11:37:39 -05:00
setup_experience_test.go 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
software.go service.errorer to fleet.Errorer (#26362) 2025-02-14 16:19:34 -06:00
software_installers.go Bump installer max size, make configurable (#38122) 2026-01-19 13:36:01 -06:00
software_installers_test.go Address backend review feedback from #37208 (#37742) 2025-12-30 08:48:55 -03:00
software_test.go
software_title_icons.go Allow setting software icons via GitOps (#32886) 2025-09-26 15:59:48 -05:00
software_title_icons_test.go Moved common_mysql package to server/platform/mysql (#38017) 2026-01-08 13:17:19 -06:00
software_titles.go Database / API for auto software updates (#37599) 2025-12-22 12:39:30 -06:00
software_titles_test.go Add experimental software title name update endpoint for titles with a bundle ID (#26938) 2025-03-07 11:36:17 -06:00
status.go service.errorer to fleet.Errorer (#26362) 2025-02-14 16:19:34 -06:00
targets.go service.errorer to fleet.Errorer (#26362) 2025-02-14 16:19:34 -06:00
targets_test.go
team_policies.go API + auth + UI changes for team labels (#37208) 2025-12-29 21:28:45 -06:00
team_policies_test.go 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
team_schedule.go Microsoft Compliance Partner backend changes (#29540) 2025-06-11 14:22:46 -03:00
team_schedule_test.go 21855 – Paginate and filter Queries on the server, update platform filtering from compatible to targeted platforms (#24446) 2024-12-11 10:50:28 -08:00
teams.go Update backend and GitOps to handle AppleOSUpdateSettings.UpdateNewHosts (#37295) 2025-12-16 14:38:28 -04:00
teams_test.go Handle android certificates on deletion events (#37481) 2025-12-19 16:18:24 -07:00
testing_client.go Activity bounded context: /api/latest/fleet/activities (2 of 2) (#38478) 2026-01-23 07:42:09 -06:00
testing_utils.go Activity bounded context: /api/latest/fleet/activities (1 of 2) (#38115) 2026-01-19 09:07:14 -05:00
translator.go Moved common endpointer packages to platform dir. (#37780) 2026-01-06 14:23:07 -06:00
transport.go Change parameter name from populate_device_status to include_device_status per doc PR review (#37996) 2026-01-07 16:57:57 -05:00
transport_error.go Moved common endpointer packages to platform dir. (#37780) 2026-01-06 14:23:07 -06:00
transport_setup.go
transport_test.go Filter hosts by batch script execution status (#29547) 2025-06-05 18:53:14 -06:00
trigger.go service.errorer to fleet.Errorer (#26362) 2025-02-14 16:19:34 -06:00
user_roles.go service.errorer to fleet.Errorer (#26362) 2025-02-14 16:19:34 -06:00
users.go Delete Fleet users when deleted from IdP: Server changes for SCIM handling of deletion (#38321) 2026-01-19 11:35:42 -03:00
users_test.go Global observers and maintainers can now officially read user details (#38558) 2026-01-21 13:55:10 -06:00
validation_setup.go Full-stack: Make "Server url" validation conditions consistent across Fleet, update Web Address form validation and submission logic per Fleet best practices (frontend/docs/patterns.md) (#27455) 2025-03-27 13:56:38 -07:00
vpp.go Rename auto-update keys (#38100) 2026-01-12 11:08:26 -06:00
vpp_test.go Regen mocks and use the new func names (#35655) 2025-11-12 17:01:16 -05:00
vulnerabilities.go service.errorer to fleet.Errorer (#26362) 2025-02-14 16:19:34 -06:00
vulnerabilities_test.go
windows_mdm_profiles.go Moved common endpointer packages to platform dir. (#37780) 2026-01-06 14:23:07 -06:00
windows_mdm_profiles_test.go Add support for $FLEET_VAR_HOST_HARDWARE_SERIAL in Windows profiles, $FLEET_VAR_HOST_PLATFORM in Windows/Apple profiles (#35812) 2025-11-24 10:18:47 -06:00