-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Feature flag to make readthedocs
theme default on MkDocs docs
#4802
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.16 on 2018-10-24 07:43 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
FEATURE_ID = 'mkdocs_theme_rtd' | ||
|
||
|
||
def forward_add_feature(apps, schema_editor): | ||
Feature = apps.get_model('projects', 'Feature') | ||
Feature.objects.create( | ||
feature_id=FEATURE_ID, | ||
# Not using ``default_true=True`` because we will do this manually in | ||
# the database from the Corporate site only, since this is not required | ||
# in the Community site | ||
# default_true=True, | ||
) | ||
|
||
|
||
def reverse_add_feature(apps, schema_editor): | ||
Feature = apps.get_model('projects', 'Feature') | ||
Feature.objects.filter(feature_id=FEATURE_ID).delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('projects', '0027_remove_json_with_html_feature'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forward_add_feature, reverse_add_feature), | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we're not doing anything like setting a default with the migration, then we don't actually need it for feature flags to work. I guess we'll have to manually add a feature flag on the commercial side? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, the migration in this case only creates the Feature flag object in the database. If we don't want that, the migration is useless and I can remove it. As you prefer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this is not required for feature flags. It's only needed if we are setting a time-based default. |
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 thing I think @davidfischer got caught up on here is that this might not work/break when a user pins
mkdocs>0.17
. Can you confirm the user has a way to self-select out of our feature flag?