-
Notifications
You must be signed in to change notification settings - Fork 69
AAP-45875 Runtime Feature Flags #736
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: devel
Are you sure you want to change the base?
Conversation
3822dfe
to
6b72afd
Compare
081fdcc
to
f492546
Compare
3699be8
to
8b6d0bc
Compare
This PR was reviewed in the DAB PR review meeting, before it can be merged, the remaining tasks are outstanding - |
fedaa23
to
69f6bbb
Compare
69f6bbb
to
2ef72a1
Compare
9860248
to
5b7f1f9
Compare
DVCS PR Check Results: PR appears valid (JIRA key(s) found) |
|
Downstream failures, starting to hit the database for references like this in AWX:
These are probably expected. This is in the job execution path, so that's not too big of a deal. |
@@ -5,55 +5,32 @@ Additional library documentation can be found at https://cfpb.github.io/django-f | |||
|
|||
## Settings | |||
|
|||
Add `ansible_base.feature_flags` to your installed apps: | |||
Add `ansible_base.feature_flags` to your installed apps and ensure `ansible_base.resource_registry` as added to enable flag state to sync across the platform: |
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.
Don't you also need to register the flag model in the resource registry config?
Just trying to complete the circle for ability for someone to understand. That should be mentioned here if I understand. Or mention briefly how you're doing that automatically, if that's the case.
|
||
|
||
class FeatureFlagType(SharedResourceTypeSerializer): | ||
"""Serialize list of feature flags""" |
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.
Not really for a list.
] | ||
router = AssociationResourceRouter() | ||
|
||
router.register(r'feature_flags/states', views.FeatureFlagsStatesView, basename='aap_flags_states') |
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 serializer for this has an awfully small number of fields. The model has many more fields. Even the management command gives more information.
Were you intending to add some other endpoint which would give the UI the information necessary to render choices and stuff?
|
||
def delete_feature_flags(): | ||
""" | ||
If a feature flag has been removed from the platform flags list, delete it from the database. |
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.
Strange between docstring & method name. Maybe it would flow more smoothly if named purge_feature_flags
. "delete" makes me expect a flag name as argument.
class FeatureFlagsStateListView(AnsibleBaseView): | ||
class FeatureFlagsStatesView(AnsibleBaseDjangoAppApiView, ModelViewSet): | ||
""" | ||
A view class for displaying feature flags states |
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.
Might be help to explain where they should go to change them?
Makes sense that this is read-only. But it would be really really helpful to direct users to where they need to be.
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'm good with the decisions made here, totally ready to 👍 this
Almost all my comments are to improve documentation, very simple things.
I'm just unclear if the API endpoints (views, serializers) are finished. I'm confused about that, in terms of what the UI needs to be delivered with this, what the response looks like, and if that's planned for later or anything.
Description
https://issues.redhat.com/browse/AAP-45875
This change is the foundation for enabling runtime platform feature flags for AAP. This updates the django-ansible-base to be the central location where all platform flags are defined. Components can inherit the
ansible_base.feature_flags
application to inherit all platform feature flag definitions.To enable runtime platform feature flags in AAP.
This change addresses the issue by defining a database flag source, which contains all the feature flags along with their associated metadata.
These feature flags are installed into each components database at install-time and kept in sync via resource sync (Gateway is the provider)
Before this can be merged, the following should be done -
Type of Change
Self-Review Checklist
Testing Instructions
Prerequisites
Steps to Test
Recommend testing this through AAP Dev, but it can be tested directly via the test app as well.
make configure-sources
Expected Results
AAP Deploys as expected with database feature flags.
Notes
This PR is the prerequisite for the following component PRs -
Gateway - https://github.com/ansible/aap-gateway/pull/795
EDA - ansible/eda-server#1346
Galaxy - ansible/galaxy_ng#2615
AWX - ansible/awx#16030