-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
Also, use a new pattern for API instance objects
Also, add a convenience method on the Project model for feature flag dependent values.
Returns 403 if the project doesn't have the build endpoint enabled.
This allows for features on deprecated code, where we can say the feature is true historically.
Conflicts: readthedocs/doc_builder/python_environments.py
Conflicts: readthedocs/doc_builder/python_environments.py readthedocs/projects/models.py
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.
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?
readthedocs/core/views/hooks.py
Outdated
@@ -23,6 +23,10 @@ class NoProjectException(Exception): | |||
pass | |||
|
|||
|
|||
def allow_deprecated_use(project): |
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.
Not a great name.
readthedocs/projects/models.py
Outdated
@@ -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' |
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.
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?
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.
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?
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.
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.
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.
Conflicts: readthedocs/doc_builder/python_environments.py readthedocs/projects/models.py
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. |
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