-
Notifications
You must be signed in to change notification settings - Fork 462
fix: skip-audit-log-for-soft-deleted-CR #6367
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
base: main
Are you sure you want to change the base?
fix: skip-audit-log-for-soft-deleted-CR #6367
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6367 +/- ##
=======================================
Coverage 98.02% 98.02%
=======================================
Files 1282 1282
Lines 45498 45513 +15
=======================================
+ Hits 44600 44615 +15
Misses 898 898 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
api/features/versioning/tasks.py
Outdated
| latest_feature_states.update(environment_feature_version=ef_version) | ||
| latest_feature_states.update( | ||
| environment_feature_version=ef_version, | ||
| change_request=None, |
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.
I believe this is the less risky place to fix this issue.
I preferred not to add a guard against live_from = None because for any similar bug it would have entered the wrong branch and create an irrelevant log create_feature_state_updated_by_change_request_audit_log
…on' of github.com:Flagsmith/flagsmith into fix/enabling-v2-versioning-with-cr-block-project-deletion
for more information, see https://pre-commit.ci
…on' of github.com:Flagsmith/flagsmith into fix/enabling-v2-versioning-with-cr-block-project-deletion
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature!Closes #6248
Context
Edge-case that is a combination between data corruption when migrating to
feature versioningand trying to delete a project.When migrating, feature states from committed CR where linked to EFV with:
live_from = NoneWhen deleting the project, the soft-delete was triggering the hook here without
live_fromwhich raised the NoneType errorChanges
AFTER_SAVEto ignore CR withdeleted_atHow did you test this code?