Skip to content

Commit

Permalink
Deprecation: codify browndates for "no config file deprecation" (#10612)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Aug 9, 2023
1 parent fdf6b60 commit 18889f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
19 changes: 13 additions & 6 deletions readthedocs/doc_builder/director.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from readthedocs.doc_builder.python_environments import Conda, Virtualenv
from readthedocs.projects.constants import BUILD_COMMANDS_OUTPUT_PATH_HTML
from readthedocs.projects.exceptions import RepositoryError
from readthedocs.projects.models import Feature
from readthedocs.projects.signals import after_build, before_build, before_vcs
from readthedocs.storage import build_tools_storage

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

now = timezone.now()

# fmt: off
# These browndates matches https://blog.readthedocs.com/use-build-os-config/
browndates = any([
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
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
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
timezone.datetime(2023, 9, 25, 0, 0, 0, tzinfo=timezone.utc) < now, # Fully removal
])
# fmt: on

# Raise a build error if the project is not using a config file or using v1
if self.data.project.has_feature(
Feature.NO_CONFIG_FILE_DEPRECATED
) and self.data.config.version not in ("2", 2):
if browndates and self.data.config.version not in ("2", 2):
raise BuildUserError(BuildUserError.NO_CONFIG_FILE_DEPRECATED)

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

now = timezone.now()

# fmt: off
# These browndates matches https://blog.readthedocs.com/use-build-os-config/
browndates = any([
Expand Down
5 changes: 0 additions & 5 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,6 @@ def add_features(sender, **kwargs):
# Build related features
GIT_CLONE_FETCH_CHECKOUT_PATTERN = "git_clone_fetch_checkout_pattern"
HOSTING_INTEGRATIONS = "hosting_integrations"
NO_CONFIG_FILE_DEPRECATED = "no_config_file"
SCALE_IN_PROTECTION = "scale_in_prtection"

FEATURES = (
Expand Down Expand Up @@ -2089,10 +2088,6 @@ def add_features(sender, **kwargs):
"Proxito: Inject 'readthedocs-addons.js' as <script> HTML tag in responses."
),
),
(
NO_CONFIG_FILE_DEPRECATED,
_("Build: Building without a configuration file is deprecated."),
),
(
SCALE_IN_PROTECTION,
_("Build: Set scale-in protection before/after building."),
Expand Down

0 comments on commit 18889f0

Please sign in to comment.