Skip to content

Commit 18889f0

Browse files
humitosagjohnsonericholscher
authored
Deprecation: codify browndates for "no config file deprecation" (#10612)
* Deprecation: notification and feature flag for `build.image` config Define a weekly task to communicate our users about the deprecation of `build.image` using the deprecation plan we used for the configuration file v2 as well. - 3 brownout days - final removal date on October 2nd - weekly onsite/email notification on Wednesday at 11:15 CEST (around 3.5k projects affected) - allow to opt-out from these emails - feature flag for brownout days - build detail's page notification Related: * readthedocs/meta#48 * #10354 * #10587 * Deprecation: notification and feature flag for `build.image` config Define a weekly task to communicate our users about the deprecation of `build.image` using the deprecation plan we used for the configuration file v2 as well. - 3 brownout days - final removal date on October 2nd - weekly onsite/email notification on Wednesday at 11:15 CEST (around ~22k projects affected) - allow to opt-out from these emails - feature flag for brownout days - build detail's page notification Related: * readthedocs/meta#48 * #10354 * #10587 * Review and update logic * Start emailing people with projects building from 3 years ago * Apply suggestions from code review Co-authored-by: Anthony <[email protected]> Co-authored-by: Eric Holscher <[email protected]> * Add HTML version of the email * Codify brownout dates and remove the feature flag Follows the suggestion from https://github.com/readthedocs/blog/pull/233/files#r1283479184 * Use UTC datetimes to compare * Deprecation: codify browndates for "no config file deprecation" Follows https://github.com/readthedocs/blog/pull/233/files#r1283479184 This way, we don't have to enable anything manually. These dates are already communicated to users and will be automatically applied. --------- Co-authored-by: Anthony <[email protected]> Co-authored-by: Eric Holscher <[email protected]>
1 parent fdf6b60 commit 18889f0

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

readthedocs/doc_builder/director.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from readthedocs.doc_builder.python_environments import Conda, Virtualenv
2525
from readthedocs.projects.constants import BUILD_COMMANDS_OUTPUT_PATH_HTML
2626
from readthedocs.projects.exceptions import RepositoryError
27-
from readthedocs.projects.models import Feature
2827
from readthedocs.projects.signals import after_build, before_build, before_vcs
2928
from readthedocs.storage import build_tools_storage
3029

@@ -250,16 +249,24 @@ def checkout(self):
250249
self.data.build["config"] = self.data.config.as_dict()
251250
self.data.build["readthedocs_yaml_path"] = custom_config_file
252251

252+
now = timezone.now()
253+
254+
# fmt: off
255+
# These browndates matches https://blog.readthedocs.com/use-build-os-config/
256+
browndates = any([
257+
timezone.datetime(2023, 7, 14, 0, 0, 0, tzinfo=timezone.utc) < now < timezone.datetime(2023, 7, 14, 12, 0, 0, tzinfo=timezone.utc), # First, 12hs
258+
timezone.datetime(2023, 8, 14, 0, 0, 0, tzinfo=timezone.utc) < now < timezone.datetime(2023, 8, 15, 0, 0, 0, tzinfo=timezone.utc), # Second, 24hs
259+
timezone.datetime(2023, 9, 4, 0, 0, 0, tzinfo=timezone.utc) < now < timezone.datetime(2023, 9, 6, 0, 0, 0, tzinfo=timezone.utc), # Third, 24hs
260+
timezone.datetime(2023, 9, 25, 0, 0, 0, tzinfo=timezone.utc) < now, # Fully removal
261+
])
262+
# fmt: on
263+
253264
# Raise a build error if the project is not using a config file or using v1
254-
if self.data.project.has_feature(
255-
Feature.NO_CONFIG_FILE_DEPRECATED
256-
) and self.data.config.version not in ("2", 2):
265+
if browndates and self.data.config.version not in ("2", 2):
257266
raise BuildUserError(BuildUserError.NO_CONFIG_FILE_DEPRECATED)
258267

259268
# Raise a build error if the project is using "build.image" on their config file
260269

261-
now = timezone.now()
262-
263270
# fmt: off
264271
# These browndates matches https://blog.readthedocs.com/use-build-os-config/
265272
browndates = any([

readthedocs/projects/models.py

-5
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,6 @@ def add_features(sender, **kwargs):
19491949
# Build related features
19501950
GIT_CLONE_FETCH_CHECKOUT_PATTERN = "git_clone_fetch_checkout_pattern"
19511951
HOSTING_INTEGRATIONS = "hosting_integrations"
1952-
NO_CONFIG_FILE_DEPRECATED = "no_config_file"
19531952
SCALE_IN_PROTECTION = "scale_in_prtection"
19541953

19551954
FEATURES = (
@@ -2089,10 +2088,6 @@ def add_features(sender, **kwargs):
20892088
"Proxito: Inject 'readthedocs-addons.js' as <script> HTML tag in responses."
20902089
),
20912090
),
2092-
(
2093-
NO_CONFIG_FILE_DEPRECATED,
2094-
_("Build: Building without a configuration file is deprecated."),
2095-
),
20962091
(
20972092
SCALE_IN_PROTECTION,
20982093
_("Build: Set scale-in protection before/after building."),

0 commit comments

Comments
 (0)