Skip to content

Commit 17ef4de

Browse files
authored
Implement tracing decorator (#218)
* Rename bootstrap package to common * Implement tracing decorator * Apply tracing decoratore to book service
1 parent 09fe6e4 commit 17ef4de

29 files changed

+336
-26
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ COPY --chown=nonroot:nonroot poetry.lock .
6868
COPY --chown=nonroot:nonroot src/alembic ./alembic
6969
COPY --chown=nonroot:nonroot src/domains ./domains
7070
COPY --chown=nonroot:nonroot src/gateways ./gateways
71-
COPY --chown=nonroot:nonroot src/bootstrap ./bootstrap
71+
COPY --chown=nonroot:nonroot src/common ./bootstrap
7272
COPY --chown=nonroot:nonroot src/alembic.ini .
7373
COPY --chown=nonroot:nonroot Makefile .
7474

docs/inversion-of-control.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def book_repository_factory() -> BookRepositoryInterface:
216216

217217
# file `domains/books/_service.py`
218218
from domains.books._gateway_interfaces import BookRepositoryInterface
219-
from bootstrap.factories import book_repository_factory
219+
from common.factories import book_repository_factory
220220

221221

222222
class BookService:
@@ -274,7 +274,7 @@ def inject_book_repository(f):
274274
def wrapper(*args, **kwds):
275275
# This allows overriding the decorator
276276
if "book_repository" not in kwds.keys():
277-
from bootstrap.storage import BookRepository
277+
from common.storage import BookRepository
278278
kwds["book_repository"] = BookRepository()
279279
elif not isinstance(kwds["book_repository"], BookRepositoryInterface):
280280
import warnings

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ branch = true
8282
source = ["src"]
8383
omit = [
8484
"src/alembic/*",
85-
"src/bootstrap/config.py",
86-
"src/bootstrap/logs/*",
85+
"src/common/config.py",
86+
"src/common/logs/*",
8787
]
8888
# It's not necessary to configure concurrency here
8989
# because pytest-cov takes care of that

src/alembic/env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from sqlalchemy.ext.asyncio import AsyncEngine
55

66
from alembic import context
7-
from bootstrap.bootstrap import application_init
8-
from bootstrap.config import AppConfig
7+
from common.bootstrap import application_init
8+
from common.config import AppConfig
99

1010
USE_TWOPHASE = False
1111

src/celery_worker/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from celery.signals import worker_process_init
88
from opentelemetry.instrumentation.celery import CeleryInstrumentor
99

10-
from bootstrap import AppConfig, application_init
10+
from common import AppConfig, application_init
1111

1212

1313
@worker_process_init.connect(weak=False)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)