runner: never embed a fossil screenshot from a collided run dir (#45)
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit was merged in pull request #45.
This commit is contained in:
2026-10-05 17:46:25 +00:00
parent 5cec3e0e31
commit 35ba99768c
5 changed files with 169 additions and 5 deletions
+6 -5
View File
@@ -142,12 +142,13 @@ def capture(domain: str, out_path: str, *, recipe_meta: dict | None = None) -> s
page = context.new_page()
if hook is not None:
# Recipe-specific safe view (post-login etc.). The hook owns navigation +
# the no-secret-page guarantee; it should call page.screenshot itself, but if
# it doesn't, we still snap the resulting page below. SCREENSHOT(page, ctx) —
# the uniform ctx convention (rcust P3).
# the no-secret-page guarantee; we ALWAYS snap the page after it returns.
# Never trust a pre-existing out_path: a recycled run artifact dir (drone
# build numbers restarted 2026-09-27 while old-era dirs linger) must not get
# its fossil screenshot embedded (observed 2026-10-05, !testme gitea #10
# build 35). SCREENSHOT(page, ctx) — the uniform ctx convention (rcust P3).
hook(page, meta_mod.hook_ctx(domain, recipe_meta))
if not os.path.exists(out_path):
_snap_with_blank_retry(page, out_path)
_snap_with_blank_retry(page, out_path)
else:
# Default: landing page. Accept any rendered status (200 or an auth redirect to a
# login form) — both are credential-free and representative of "the app is up".