Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add events for migration runs #28637

Merged
merged 1 commit into from
Feb 13, 2025
Merged

chore: add events for migration runs #28637

merged 1 commit into from
Feb 13, 2025

Conversation

zlwaterfield
Copy link
Contributor

Changes

Follow along for RBAC changes: #24512

Adding in event calls for actions

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

It doesn't have an impact.

How did you test this code?

Update mocks for tests

@zlwaterfield zlwaterfield self-assigned this Feb 12, 2025
@zlwaterfield zlwaterfield marked this pull request as ready for review February 12, 2025 21:10
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds event tracking functionality to monitor RBAC migration operations in the organization API, helping track the progress and success of role-based access control implementation.

  • Added event tracking in /posthog/api/organization.py for migration start, completion, and failure states
  • Events include user's distinct ID for tracking migration progress across the organization
  • Error messages are captured in failure events for debugging purposes
  • Implementation is cloud/self-hosted agnostic as noted in PR description

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 283 to 285
rbac_team_access_control_migration(organization.id)
rbac_feature_flag_role_access_migration(organization.id)
Copy link
Contributor

Choose a reason for hiding this comment

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

style: These migrations are run sequentially without transaction management. Consider wrapping both migrations in a single transaction to ensure atomicity.

@zlwaterfield zlwaterfield requested a review from a team February 12, 2025 21:12
@zlwaterfield zlwaterfield changed the title chore: Add events for migration runs chore: add events for migration runs Feb 12, 2025
@zlwaterfield zlwaterfield merged commit 8d61a41 into master Feb 13, 2025
97 checks passed
@zlwaterfield zlwaterfield deleted the zach/rbac/22 branch February 13, 2025 20:35
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.

2 participants