diff --git a/requirements.txt b/requirements.txt index bbc6f49e93e847d772a5174ccf79d9e46ec04fa8..9bfddc4af255853c9054340ede1333e5075d80b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ click +fastimport flask psycopg2 python-dateutil -fastimport +sentry-sdk typing-extensions diff --git a/swh/vault/cookers/base.py b/swh/vault/cookers/base.py index c96c291ff71cbbcfd54420bcf2a6d0cc64f35d6f..db0b23fa5844328f8a86a5ded61876491154f67d 100644 --- a/swh/vault/cookers/base.py +++ b/swh/vault/cookers/base.py @@ -10,6 +10,7 @@ import traceback from typing import ClassVar, Set from psycopg2.extensions import QueryCanceledError +import sentry_sdk from swh.model.swhids import CoreSWHID, ObjectType from swh.storage.interface import StorageInterface @@ -151,6 +152,7 @@ class BaseVaultCooker(metaclass=abc.ABCMeta): f"The full error was:\n\n{tb}", ) logging.exception("Bundle cooking failed.") + sentry_sdk.capture_exception() else: self.backend.set_status(self.BUNDLE_TYPE, self.swhid, "done") self.backend.set_progress(self.BUNDLE_TYPE, self.swhid, None) diff --git a/swh/vault/cookers/git_bare.py b/swh/vault/cookers/git_bare.py index 1f76a320f9f512d6026c40d498883c3f00a77b03..c45b96a25a6df22ffef24279a66ddb2ef5c86783 100644 --- a/swh/vault/cookers/git_bare.py +++ b/swh/vault/cookers/git_bare.py @@ -42,6 +42,8 @@ import tempfile from typing import Any, Dict, Iterable, Iterator, List, NoReturn, Optional, Set, Tuple import zlib +import sentry_sdk + from swh.core.api.classes import stream_results_optional from swh.model import git_objects from swh.model.hashutil import hash_to_bytehex, hash_to_hex @@ -210,6 +212,7 @@ class GitBareCooker(BaseVaultCooker): subprocess.run(["git", "-C", self.gitdir, "repack", "-d"], check=True) except subprocess.CalledProcessError: logging.exception("git-repack failed with:") + sentry_sdk.capture_exception() # Remove their non-packed originals subprocess.run(["git", "-C", self.gitdir, "prune-packed"], check=True)