Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more exceptions as WARNING log level #6851

Merged
merged 1 commit into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions readthedocs/doc_builder/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
from readthedocs.core.utils import slugify
from readthedocs.projects.constants import LOG_TEMPLATE
from readthedocs.projects.models import Feature
from readthedocs.projects.exceptions import (
RepositoryError,
ProjectConfigurationError,
)

from .constants import (
DOCKER_HOSTNAME_MAX_LEN,
Expand Down Expand Up @@ -528,15 +532,18 @@ class BuildEnvironment(BaseEnvironment):
successful
"""

# Exceptions considered ERROR from a Build perspective but as a WARNING for
# the application itself. These exception are logged as warning and not sent
# to Sentry.
# These exceptions are considered ERROR from a Build perspective (the build
# failed and can continue) but as a WARNING for the application itself (RTD
# code didn't failed). These exception are logged as ``WARNING`` and they
# are not sent to Sentry.
WARNING_EXCEPTIONS = (
VersionLockedError,
ProjectBuildsSkippedError,
YAMLParseError,
BuildTimeoutError,
MkDocsYAMLParseError,
RepositoryError,
ProjectConfigurationError,
)

def __init__(
Expand Down
20 changes: 4 additions & 16 deletions readthedocs/projects/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,10 @@ def get_rtd_env_vars(self):
return env


@app.task(max_retries=5, default_retry_delay=7 * 60)
@app.task(
max_retries=5,
default_retry_delay=7 * 60,
)
def sync_repository_task(version_pk):
"""Celery task to trigger VCS version sync."""
try:
Expand Down Expand Up @@ -394,25 +397,10 @@ def run(self, version_pk): # pylint: disable=arguments-differ
return False


# Exceptions under ``throws`` argument are considered ERROR from a Build
# perspective (the build failed and can continue) but as a WARNING for the
# application itself (RTD code didn't failed). These exception are logged as
# ``INFO`` and they are not sent to Sentry.
@app.task(
bind=True,
max_retries=5,
default_retry_delay=7 * 60,
throws=(
VersionLockedError,
ProjectBuildsSkippedError,
YAMLParseError,
BuildTimeoutError,
BuildEnvironmentWarning,
RepositoryError,
ProjectConfigurationError,
ProjectBuildsSkippedError,
MkDocsYAMLParseError,
),
)
def update_docs_task(self, version_pk, *args, **kwargs):
try:
Expand Down