Skip to content

Commit

Permalink
Merge pull request #5198 from stsewd/remove-feature-flag-config-v2
Browse files Browse the repository at this point in the history
Remove feature flag for v2
  • Loading branch information
stsewd authored Jan 30, 2019
2 parents acb239d + bd4c1ac commit 54a87c0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 28 deletions.
4 changes: 1 addition & 3 deletions docs/guides/feature-flags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Feature Flags
Read the Docs offers some additional flag settings which can be only be configured by the site admin.
These are optional settings and you might not need it for every project.
By default, these flags are disabled for every project.
A seperate request can be made by opening an issue on our `github`_ to enable
A separate request can be made by opening an issue on our `github`_ to enable
or disable one or more of these featured flags for a particular project.

.. _github: https://github.com/rtfd/readthedocs.org
Expand All @@ -24,8 +24,6 @@ Available Flags

``DONT_OVERWRITE_SPHINX_CONTEXT``: :featureflags:`DONT_OVERWRITE_SPHINX_CONTEXT`

``ALLOW_V2_CONFIG_FILE``: :featureflags:`ALLOW_V2_CONFIG_FILE`

``MKDOCS_THEME_RTD``: :featureflags:`MKDOCS_THEME_RTD`

``DONT_SHALLOW_CLONE``: :featureflags:`DONT_SHALLOW_CLONE`
6 changes: 1 addition & 5 deletions readthedocs/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,11 +1119,7 @@ def load(path, env_config):
),
code=CONFIG_SYNTAX_INVALID,
)
allow_v2 = env_config.get('allow_v2')
if allow_v2:
version = config.get('version', 1)
else:
version = 1
version = config.get('version', 1)
build_config = get_configuration_class(version)(
env_config,
config,
Expand Down
6 changes: 3 additions & 3 deletions readthedocs/config/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_load_version1(tmpdir):
},
)
base = str(tmpdir)
build = load(base, {'allow_v2': True})
build = load(base, {})
assert isinstance(build, BuildConfigV1)


Expand All @@ -118,7 +118,7 @@ def test_load_version2(tmpdir):
},
)
base = str(tmpdir)
build = load(base, {'allow_v2': True})
build = load(base, {})
assert isinstance(build, BuildConfigV2)


Expand All @@ -132,7 +132,7 @@ def test_load_unknow_version(tmpdir):
)
base = str(tmpdir)
with raises(ConfigError) as excinfo:
load(base, {'allow_v2': True})
load(base, {})
assert excinfo.value.code == VERSION_INVALID


Expand Down
4 changes: 1 addition & 3 deletions readthedocs/doc_builder/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from readthedocs.config import BuildConfigV1, ConfigError, InvalidConfig
from readthedocs.config import load as load_config
from readthedocs.projects.models import Feature, ProjectConfigurationError
from readthedocs.projects.models import ProjectConfigurationError

from .constants import DOCKER_IMAGE, DOCKER_IMAGE_SETTINGS

Expand All @@ -27,7 +27,6 @@ def load_yaml_config(version):

img_name = project.container_image or DOCKER_IMAGE
python_version = 3 if project.python_interpreter == 'python3' else 2
allow_v2 = project.has_feature(Feature.ALLOW_V2_CONFIG_FILE)
try:
sphinx_configuration = path.join(
version.get_conf_py_path(),
Expand All @@ -37,7 +36,6 @@ def load_yaml_config(version):
sphinx_configuration = None

env_config = {
'allow_v2': allow_v2,
'build': {
'image': img_name,
},
Expand Down
6 changes: 0 additions & 6 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,6 @@ def add_features(sender, **kwargs):
PIP_ALWAYS_UPGRADE = 'pip_always_upgrade'
SKIP_SUBMODULES = 'skip_submodules'
DONT_OVERWRITE_SPHINX_CONTEXT = 'dont_overwrite_sphinx_context'
ALLOW_V2_CONFIG_FILE = 'allow_v2_config_file'
MKDOCS_THEME_RTD = 'mkdocs_theme_rtd'
API_LARGE_DATA = 'api_large_data'
DONT_SHALLOW_CLONE = 'dont_shallow_clone'
Expand All @@ -1298,11 +1297,6 @@ def add_features(sender, **kwargs):
_(
'Do not overwrite context vars in conf.py with Read the Docs context',
),
), (
ALLOW_V2_CONFIG_FILE,
_(
'Allow to use the v2 of the configuration file',
),
), (
MKDOCS_THEME_RTD,
_('Use Read the Docs theme for MkDocs as default theme')
Expand Down
9 changes: 1 addition & 8 deletions readthedocs/rtd_tests/tests/test_config_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from readthedocs.doc_builder.environments import LocalBuildEnvironment
from readthedocs.doc_builder.python_environments import Conda, Virtualenv
from readthedocs.projects import tasks
from readthedocs.projects.models import Feature, Project
from readthedocs.projects.models import Project
from readthedocs.rtd_tests.utils import create_git_submodule, make_git_repo
from doc_builder.constants import DOCKER_IMAGE_SETTINGS

Expand Down Expand Up @@ -87,7 +87,6 @@ def test_python_supported_versions_default_image_1_0(self, load_config):
config = load_yaml_config(self.version)

expected_env_config = {
'allow_v2': mock.ANY,
'build': {'image': 'readthedocs/build:1.0'},
'defaults': {
'install_project': self.project.install_project,
Expand Down Expand Up @@ -346,12 +345,6 @@ def create_project(self):
container_image=None,
)
self.version = get(Version, project=self.project)
# TODO: Remove later
get(
Feature,
projects=[self.project],
feature_id=Feature.ALLOW_V2_CONFIG_FILE,
)

def create_config_file(self, tmpdir, config):
base_path = apply_fs(
Expand Down

0 comments on commit 54a87c0

Please sign in to comment.