Skip to content

Add feature flip for build endpoints #3205

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

Merged
merged 26 commits into from
Oct 31, 2017

Conversation

agjohnson
Copy link
Contributor

@agjohnson agjohnson commented Oct 28, 2017

This blocks new projects from using the deprecated webhook endpoints in
core.views.webhooks. Returns 403 if the project doesn't have the build endpoint
enabled.

A data migration is added to create a feature that defaults to true for old
projects. This can eventually be reworked to add specific projects to the
feature and then can be altered to default to false.

Requires #3194
Requires #3200
Close #3130

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

Looks mostly good pending fixing Travis, and my question about the definition of the properties of the feature. Where is the canonical place to look for the properties of a feature flag?

@@ -23,6 +23,10 @@ class NoProjectException(Exception):
pass


def allow_deprecated_use(project):
Copy link
Member

Choose a reason for hiding this comment

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

Not a great name.

@@ -994,9 +1002,13 @@ def add_features(sender, **kwargs):
# Feature constants - this is not a exhaustive list of features, features
# may be added by other packages
USE_SPHINX_LATEST = 'use_sphinx_latest'
USE_SETUPTOOLS_LATEST = 'use_setuptools_latest'
ALLOW_DEPRECATED_WEBHOOKS = 'allow_deprecated_webhooks'
Copy link
Member

Choose a reason for hiding this comment

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

Are we not defining their type here, instead of in the migration? I don't know how I'd notice that these are "default true by date" without looking at the actual DB?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure there is great way to do that.

For instance, this feature might initially start evaluating True for historical projects and for explicitly tagged projects, and the migration is to ensure this happens. The next step with this feature is to explicitly add the historical projects actually using the feature and disallow all projects (default to False historically). So this meaning will mutate with time.

Besides documenting here, is there any pattern you think would work?

Copy link
Member

Choose a reason for hiding this comment

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

My above question is probably more useful -- can I look in the admin to see what the properties are? If so, "the data in the DB" can be canonical.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, these options will be in the admin if any projects are assigned. Details on date added and historical value are in the admin detail page:

image

Conflicts:
	readthedocs/doc_builder/python_environments.py
	readthedocs/projects/models.py
@agjohnson agjohnson merged commit e85e1fc into master Oct 31, 2017
@agjohnson agjohnson deleted the project-feature-build-api-endpoint branch October 31, 2017 18:20
@lqc
Copy link

lqc commented Nov 13, 2017

Hi, this deprecated endpoint is still used in project details page (https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/templates/core/project_details.html#L62), so users won't be able to trigger manually builds for new projects.

#3223 seems related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants