Skip to content
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

Init django-flags #2374

Merged
merged 3 commits into from
Nov 29, 2024
Merged

Init django-flags #2374

merged 3 commits into from
Nov 29, 2024

Conversation

jerabekjiri
Copy link
Contributor

Issue: AAP-35418

Add django-flags dependancy to Hub component.

verifications:

  1. add MY_FLAG to FLAGS in galaxy_ng/app/settings.py
FLAGS = {
    "MY_FLAG": []
}
  1. enable, disable flag and verify state
> docker compose -f dev/compose/aap.yaml exec manager /bin/bash
bash-4.4# django-admin enable_flag MY_FLAG
Successfully enabled MY_FLAG

bash-4.4# pulpcore-manager shell
Python 3.11.10 (main, Sep 24 2024, 09:33:51) [GCC 8.5.0 20210514 (Red Hat 8.5.0-22)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.29.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from flags.state import flag_state, enable_flag, disable_flag

In [2]: flag_state('MY_FLAG')
Out[2]: True

In [3]: disable_flag('MY_FLAG')

In [4]: flag_state('MY_FLAG')
Out[4]: False

(django-flags in EDA: ansible/eda-server#1135)

@github-actions github-actions bot added backport-4.9 This PR should be backported to stable-4.9 (2.4) backport-4.10 labels Nov 28, 2024
@jerabekjiri jerabekjiri removed backport-4.9 This PR should be backported to stable-4.9 (2.4) backport-4.10 labels Nov 28, 2024
Comment on lines 453 to 464
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.request',
],
},
},
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already by pulpcore, it we override we are going to break the browsable API I guess

https://github.com/pulp/pulpcore/blob/da11429a0ace2973beb3003d96a2a3071290ef52/pulpcore/app/settings.py#L131-L145

In the case we need to manipulate the setting coming from pulpcore we will need to do in the dynaconf_hooks.py which will run after data is loaded from pulpcore.

For now I think this can be removed.

@jerabekjiri jerabekjiri merged commit f4faf42 into ansible:master Nov 29, 2024
18 of 21 checks passed
Copy link

patchback bot commented Dec 6, 2024

Backport to stable-4.10: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4.10/f4faf422a54cba2e26415997637e8cb6e008fd3f/pr-2374

Backported as #2383

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Dec 6, 2024
* init django-flags
* fix TemplateDoesNotExist
* remove TEMPLATES

(cherry picked from commit f4faf42)
rochacbruno pushed a commit that referenced this pull request Dec 10, 2024
Init django-flags (#2374)

* init django-flags
* fix TemplateDoesNotExist
* remove TEMPLATES

(cherry picked from commit f4faf42)

Co-authored-by: Jiří Jeřábek (Jiri Jerabek) <Jerabekjirka@email.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants