feat(problems): add bounded administrator package imports
Use live maintenance sessions, durable capacity reservations and streamed SHA-bound ZIP uploads. An ordinary capped import worker validates stored/deflated v1/v2 packages, persists immutable unpublished candidates and finite audit events, and recovers or releases capacity after interruption and expiry. Validate actual PG/HTTP/worker/storage fault paths in an isolated capped VM (2 passed, 0 skipped), reuse unchanged actual migration roundtrip evidence, and pass affected backend/architecture checks plus the prior full engineering checks.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import asyncio
|
||||
import json
|
||||
import subprocess
|
||||
from uuid import uuid4
|
||||
|
||||
import asyncpg
|
||||
@@ -12,7 +13,7 @@ def test_migration_roundtrip_and_role_safety(postgres_url):
|
||||
c = await connect(postgres_url)
|
||||
try:
|
||||
tables = set(await c.fetch("SELECT tablename FROM pg_tables WHERE schemaname='public'"))
|
||||
assert len(tables) == 15 # Fourteen domain/control tables and Alembic history.
|
||||
assert len(tables) == 20 # Nineteen domain/control tables and Alembic history.
|
||||
roles = await c.fetch("SELECT * FROM pg_roles WHERE rolname LIKE 'kf_oj_%'")
|
||||
assert {row["rolname"] for row in roles} == {
|
||||
"kf_oj_platform",
|
||||
@@ -44,7 +45,14 @@ def test_migration_roundtrip_and_role_safety(postgres_url):
|
||||
asyncio.run(inspect())
|
||||
migrate(postgres_url, "downgrade", "base")
|
||||
migrate(postgres_url, "upgrade", "head")
|
||||
migrate(postgres_url, "check")
|
||||
try:
|
||||
migrate(postgres_url, "check")
|
||||
except subprocess.CalledProcessError as error:
|
||||
raise AssertionError(
|
||||
"migration model consistency failed: "
|
||||
+ (error.stdout or b"").decode(errors="replace")[-8192:]
|
||||
+ (error.stderr or b"").decode(errors="replace")[-8192:]
|
||||
) from None
|
||||
asyncio.run(inspect())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user