test_proposals_no_commit_meta.py
python
sha256:ef10830ce231e0a20efcb0e2586cb879471247e916616e6fdd0d51df459e2595
fix: typing audit — 0 violations, 0 untyped defs across all…
Sonnet 4.6
minor
⚠ breaking
172 days ago
| 1 | """TDD — musehub_proposals must not access commit_meta (dropped in migration 0020).""" |
| 2 | from __future__ import annotations |
| 3 | |
| 4 | import pytest |
| 5 | from datetime import datetime, timezone |
| 6 | from sqlalchemy.ext.asyncio import AsyncSession |
| 7 | |
| 8 | from muse.core.types import blob_id |
| 9 | from musehub.db.musehub_repo_models import MusehubBranch, MusehubCommit, MusehubCommitRef |
| 10 | from tests.factories import create_repo |
| 11 | |
| 12 | |
| 13 | def _utc() -> datetime: |
| 14 | return datetime.now(tz=timezone.utc) |
| 15 | |
| 16 | |
| 17 | async def _add_commit(session: AsyncSession, repo_id: str, seed: str, **kwargs: typing.Any) -> MusehubCommit: |
| 18 | row = MusehubCommit( |
| 19 | commit_id=blob_id(seed.encode()), |
| 20 | branch="feat/x", |
| 21 | parent_ids=[], |
| 22 | message=f"feat: {seed}", |
| 23 | author="gabriel", |
| 24 | timestamp=_utc(), |
| 25 | **kwargs, |
| 26 | ) |
| 27 | session.add(row) |
| 28 | session.add(MusehubCommitRef(repo_id=repo_id, commit_id=row.commit_id)) |
| 29 | session.add(MusehubBranch( |
| 30 | branch_id=blob_id(f"br-{seed}".encode()), |
| 31 | repo_id=repo_id, |
| 32 | name="feat/x", |
| 33 | head_commit_id=row.commit_id, |
| 34 | )) |
| 35 | await session.commit() |
| 36 | return row |
| 37 | |
| 38 | |
| 39 | # --------------------------------------------------------------------------- |
| 40 | # PR1 — _touched_symbols_for_branch does not crash on missing commit_meta |
| 41 | # --------------------------------------------------------------------------- |
| 42 | |
| 43 | @pytest.mark.asyncio |
| 44 | async def test_pr1_touched_symbols_no_commit_meta( |
| 45 | db_session: AsyncSession, |
| 46 | ) -> None: |
| 47 | """_touched_symbols_for_branch must not raise AttributeError on commit_meta.""" |
| 48 | from musehub.services.musehub_proposals import _touched_symbols_for_branch |
| 49 | |
| 50 | repo = await create_repo(db_session, owner="gabriel", visibility="public") |
| 51 | await _add_commit(db_session, repo.repo_id, "pr1-c1", agent_id="claude-code") |
| 52 | |
| 53 | # Must not raise — returns [] since structured_delta is gone |
| 54 | result = await _touched_symbols_for_branch(db_session, repo.repo_id, "feat/x") |
| 55 | assert isinstance(result, list) |
File History
6 commits
sha256:ef10830ce231e0a20efcb0e2586cb879471247e916616e6fdd0d51df459e2595
fix: typing audit — 0 violations, 0 untyped defs across all…
Sonnet 4.6
minor
⚠
172 days ago
sha256:b8884c81af5e135510894a537784c16158ee9c2c05d074f978611bbcb611ca10
fix: port security checks inline, remove repo_id from Museh…
Sonnet 4.6
minor
⚠
181 days ago
sha256:2e9f6b5cc193e07b2c23d17fb71851db72e6160ba472013f5bccab8351264e79
refactor: migrate all musehub_models shim call sites to dom…
Sonnet 4.6
minor
⚠
188 days ago
sha256:3a29a6fd5c0da6ed1e40a498f5c491bee45c684b34936b55e64be6b76413cb52
refactor(tests): eliminate _sha/_sha256_oid/_blob_id wrappe…
Sonnet 4.6
196 days ago
sha256:7918558cb69109fcd34288d56f1937ef56f739f117e9ed22bd8c8b8bf8e9567e
refactor: route all sha256 ID construction through long_id(…
Sonnet 4.6
patch
196 days ago
sha256:95fb42d45d449379bd2c4c2821e6ff70a165f352f163faa8d9ad092d66f37b54
fix: musehub_proposals drops commit_meta/structured_delta, …
Sonnet 4.6
minor
⚠
196 days ago