mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
[video-engine] Per-project video_engine_enabled opt-in toggle
Mirrors ci_watch_enabled (migration 048): the global ROBOCO_VIDEO_ENGINE_ENABLED flag arms the subsystem; the new projects.video_engine_enabled column (migration 063) opts a repo into authoring against its motion/ dir. VideoEngine._opted_in_project no-ops open_video_task at the single chokepoint covering all three trigger paths (on-release, on-spotlight, CEO on-demand) until the operator flips it in the panel edit-project dialog. Existing projects stay opted out (server_default=false).
This commit is contained in:
@@ -72,6 +72,7 @@ async def _seed(session: AsyncSession) -> None:
|
||||
assigned_cell=Team.BACKEND,
|
||||
created_by=SYSTEM_UUID,
|
||||
is_active=True,
|
||||
video_engine_enabled=True,
|
||||
)
|
||||
)
|
||||
await session.flush()
|
||||
@@ -214,6 +215,27 @@ async def test_open_video_task_unresolvable_project_opens_nothing(
|
||||
assert await get_task_service(db_session).list_open_video_posts() == []
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_open_video_task_no_op_when_project_not_opted_in(
|
||||
db_session: AsyncSession, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
await _seed(db_session)
|
||||
# Flip the per-project opt-in back off — the global flag stays on.
|
||||
await db_session.execute(
|
||||
ProjectTable.__table__.update()
|
||||
.where(ProjectTable.__table__.c.slug == SLUG)
|
||||
.values(video_engine_enabled=False)
|
||||
)
|
||||
await db_session.flush()
|
||||
_enable(monkeypatch)
|
||||
engine = video_engine_module.VideoEngine(db_session)
|
||||
task = await engine.open_video_task(
|
||||
occasion="release v1.0.0", script="s", platforms=["x"], brief="b"
|
||||
)
|
||||
assert task is None
|
||||
assert await get_task_service(db_session).list_open_video_posts() == []
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_open_video_task_insert_error_returns_none_session_usable(
|
||||
db_session: AsyncSession, monkeypatch: pytest.MonkeyPatch
|
||||
@@ -255,6 +277,7 @@ async def test_open_video_task_insert_error_returns_none_session_usable(
|
||||
assigned_cell=Team.BACKEND,
|
||||
created_by=SYSTEM_UUID,
|
||||
is_active=True,
|
||||
video_engine_enabled=True,
|
||||
)
|
||||
)
|
||||
await db_session.flush()
|
||||
|
||||
Reference in New Issue
Block a user