-
Notifications
You must be signed in to change notification settings - Fork 429
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: Enable faster feature loading #3550
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: api/features/serializers.py
Did you find this useful? React with a 👍 or 👎 |
Uffizzi Preview |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3550 +/- ##
=======================================
Coverage 95.90% 95.91%
=======================================
Files 1102 1102
Lines 34706 34782 +76
=======================================
+ Hits 33286 33362 +76
Misses 1420 1420 ☔ View full report in Codecov by Sentry. |
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
In order to support faster loading on the feature page an alteration was done to the feature response, if the environment id is present, then the
FeatureState
that matches the correct environment and has the properis_live
attributes is set as the feature state for the feature.I tried to follow the
featurestates
associated code, although the inclusion of theidentity
serializer didn't seem necessary for this endpoint so I used a slightly slimmer serializer.Since using a queryset to slim the relationship from many-to-one to one-to-one wasn't possible, I took a page from the viewset and associated the individual models manually with an
IN
clause then kept the collection for association in the serializer.If the environment is not present then all that is different is that the value for the
feature_state
part of the response is set toNone
.How did you test this code?
None of the existing test methods really suited this test so I made a new one and checked the multivariate part of the response as well as basic functioning of the endpoint as well.