-
Notifications
You must be signed in to change notification settings - Fork 46
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
feat: add features dict to EnterpriseCustomerViewSet #1877
Conversation
'num_pages': 1, | ||
'current_page': 1, | ||
'start': 0, |
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 don't understand why num_pages, current_page, and start were all net additions. Didn't you just extend DefaultPagination? Not a blocker.
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.
The default pagination was probably the vanilla DRF page-number paginator set via settings file. Adam's new paginator extends the edX-DRF default paginator: https://github.com/openedx/edx-drf-extensions/blob/master/edx_rest_framework_extensions/paginators.py
enterprise/api/pagination.py
Outdated
paginated_response = super().get_paginated_response(data) | ||
paginated_response.data.update({ | ||
'features': { | ||
'top_down_assignment_real_time_lcm': top_down_assignment_real_time_lcm(), |
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.
Recommendation: add a function to toggles.py to serialize this dictionary so that adding a new feature flag is limited to just updating one file.
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.
Great suggestion! I will update this PR after afternoon meetings.
Ticket: https://2u-internal.atlassian.net/browse/ENT-7713
Adds support for exposing Waffle-based feature flags onto the default paginated response in the
EnterpriseCustomerViewSet
such that micro-frontends already calling API endpoint(s) from this viewset have access to the Waffle-based feature flags without introducing new API integrations.See ADR (preview) for more details around this approach.
Example API response with
enterprise_features
object included:Merge checklist:
requirements/*.txt
files)base.in
if needed in production but edx-platform doesn't install ittest-master.in
if edx-platform pins it, with a matching versionmake upgrade && make requirements
have been run to regenerate requirementsmake static
has been run to update webpack bundling if any static content was updated./manage.py makemigrations
has been run./manage.py lms makemigrations
in the shell.Post merge:
(so basically once your build finishes, after maybe a minute you should see the new version in PyPi automatically (on refresh))
make upgrade
in edx-platform will look for the latest version in PyPi.