Recovery lock password activities#41529
Conversation
For the following quick win: - #40354
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
…nto 41045-activities # Conflicts: # server/datastore/mysql/apple_mdm.go
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
- Only log set_host_recovery_lock_password activity for SET operations, not CLEAR operations - Only log activity when host lookup succeeds (prevents HostIDs() returning [0]) - Add newActivityFn parameter to test cases Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a new set_host_recovery_lock_password activity type for host-scoped recovery lock operations and renames the existing enabled_recovery_lock_password/disabled_recovery_lock_password activity types to plural forms (enabled_recovery_lock_passwords/disabled_recovery_lock_passwords). It also adds recovery lock password activity logging to the editTeamFromSpec and createTeamFromSpec flows.
Changes:
- New
ActivityTypeSetHostRecoveryLockPasswordactivity type withHostIDs()andWasFromAutomation()support, logged when a recovery lock command is acknowledged - Renamed
ActivityTypeEnabledRecoveryLockPassword→ActivityTypeEnabledRecoveryLockPasswords(and disabled variant) with updated activity name strings - Added recovery lock password activity creation in
createTeamFromSpecandeditTeamFromSpec
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| server/fleet/activities.go | New SetHostRecoveryLockPassword activity type; renamed enabled/disabled types to plural |
| server/service/apple_mdm.go | Handler now accepts newActivityFn, logs activity on successful recovery lock verification |
| server/service/appconfig.go | Updated references to renamed activity types |
| ee/server/service/teams.go | Updated references; added activity logging in createTeamFromSpec and editTeamFromSpec |
| cmd/fleet/serve.go | Pass svc.NewActivity to NewSetRecoveryLockResultsHandler |
| server/service/testing_utils.go | Pass svc.NewActivity to NewSetRecoveryLockResultsHandler |
| server/service/apple_mdm_cmd_results_test.go | Updated tests with activity function parameter and assertions |
| server/service/integration_mdm_test.go | Updated test references to renamed activity types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Related issue: Resolves #41045
Summary by CodeRabbit
Release Notes
New Features
Tests