Skip to content

Commit

Permalink
Add DAB Feature Flag common API
Browse files Browse the repository at this point in the history
  • Loading branch information
zkayyali812 committed Jan 28, 2025
1 parent 0023885 commit 6d961d2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions awx/main/tests/functional/test_feature_flags_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
import pytest

from awx.main.models import ( # noqa
User,
)


@pytest.mark.django_db
def test_feature_flags_list_endpoint(get):
bob = User.objects.create(username='bob', password='test_user', is_superuser=False)

Check warning on line 11 in awx/main/tests/functional/test_feature_flags_api.py

View check run for this annotation

Codecov / codecov/patch

awx/main/tests/functional/test_feature_flags_api.py#L11

Added line #L11 was not covered by tests

url = "/api/v2/feature_flags_definition/"
response = get(url, user=bob, expect=200)
assert len(response.data) == 1

Check warning on line 15 in awx/main/tests/functional/test_feature_flags_api.py

View check run for this annotation

Codecov / codecov/patch

awx/main/tests/functional/test_feature_flags_api.py#L13-L15

Added lines #L13 - L15 were not covered by tests
1 change: 1 addition & 0 deletions awx/settings/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
'ansible_base.jwt_consumer',
'ansible_base.resource_registry',
'ansible_base.rbac',
'ansible_base.feature_flags',
'flags',
]

Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements_git.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
git+https://github.com/ansible/system-certifi.git@devel#egg=certifi
# Remove pbr from requirements.in when moving ansible-runner to requirements.in
git+https://github.com/ansible/ansible-runner.git@devel#egg=ansible-runner
django-ansible-base @ git+https://github.com/ansible/django-ansible-base@devel#egg=django-ansible-base[rest-filters,jwt_consumer,resource-registry,rbac]
django-ansible-base @ git+https://github.com/zkayyali812/django-ansible-base@zk/feature-flag/api#egg=django-ansible-base[rest-filters,jwt_consumer,resource-registry,rbac,feature-flags]
awx-plugins-core @ git+https://github.com/ansible/awx-plugins.git@devel#egg=awx-plugins-core
awx_plugins.interfaces @ git+https://github.com/ansible/awx_plugins.interfaces.git

0 comments on commit 6d961d2

Please sign in to comment.