Skip to content

Commit 30b0830

Browse files
committed
Remove deprecated_ utils and notifications
They are not useful anymore since it's not possible to build without a config file or using a config file v1.
1 parent 623190d commit 30b0830

File tree

3 files changed

+0
-83
lines changed

3 files changed

+0
-83
lines changed

readthedocs/builds/models.py

-31
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
get_vcs_url,
6161
)
6262
from readthedocs.builds.version_slug import VersionSlugField
63-
from readthedocs.config import LATEST_CONFIGURATION_VERSION
6463
from readthedocs.core.utils import extract_valid_attributes_for_model, trigger_build
6564
from readthedocs.notifications.models import Notification
6665
from readthedocs.projects.constants import (
@@ -1104,36 +1103,6 @@ def can_rebuild(self):
11041103
def external_version_name(self):
11051104
return external_version_name(self)
11061105

1107-
def deprecated_config_used(self):
1108-
"""
1109-
Check whether this particular build is using a deprecated config file.
1110-
1111-
When using v1 or not having a config file at all, it returns ``True``.
1112-
Returns ``False`` only when it has a config file and it is using v2.
1113-
1114-
Note we are using this to communicate deprecation of v1 file and not using a config file.
1115-
See https://github.com/readthedocs/readthedocs.org/issues/10342
1116-
"""
1117-
if not self.config:
1118-
return True
1119-
1120-
return int(self.config.get("version", "1")) != LATEST_CONFIGURATION_VERSION
1121-
1122-
def deprecated_build_image_used(self):
1123-
"""
1124-
Check whether this particular build is using the deprecated "build.image" config.
1125-
1126-
Note we are using this to communicate deprecation of "build.image".
1127-
See https://github.com/readthedocs/meta/discussions/48
1128-
"""
1129-
if not self.config:
1130-
# Don't notify users without a config file.
1131-
# We hope they will migrate to `build.os` in the process of adding a `.readthedocs.yaml`
1132-
return False
1133-
1134-
build_config_key = self.config.get("build", {})
1135-
return "image" in build_config_key
1136-
11371106
def reset(self):
11381107
"""
11391108
Reset the build so it can be re-used when re-trying.

readthedocs/rtd_tests/tests/test_builds.py

-18
Original file line numberDiff line numberDiff line change
@@ -248,24 +248,6 @@ def test_build_is_stale(self):
248248
self.assertTrue(build_two.is_stale)
249249
self.assertFalse(build_three.is_stale)
250250

251-
def test_deprecated_config_used(self):
252-
now = timezone.now()
253-
254-
build = get(
255-
Build,
256-
project=self.project,
257-
version=self.version,
258-
date=now - datetime.timedelta(minutes=8),
259-
state="finished",
260-
)
261-
262-
self.assertTrue(build.deprecated_config_used())
263-
264-
build.config = {"version": 2}
265-
build.save()
266-
267-
self.assertFalse(build.deprecated_config_used())
268-
269251
def test_build_is_external(self):
270252
# Turn the build version to EXTERNAL type.
271253
self.version.type = EXTERNAL

readthedocs/templates/builds/build_detail.html

-34
Original file line numberDiff line numberDiff line change
@@ -162,40 +162,6 @@
162162
</p>
163163
</div>
164164
{% endif %}
165-
166-
{% comment %}
167-
NOTE: I'm not migrating "deprecated build image used" nor "deprecated config used"
168-
since these notifications are not useful anymore.
169-
The YAML config file is required now and it's not possible to use `build.image` anymore.
170-
We should probably remove these blocks completely now.
171-
172-
{# This message is not dynamic and only appears when loading the page after the build has finished #}
173-
{% if build.finished and build.deprecated_build_image_used %}
174-
<div class="build-ideas">
175-
<p>
176-
{% blocktrans trimmed with config_file_link="https://blog.readthedocs.com/use-build-os-config/" %}
177-
<strong>Your builds will stop working soon!</strong><br/>
178-
"build.image" config key is deprecated and it will be removed soon.
179-
<a href="{{ config_file_link }}">Read our blog post to know how to migrate to new key "build.os"</a>
180-
and ensure your project continues building successfully.
181-
{% endblocktrans %}
182-
</p>
183-
</div>
184-
{% endif %}
185-
{% if build.finished and build.deprecated_config_used %}
186-
<div class="build-ideas">
187-
<p>
188-
{% blocktrans trimmed with config_file_link="https://blog.readthedocs.com/migrate-configuration-v2/" %}
189-
<strong>Your builds will stop working soon!</strong><br/>
190-
Configuration files will <strong>soon be required</strong> by projects, and will no longer be optional.
191-
<a href="{{ config_file_link }}">Read our blog post to create one</a>
192-
and ensure your project continues building successfully.
193-
{% endblocktrans %}
194-
</p>
195-
</div>
196-
{% endif %}
197-
{% endcomment %}
198-
199165
{% endif %}
200166

201167

0 commit comments

Comments
 (0)