Skip to content
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
3 changes: 0 additions & 3 deletions server/osa/domain/deposition/port/convention_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ async def list(
self, *, limit: int | None = None, offset: int | None = None
) -> "List[Convention]": ...

@abstractmethod
async def exists(self, id: ConventionSlug) -> bool: ...

@abstractmethod
Comment on lines 20 to 23

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Repository integration test calls removed method

When the convention repository integration tests run, they call repo.exists(...) after this method and its PostgreSQL implementation have been removed, causing both assertions to fail with AttributeError.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive — this PR's own diff removes those tests: test_exists_true and test_exists_false are deleted in the server/tests/integration/persistence/test_convention_repo.py hunk of this same PR (the two assertions this comment refers to). Verified on the branch head: git grep '\.exists(' over server/ finds no remaining caller of ConventionRepository.exists in source or tests — the only repository-exists caller left is ontology_repo.exists (osa/domain/semantics/service/schema.py:37), a different port this PR doesn't touch. No change needed.

async def list_with_source(self) -> "List[Convention]":
"""Return conventions that have a source defined (SQL-level filter)."""
Expand Down
2 changes: 0 additions & 2 deletions server/osa/domain/deposition/service/convention.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from osa.domain.shared.model.source import IngesterDefinition
from osa.domain.shared.model.srn import (
ConventionSlug,
Domain,
LocalId,
SchemaId,
SchemaIdentifier,
Expand All @@ -32,7 +31,6 @@ class ConventionService(Service):
metadata_service: MetadataService # TODO: replace with a port?
hook_registry: HookRegistryService
outbox: Outbox
node_domain: Domain

async def deploy(
self,
Expand Down
2 changes: 0 additions & 2 deletions server/osa/domain/deposition/util/di/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,13 @@ def get_convention_service(
metadata_service: MetadataService,
hook_registry: HookRegistryService,
outbox: Outbox,
config: Config,
) -> ConventionService:
return ConventionService(
convention_repo=convention_repo,
schema_service=schema_service,
metadata_service=metadata_service,
hook_registry=hook_registry,
outbox=outbox,
node_domain=Domain(config.domain),
)

@provide(scope=Scope.APP)
Expand Down
3 changes: 0 additions & 3 deletions server/osa/domain/feature/model/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
from osa.domain.feature.model.feature import FeatureTable

__all__ = ["FeatureTable"]
18 changes: 0 additions & 18 deletions server/osa/domain/feature/model/feature.py

This file was deleted.

1 change: 0 additions & 1 deletion server/osa/domain/shared/model/srn.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ class ResourceType(str, Enum):
dep = "dep"
schema = "schema"
onto = "onto"
conv = "conv"
snap = "snap"
evt = "evt"
val = "val"
Expand Down
15 changes: 1 addition & 14 deletions server/osa/infrastructure/persistence/adapter/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from osa.domain.deposition.port.storage import FileStoragePort
from osa.domain.shared.error import InfrastructureError
from osa.domain.shared.model.provenance import RunRef
from osa.domain.shared.model.srn import ConventionSlug, DepositionSRN
from osa.domain.shared.model.srn import DepositionSRN
from osa.domain.validation.model.batch_outcome import (
BatchRecordOutcome,
HookRecordId,
Expand Down Expand Up @@ -211,19 +211,6 @@ async def delete_files_for_deposition(
if dep_dir.exists():
shutil.rmtree(dep_dir)

def _conv_id(self, convention_id: ConventionSlug) -> str:
return convention_id.root

def get_source_staging_dir(self, convention_id: ConventionSlug, run_id: str) -> Path:
staging = self.base_path / "sources" / self._conv_id(convention_id) / "staging" / run_id
staging.mkdir(parents=True, exist_ok=True)
return staging

def get_source_output_dir(self, convention_id: ConventionSlug, run_id: str) -> Path:
output = self.base_path / "sources" / self._conv_id(convention_id) / "runs" / run_id
output.mkdir(parents=True, exist_ok=True)
return output

async def move_source_files_to_deposition(
self,
staging_dir: Path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ async def list(
result = await self.session.execute(stmt)
return [_row_to_convention(dict(r)) for r in result.mappings().all()]

async def exists(self, id: ConventionSlug) -> bool:
stmt = select(conventions_table.c.id).where(conventions_table.c.id == id.root)
result = await self.session.execute(stmt)
return result.first() is not None

async def list_with_source(self) -> List[Convention]:
stmt = (
select(conventions_table)
Expand Down
21 changes: 1 addition & 20 deletions server/osa/infrastructure/s3/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from osa.domain.deposition.port.storage import FileStoragePort
from osa.domain.shared.error import InfrastructureError, NotFoundError
from osa.domain.shared.model.provenance import RunRef
from osa.domain.shared.model.srn import ConventionSlug, DepositionSRN
from osa.domain.shared.model.srn import DepositionSRN
from osa.domain.validation.model.batch_outcome import (
BatchRecordOutcome,
HookRecordId,
Expand Down Expand Up @@ -48,9 +48,6 @@ def __init__(self, s3: S3Client, data_mount_path: str) -> None:
def _safe_id(self, srn: DepositionSRN) -> str:
return f"{srn.domain.root}_{srn.id.root}"

def _conv_id(self, convention_id: ConventionSlug) -> str:
return convention_id.root

def _dep_prefix(self, deposition_id: DepositionSRN) -> str:
return f"depositions/{self._safe_id(deposition_id)}"

Expand Down Expand Up @@ -123,22 +120,6 @@ async def delete_files_for_deposition(

# ── Ingester storage ──────────────────────────────────────────────

def get_source_staging_dir(self, convention_id: ConventionSlug, run_id: str) -> Path:
"""Return path for PVC subpath computation (no I/O)."""
return (
Path(self._data_mount_path)
/ "sources"
/ self._conv_id(convention_id)
/ "staging"
/ run_id
)

def get_source_output_dir(self, convention_id: ConventionSlug, run_id: str) -> Path:
"""Return path for PVC subpath computation (no I/O)."""
return (
Path(self._data_mount_path) / "sources" / self._conv_id(convention_id) / "runs" / run_id
)

async def move_source_files_to_deposition(
self,
staging_dir: Path,
Expand Down
12 changes: 0 additions & 12 deletions server/tests/integration/persistence/test_convention_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,6 @@ async def test_list_with_limit_and_offset(self, pg_session: AsyncSession):
page = await repo.list(limit=2, offset=1)
assert len(page) == 2

async def test_exists_true(self, pg_session: AsyncSession):
repo = PostgresConventionRepository(pg_session)
conv = _make_convention()
await repo.save(conv)
await pg_session.commit()

assert await repo.exists(conv.id) is True

async def test_exists_false(self, pg_session: AsyncSession):
repo = PostgresConventionRepository(pg_session)
assert await repo.exists(ConventionSlug.parse("nope-nope")) is False

async def test_convention_without_ingester(self, pg_session: AsyncSession):
"""Ingester is optional — should be None on retrieval when not set."""
repo = PostgresConventionRepository(pg_session)
Expand Down
1 change: 0 additions & 1 deletion server/tests/integration/test_bulk_publish_dual_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ async def _register_convention(
metadata_service=metadata_service,
hook_registry=HookRegistryService(registry=PostgresHookRegistry(pg_session)),
outbox=AsyncMock(),
node_domain=Domain("localhost"),
)
# Bundled deploy: schema + typed metadata table + convention, one txn.
# Use the slug for both the convention and its schema so the typed table is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
)
from osa.domain.shared.model.srn import (
ConventionSlug,
Domain,
SchemaId,
SchemaIdentifier,
)
Expand Down Expand Up @@ -90,7 +89,6 @@ def _make_service(
metadata_service=AsyncMock(),
hook_registry=hook_registry or AsyncMock(),
outbox=outbox or AsyncMock(),
node_domain=Domain("localhost"),
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from osa.domain.shared.model.source import IngesterDefinition
from osa.domain.shared.model.srn import (
ConventionSlug,
Domain,
SchemaId,
SchemaIdentifier,
)
Expand Down Expand Up @@ -101,7 +100,6 @@ def _make_service(
metadata_service=AsyncMock(),
hook_registry=hook_registry or AsyncMock(),
outbox=outbox or AsyncMock(),
node_domain=Domain("localhost"),
)


Expand Down
2 changes: 1 addition & 1 deletion server/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading