Skip to content

Commit ea0e44f

Browse files
stsewdCopilot
andauthored
Set final cutoff date for projects using SSH keys with write access (#12536)
Ref: - readthedocs/readthedocs-corporate#2049 - readthedocs/meta#196 --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: stsewd <[email protected]>
1 parent afac3f1 commit ea0e44f

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

readthedocs/doc_builder/director.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* fetching instructions etc.
99
"""
1010

11+
import datetime
1112
import os
1213
import tarfile
1314

@@ -216,12 +217,20 @@ def checkout(self):
216217
self.data.api_client.project(self.data.project.pk).patch(
217218
{"has_ssh_key_with_write_access": has_ssh_key_with_write_access}
218219
)
220+
221+
now = datetime.datetime.now(tz=datetime.timezone.utc)
222+
hard_failure = now >= datetime.datetime(
223+
2025, 12, 1, 0, 0, 0, tzinfo=datetime.timezone.utc
224+
)
219225
if has_ssh_key_with_write_access:
220-
self.attach_notification(
221-
attached_to=f"project/{self.data.project.pk}",
222-
message_id=MESSAGE_PROJECT_SSH_KEY_WITH_WRITE_ACCESS,
223-
dismissable=True,
224-
)
226+
if hard_failure and settings.RTD_ENFORCE_BROWNOUTS_FOR_DEPRECATIONS:
227+
raise BuildUserError(BuildUserError.SSH_KEY_WITH_WRITE_ACCESS)
228+
else:
229+
self.attach_notification(
230+
attached_to=f"project/{self.data.project.pk}",
231+
message_id=MESSAGE_PROJECT_SSH_KEY_WITH_WRITE_ACCESS,
232+
dismissable=True,
233+
)
225234

226235
identifier = self.data.build_commit or self.data.version.identifier
227236
log.info("Checking out.", identifier=identifier)

readthedocs/notifications/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def get_rendered_body(self):
226226
"""
227227
This build has failed because the current deploy key on the repository was created with write permission.
228228
For protection against abuse we've restricted use of these deploy keys.
229-
A read-only deploy key will need to be set up <b>before July 31, 2025</b> to continue building this project.
229+
A read-only deploy key will need to be set up <b>before December 1st, 2025</b> to continue building this project.
230230
Read more about this in our <a href="https://about.readthedocs.com/blog/2025/07/ssh-keys-with-write-access/">blog post</a>.
231231
"""
232232
).strip(),

readthedocs/projects/notifications.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
"""
188188
This project has a deploy key with write access to the repository.
189189
For protection against abuse we've restricted use of these deploy keys.
190-
A read-only deploy key will need to be set up <b>before July 31, 2025</b> to continue building this project.
190+
A read-only deploy key will need to be set up <b>before December 1st, 2025</b> to continue building this project.
191191
Read more about this in our <a href="https://about.readthedocs.com/blog/2025/07/ssh-keys-with-write-access/">blog post</a>.
192192
"""
193193
).strip(),

0 commit comments

Comments
 (0)