fix(3 U5.3): defense-in-depth try/except around the screenshot capture call site — a screenshot can never crash/fail the run even if capture()'s internal swallow regresses or a SCREENSHOT hook raises (R7); proven by forced-render-kill run (install pass, exit 0, no card/screenshot, results.json intact)
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@ -974,10 +974,19 @@ def main() -> int:
|
|||||||
# returns None, so this never blocks or fails the run (R7). None → results.json `screenshot`
|
# returns None, so this never blocks or fails the run (R7). None → results.json `screenshot`
|
||||||
# stays null → the card shows the "no screenshot" placeholder (cosmetics never change verdict).
|
# stays null → the card shows the "no screenshot" placeholder (cosmetics never change verdict).
|
||||||
if deploy_ok:
|
if deploy_ok:
|
||||||
shot = screenshot_mod.capture(
|
# capture() already swallows all errors → None; the extra try/except is defense-in-depth
|
||||||
domain, screenshot_mod.screenshot_path(run_artifact_dir), recipe_meta=meta
|
# (U5 R7 hardening) so a screenshot can NEVER fail/crash the run even if that internal
|
||||||
)
|
# contract regresses or a recipe SCREENSHOT hook raises. Cosmetics never change the verdict.
|
||||||
screenshot_rel = os.path.basename(shot) if shot else None
|
try:
|
||||||
|
shot = screenshot_mod.capture(
|
||||||
|
domain, screenshot_mod.screenshot_path(run_artifact_dir), recipe_meta=meta
|
||||||
|
)
|
||||||
|
screenshot_rel = os.path.basename(shot) if shot else None
|
||||||
|
except Exception as e: # noqa: BLE001 — screenshot is cosmetic; never fail a run on it (R7)
|
||||||
|
print(
|
||||||
|
f"!! screenshot capture raised (non-fatal, verdict unaffected): {_scrub(str(e))}",
|
||||||
|
flush=True,
|
||||||
|
)
|
||||||
|
|
||||||
# ---- INSTALL tier (always; additive generic + overlay, no op) ----
|
# ---- INSTALL tier (always; additive generic + overlay, no op) ----
|
||||||
if "install" in stages:
|
if "install" in stages:
|
||||||
|
|||||||
Reference in New Issue
Block a user