Emit created/deleted activities for setup experience scripts - #49639
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #49639 +/- ##
========================================
Coverage 67.90% 67.90%
========================================
Files 3889 3889
Lines 248409 248468 +59
Branches 13059 13226 +167
========================================
+ Hits 168671 168712 +41
- Misses 64530 64539 +9
- Partials 15208 15217 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 6602c42bcb04eb149bad35c4bc0f7dbc43cc7f6b and ffcfa7f. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (21)
🚧 Files skipped from review as they are similar to previous changes (19)
WalkthroughAdds audit activities for setup experience script creation, replacement, and deletion. The datastore now reports whether setting a script changed persisted content, allowing the service to suppress duplicate creation events and repeated deletion events. Activity payloads include optional fleet metadata and script names. The frontend adds activity types, filter labels, rendering templates, and tests. GitOps and datastore mocks and tests are updated for the new contract. Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
frontend/interfaces/activity.ts (1)
579-582: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueFix formatting issue flagged by Prettier.
The static analysis tool flagged a formatting issue here. Consider keeping the keys and values on the same line to comply with the project's Prettier configuration.
💅 Proposed fix
- [ActivityType.CreatedSetupExperienceScript]: - "Added setup experience script", - [ActivityType.DeletedSetupExperienceScript]: - "Deleted setup experience script", + [ActivityType.CreatedSetupExperienceScript]: "Added setup experience script", + [ActivityType.DeletedSetupExperienceScript]: "Deleted setup experience script",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/interfaces/activity.ts` around lines 579 - 582, Update the ActivityType.CreatedSetupExperienceScript and ActivityType.DeletedSetupExperienceScript entries to keep each key and string value on a single line, matching the project’s Prettier formatting.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ee/server/service/setup_experience.go`:
- Around line 209-217: Move the setupExperienceTeamName call and its error
return before DeleteSetupExperienceScript in the surrounding setup-experience
operation. Ensure teamName is successfully fetched before any script deletion
occurs, while preserving the existing error handling and subsequent deletion
flow.
---
Nitpick comments:
In `@frontend/interfaces/activity.ts`:
- Around line 579-582: Update the ActivityType.CreatedSetupExperienceScript and
ActivityType.DeletedSetupExperienceScript entries to keep each key and string
value on a single line, matching the project’s Prettier formatting.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 43bd11e8-cf95-4cbf-8361-2d1cbf9d0c4e
📥 Commits
Reviewing files that changed from the base of the PR and between bd8f1e8 and 3c66e2d6624ac83f2ea4abdf68ef5b187651c247.
⛔ Files ignored due to path filters (1)
docs/Contributing/reference/audit-logs.mdis excluded by!**/*.md
📒 Files selected for processing (20)
changes/16774-setup-experience-script-activitiescmd/fleetctl/fleetctl/gitops_test.gocmd/fleetctl/fleetctl/testing_utils/testing_utils.goee/server/service/setup_experience.goee/server/service/setup_experience_test.gofrontend/interfaces/activity.tsfrontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tests.tsxfrontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tsxserver/datastore/mysql/activities_test.goserver/datastore/mysql/custom_host_vitals_test.goserver/datastore/mysql/hosts_test.goserver/datastore/mysql/microsoft_mdm_test.goserver/datastore/mysql/setup_experience.goserver/datastore/mysql/setup_experience_test.goserver/fleet/activities.goserver/fleet/datastore.goserver/mock/datastore_mock.goserver/service/integration_mdm_setup_experience_test.goserver/service/setup_experience_test.gotools/dibble/pkg/seed/activities.go
3c66e2d to
8ee3433
Compare
8f9906f to
6602c42
Compare
Setup experience script add/replace/delete now record activities (API and GitOps), skipping no-op re-submissions.
6602c42 to
ffcfa7f
Compare
Setup experience script add/replace/delete now record activities (API and GitOps), skipping no-op re-submissions.
Related issue: Resolves #
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
Testing
Summary by CodeRabbit