-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(flags): Ensure activity log reflects removing variants #29379
base: master
Are you sure you want to change the base?
Conversation
Supports removing individual variants as well as all of them. Fixes #26115
There was a problem hiding this 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 enhances the feature flag activity log to properly track and display variant deletions, addressing a gap in the previous implementation.
- Added test cases in
frontend/src/lib/components/ActivityLog/activityLogLogic.feature-flag.test.tsx
to verify proper logging of individual variant deletions and complete variant removal - Implemented logic in
frontend/src/scenes/feature-flags/activityDescriptions.tsx
to detect when variants are removed by comparing before/after states using Sets - Added specific handling for the case when all variants are removed (when changing from multivariate to boolean/remote config)
- Created human-readable activity log messages that clearly indicate which variants were removed
- Ensured the implementation works for both individual variant removals and bulk removals
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
Size Change: 0 B Total Size: 9.73 MB ℹ️ View Unchanged
|
@dmarticus in the original issue you mentioned "Clean up the feature flag history" but it wasn't clear to me what you meant by that. My suggestion is we get this PR in first so that we start logging when variants are removed. We can always follow up with a new issue for improvements to the presentation of the activity log. |
📸 UI snapshots have been updated6 snapshot changes in total. 0 added, 6 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
Updates the activity log for feature flags to describe two types of variant deletions:
Problem
Fixes #26115
Turns out activity log doesn't mention when a variant is removed. It also didn't describe when all variants are removed (as would happen if you changed the release toggle to boolean or remote config)
Changes
We'll start with a feature flag with four variants.
And remove two of them, adjusting the rollout percentages to sum to 100%.
Activity log shows:
Ok, let's remove all variants by changing this to a remote config setting:
Finally, let's go back to a feature flag with variants:
And we'll change its release toggle to boolean with no other changes.
Just to make sure we get a standalone log.
Does this work well for both Cloud and self-hosted?
Yes
How did you test this code?
Manual tests and some unit tests.