feat(solution): 발행 워커·버전 관리와 예약·미리보기 정리

상시 프리렌더와 중복 예약 안내를 없애고, 검수된 발행 버전을 보존한다. 미리보기는 실제 렌더 완료까지 스피너를 표시한다.

사이트 81건, 발행·롤백·서치콘솔 45건, 프로세스 수명 3건 통과. 빌더·사이트 빌드 및 compose 설정 검증 통과.
This commit is contained in:
minaChoi committed 2026-09-15 16:12:16 +09:00
1 parent 0f7d22750f
commit f2087aad5e
207 files changed
+8424 -4429

No files matched your search

+14 -14
View File
@@ -100,10 +100,10 @@ async def test_unverified_fact_blocks_publish(auth_headers, client, db_engine):
(필수 항목 누락은 2026-08-27 부터 막지 않는다. 그래서 여기서 걸리는 사유가 바뀌었다.)"""
h = await auth_headers("u1")
pid = await _place(client, h, "미검증펜션")
# 크롤링으로만 들어온 값 = 후보 상태
# 크롤링은 바로 노출되는 정책이다. 실제 미검증 상태를 만드는 API 출처로 검사한다.
for k, v in REQUIRED.items():
await client.post(f"/v1/place/{pid}/fact", headers=h, json={
"key": k, "value": v, "source_type": SourceType.CRAWL.value, "source_url": "https://ota.test/1"})
"key": k, "value": v, "source_type": SourceType.API.value, "source_url": "https://api.test/1"})
job_id = (await client.post(f"/v1/place/{pid}/site/build", headers=h, json={"publish": True})).json()["job_id"]
await _run()
@@ -292,17 +292,17 @@ async def _build(client, h, pid, publish=True):
async def test_렌더가_실패하면_발행하지_않는다(auth_headers, client, db_engine, monkeypatch):
"""검증: 렌더러가 페이지를 굽지 못했다고 보고한다.
기대결과: ★ FAILED. 페이지가 없는데 "발행됨"으로 남으면 사장님은 404 를 눌러야 안다."""
from services import render_report
from services import render_service
async def _broken(slug, site_version, timeout_sec, poll_sec=1.0):
return {"schemaVersion": 1, "slug": slug, "siteId": "", "placeId": "",
async def _broken(payload_path, site_version, timeout_sec):
return {"schemaVersion": 1, "slug": "t", "siteId": "", "placeId": "",
"siteVersion": site_version, "ok": False, "renderedAt": "2026-01-01T00:00:00Z",
"routes": 0, "bundle": "t.js", "uniqueContentCount": 5, "jsonld": [],
"mismatches": [], "error": "번들이 없다"}
h = await auth_headers("u1")
pid = await _built_place(client, h, db_engine)
monkeypatch.setattr(render_report, "wait_for", _broken)
monkeypatch.setattr(render_service, "render_site", _broken)
r = await _build(client, h, pid)
assert r["build_status"] == "FAILED"
@@ -316,10 +316,10 @@ async def test_렌더가_실패하면_발행하지_않는다(auth_headers, clien
async def test_구조화데이터가_화면과_다르면_발행하지_않는다(auth_headers, client, db_engine, monkeypatch):
"""검증: 렌더러가 JSON-LD 불일치를 보고한다.
기대결과: ★ JSONLD_MISMATCH — 검색엔진에만 다른 말을 하는 페이지는 나가면 안 된다."""
from services import render_report
from services import render_service
async def _mismatch(slug, site_version, timeout_sec, poll_sec=1.0):
return {"schemaVersion": 1, "slug": slug, "siteId": "", "placeId": "",
async def _mismatch(payload_path, site_version, timeout_sec):
return {"schemaVersion": 1, "slug": "t", "siteId": "", "placeId": "",
"siteVersion": site_version, "ok": False, "renderedAt": "2026-01-01T00:00:00Z",
"routes": 0, "bundle": "t.js", "uniqueContentCount": 5, "jsonld": [],
"mismatches": ["telephone: '02-0000-0000' 이 화면에 없다"],
@@ -327,7 +327,7 @@ async def test_구조화데이터가_화면과_다르면_발행하지_않는다(
h = await auth_headers("u1")
pid = await _built_place(client, h, db_engine)
monkeypatch.setattr(render_report, "wait_for", _mismatch)
monkeypatch.setattr(render_service, "render_site", _mismatch)
r = await _build(client, h, pid)
assert r["build_status"] == "FAILED"
@@ -339,14 +339,14 @@ async def test_구조화데이터가_화면과_다르면_발행하지_않는다(
async def test_렌더_결과가_안_오면_발행하지_않는다(auth_headers, client, db_engine, monkeypatch):
"""검증: 렌더러가 죽어 보고서가 오지 않는다(타임아웃).
기대결과: ★ FAILED. 확인하지 못한 것을 발행됨으로 남기지 않는다."""
from services import render_report
from services import render_service
async def _timeout(slug, site_version, timeout_sec, poll_sec=1.0):
return None
async def _timeout(payload_path, site_version, timeout_sec):
raise render_service.RenderFailed("렌더 결과를 받지 못했다 — 렌더러가 도는지 확인이 필요하다")
h = await auth_headers("u1")
pid = await _built_place(client, h, db_engine)
monkeypatch.setattr(render_report, "wait_for", _timeout)
monkeypatch.setattr(render_service, "render_site", _timeout)
r = await _build(client, h, pid)
assert r["build_status"] == "FAILED"