-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Feature flag to use readthedocs/build:testing
image
#5109
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
Changes from 1 commit
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 |
---|---|---|
|
@@ -32,6 +32,7 @@ | |
from readthedocs.builds.models import BuildCommandResultMixin | ||
from readthedocs.core.utils import slugify | ||
from readthedocs.projects.constants import LOG_TEMPLATE | ||
from readthedocs.projects.models import Feature | ||
from readthedocs.restapi.client import api as api_v2 | ||
|
||
from .constants import ( | ||
|
@@ -726,10 +727,18 @@ def __init__(self, *args, **kwargs): | |
project_name=self.project.slug, | ||
)[:DOCKER_HOSTNAME_MAX_LEN], | ||
) | ||
|
||
# Decide what Docker image to use, based on priorities: | ||
# Use the Docker image set by user or, | ||
if self.config and self.config.build.image: | ||
self.container_image = self.config.build.image | ||
# the image overridden by the project (manually set by an admin) or, | ||
if self.project.container_image: | ||
self.container_image = self.project.container_image | ||
# ``testing`` image if the project has this feature flag | ||
if self.project.has_feature(Feature.USE_TESTING_BUILD_IMAGE): | ||
self.container_image = 'readthedocs/build:testing' | ||
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. Shouldn't this be first so that it doesn't overwrite the users config? 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. I think the idea was to override the users config 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. I think if we're trying to test things, we should do it on users that haven't explicitly expressed a preference. It feels wrong to override them, and more likely to break something. 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. My idea is to override this user setting, yes. I explained my opinion better at #5109 (comment) |
||
|
||
if self.project.container_mem_limit: | ||
self.container_mem_limit = self.project.container_mem_limit | ||
if self.project.container_time_limit: | ||
|
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.
I also wonder if this should be before the users config? I can see reasons for both, but having our DB entry overwrite the users wishes seems really confusing.
Uh oh!
There was an error while loading. Please reload this page.
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.
We already do this from the config module
https://github.com/rtfd/readthedocs.org/blob/7aa57bbcd01994b662f34e3a7bf7ea8cb7ab82ac/readthedocs/doc_builder/config.py#L55
https://github.com/rtfd/readthedocs.org/blob/7aa57bbcd01994b662f34e3a7bf7ea8cb7ab82ac/readthedocs/config/config.py#L415-L419
https://github.com/rtfd/readthedocs.org/blob/7aa57bbcd01994b662f34e3a7bf7ea8cb7ab82ac/readthedocs/config/config.py#L703-L707
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.
Hrm ok. I guess the DB setting makes a bit of sense to overwrite, but not a feature flag for testing.