Open RachelElysia opened 1 month ago
related to #25499 , so the software team may want to take this
related to https://github.com/fleetdm/fleet/issues/25499 , so the software team may want to take this
@mostlikelee Speaking of this, didn't someone file a ticket about updating activity things on our last call? I'm not sure where that ticket is to link it.
cc @noahtalerman
Hi team, This issue looks beginner-friendly — I’d love to take it up as my first contribution to Fleet.
I’ve gone through the context and the linked issues. The goal is clear:
team_id
and team_name
to the activity API responses for policy and query actionsHey @drvcodenta! Please feel free to open a PR when you get the chance.
We added this feature request to Feature fest to weigh it for prioritization. Heads up that this feature request has to be prioritized at the next feature fest to merge in your PR: https://fleetdm.com/handbook/company/product-groups#criteria-for-prioritization
If it's prioritized, we'll assign a member of the Fleet team to the feature request. They'll be responsible for helping merge in your PR.
Gong snippet: TODO March 31, 2025, Software Design Review, 18 minutes in - @noahtalerman @eugkuo chat about use case for having this addition but not wanting to blow up scope on a different feature ticket
When adding, editing, and deleting a policy (also a query), we are not surfacing the team information for those activities in the activity API or activity feed UI. See screenshot:
We do surface the team_id
and team_name
for adding, editing, and deleting software. See screenshot:
team_id
and team_name
to the activity details
for add/edit/delete policyteam_id
and team_name
to the activity details
for add/edit/delete queryHi, While working on this issue, I noticed that editing a global policy doesn't create any activity log (no ActivityTypeEditedPolicy is generated and there is no function defined for that purpose in the global_policies). I wanted to know if there is a philosophical reason behind this gap? Or is it likely just an oversight?
@drvcodenta super appreciate you jumping on this ticket!!!
I just added, edited, and deleted a "All teams" (global) policy in the UI and got these activities:
{
"created_at": "2025-04-15T18:41:10.419719Z",
"id": 836,
"actor_full_name": "Rachel",
"actor_id": 1,
"actor_gravatar": "",
"actor_email": "***",
"type": "deleted_policy",
"details": {
"policy_id": 74,
"policy_name": "Edit policy"
},
"fleet_initiated": false
},
{
"created_at": "2025-04-15T18:41:02.559709Z",
"id": 835,
"actor_full_name": "Rachel",
"actor_id": 1,
"actor_gravatar": "",
"actor_email": "***",
"type": "edited_policy",
"details": {
"policy_id": 74,
"policy_name": "Edit policy"
},
"fleet_initiated": false
},
{
"created_at": "2025-04-15T18:40:57.950179Z",
"id": 834,
"actor_full_name": "Rachel",
"actor_id": 1,
"actor_gravatar": "",
"actor_email": "***",
"type": "created_policy",
"details": {
"policy_id": 74,
"policy_name": "Add policy"
},
"fleet_initiated": false
},
Are you not seeing the same on your end?
Interesting!! Yes, I actually don't see any log of the activity when I edit an "All teams"(global) policy on my End Idk why it's causing this weird Behaviour🤔 I also checked for ActivityTypeEditedPolicy inside global_policy.go --> I didn't find any function, so I thought maybe it was intentionally left out for some reason. For reference, here's the process I followed to edit an all teams policy
https://github.com/user-attachments/assets/dc83e140-5606-4b9b-b101-943046cf7a02
@drvcodenta thanks for the detailed screenrecording!! That is so weird!!! I'll take a look again later today, and get back to ya
@RachelElysia I have submitted a patch that solves the issue except for the case of activity type edited policy in all Teams. I’ve attached a screenshot with a sample output for reference. Please let me know if any changes are needed!
I was planning to add the function for activity type edited policy in all teams myself but since it's actually working in your case, i decided to not add it as it may add some unnecessary code.
team_id
andteam_name
to thedetails
object for add/edit/delete policy and query activities in the Activity APIReference: March 31, 2025, Software Design Review (18-minute mark) – Noah and Eugene discussion.