Skip to content

Commit

Permalink
Notifications: unsupported VCS (#11627)
Browse files Browse the repository at this point in the history
* Notifications: unsupported VCS

Closes #11600

* Update readthedocs/projects/notifications.py

Co-authored-by: Eric Holscher <[email protected]>

---------

Co-authored-by: Eric Holscher <[email protected]>
  • Loading branch information
humitos and ericholscher authored Sep 30, 2024
1 parent e6e9578 commit 445bc29
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 1 addition & 6 deletions readthedocs/doc_builder/director.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import structlog
import yaml
from django.conf import settings
from django.utils.translation import gettext_lazy as _

from readthedocs.builds.constants import EXTERNAL
from readthedocs.config.config import CONFIG_FILENAME_REGEX
Expand Down Expand Up @@ -78,11 +77,7 @@ def setup_vcs(self):
os.makedirs(self.data.project.doc_path)

if not self.data.project.vcs_class():
raise RepositoryError(
_('Repository type "{repo_type}" unknown').format(
repo_type=self.data.project.repo_type,
),
)
raise RepositoryError(RepositoryError.UNSUPPORTED_VCS)

before_vcs.send(
sender=self.data.version,
Expand Down
1 change: 1 addition & 0 deletions readthedocs/projects/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class RepositoryError(BuildUserError):
DUPLICATED_RESERVED_VERSIONS = "project:repository:duplicated-reserved-versions"
FAILED_TO_CHECKOUT = "project:repository:checkout-failed"
GENERIC = "project:repository:generic-error"
UNSUPPORTED_VCS = "project:repository:unsupported-vcs"


class SyncRepositoryLocked(BuildAppError):
Expand Down
13 changes: 13 additions & 0 deletions readthedocs/projects/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@
),
type=ERROR,
),
Message(
id=RepositoryError.UNSUPPORTED_VCS,
header=_("Repository type not suported"),
body=_(
textwrap.dedent(
"""
Subversion, Mercurial, and Bazaar are not supported anymore.
Read more about this deprecation in <a href="https://about.readthedocs.com/blog/2024/02/drop-support-for-subversion-mercurial-bazaar/">our blog</a>.
"""
).strip(),
),
type=ERROR,
),
Message(
id=ProjectConfigurationError.NOT_FOUND,
header=_("Sphinx configuration file is missing"),
Expand Down

0 comments on commit 445bc29

Please sign in to comment.