Skip to content

Move NewActivity to activity bounded context#39521

Merged
getvictor merged 67 commits intomainfrom
victor/38536-poc
Feb 25, 2026
Merged

Move NewActivity to activity bounded context#39521
getvictor merged 67 commits intomainfrom
victor/38536-poc

Conversation

@getvictor
Copy link
Copy Markdown
Member

@getvictor getvictor commented Feb 7, 2026

Related issue: Resolves #38536

This PR moves all logic to create new activities to activity bounded context.
The old service and ActivityModule methods are not facades that route to the new activity bounded context. The facades will be removed in a subsequent PR.

Checklist for submitter

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • New Features

    • Added webhook support for activity events with configurable endpoint and enable/disable settings.
    • Enhanced automation-initiated activity creation without requiring a user context.
    • Improved activity service architecture with centralized creation and management.
  • Improvements

    • Refactored activity creation to use a dedicated service layer for better separation of concerns.
    • Added support for host-specific and automation-originated activities.

…actor activity streaming to use ListActivities service with system-based authorization. Improve test coverage for cron activities.
Resolve merge conflicts:
- Keep branch's StreamActivities approach instead of main's cronActivitiesStreaming
- Keep branch's HostProvider and GetHostLite additions to activity service
- Remove main's MarkActivitiesAsStreamed from fleet.Datastore (now handled by activity service)
- Remove main's testListHostPastActivities and cronActivitiesStreaming tests (not applicable to branch approach)
@getvictor getvictor changed the title NewActivity POC Move NewActivity to activity bounded context Feb 22, 2026
@getvictor getvictor marked this pull request as ready for review February 22, 2026 21:04
@getvictor getvictor requested a review from a team as a code owner February 22, 2026 21:04
cdcme
cdcme previously approved these changes Feb 24, 2026
lucasmrod
lucasmrod previously approved these changes Feb 25, 2026
Copy link
Copy Markdown
Member

@lucasmrod lucasmrod left a comment

Choose a reason for hiding this comment

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

LGTM.

Left one question around a removed test.

Also:

Related issue: Resolves #38538

Is it the correct linked issue?

}
}

func testListActivitiesHostOnlyExcluded(t *testing.T, env *testEnv) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was this test moved elsewhere?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is now covered by testNewActivityHostOnly at line 200 of the new file server/activity/internal/mysql/new_activity_test.go

# Conflicts:
#	server/datastore/mysql/activities.go
#	server/datastore/mysql/mysql.go
#	server/mdm/lifecycle/lifecycle.go
#	server/mdm/lifecycle/lifecycle_test.go
#	server/service/activities.go
#	server/service/modules/activities/activities.go
@getvictor getvictor merged commit 913a590 into main Feb 25, 2026
43 checks passed
@getvictor getvictor deleted the victor/38536-poc branch February 25, 2026 20:11
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.

Activity bounded context: Complete write operations

5 participants