fix: add UUIDNaturalKeyManagerMixin to EnvironmentFeatureVersionManager#7066
Open
MartinLam12 wants to merge 1 commit intoFlagsmith:mainfrom
Open
fix: add UUIDNaturalKeyManagerMixin to EnvironmentFeatureVersionManager#7066MartinLam12 wants to merge 1 commit intoFlagsmith:mainfrom
MartinLam12 wants to merge 1 commit intoFlagsmith:mainfrom
Conversation
EnvironmentFeatureVersionManager was missing UUIDNaturalKeyManagerMixin, causing loaddata to raise DeserializationError for organisations with v2 feature versioning enabled. FKs to EnvironmentFeatureVersion were serialised as natural-key lists but could not be resolved without get_by_natural_key on the manager. Closes Flagsmith#6768
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
|
@MartinLam12 is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7066 +/- ##
==========================================
- Coverage 98.33% 98.26% -0.07%
==========================================
Files 1337 1338 +1
Lines 50010 50013 +3
==========================================
- Hits 49178 49146 -32
- Misses 832 867 +35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Closes #6768
EnvironmentFeatureVersionManagerwas missingUUIDNaturalKeyManagerMixin, causingloaddatato raiseDeserializationErrorfor organisations with v2 feature versioning enabled. FKs toEnvironmentFeatureVersionwere serialised as natural-key lists but could not be resolved withoutget_by_natural_keyon the manager.Fix: added
UUIDNaturalKeyManagerMixintoEnvironmentFeatureVersionManagerinfeatures/versioning/managers.py, following the same pattern used by every other exportable manager in the codebase.How did you test this code?
Added 7 unit tests in
tests/unit/import_export/test_unit_import_export_loaddata.py(based on tests from #6765). The key testtest_full_export_loaddata__v2_versioning_enabled__roundtrips_correctlyexercises the exact scenario: exporting an organisation with v2 feature versioning and loading it back vialoaddata. All tests pass.