8, "wing" => "Deploy", "title" => "A bad manifest is shown, not applied", "promise" => "A mistake in an app's settings file (ratcloud.conf) leaves the old settings running and says what was wrong.", "block" => "ratcloud.conf is checked before anything is applied. A bad one refuses the push, in the pusher's terminal and in RC_FACTS/manifest.json; the site keeps running.", "show" => function (?array $me): string { $s = stored(8)["data"] ?? null; $url = rc_app_url("zoo-broken"); if (!$s) return '
The sample app zoo-broken has not been checked yet.
'; return 'The sample app ' . h(parse_url($url, PHP_URL_HOST)) . ' is up, and its last push was refused:
' . '' . h($s["error"] ?? "") . "" . '
Refused ' . ago(strtotime($s["at"] ?? "now")) . ", commit " . h(substr($s["commit"] ?? "", 0, 7)) . ". It still serves its last good version.
"; }, "check" => function (): array { $url = rc_app_url("zoo-broken"); [$code] = (new Browser())->get("$url/"); if ($code !== 200) return [false, "the sample app is down ($code): a bad manifest must not take it down"]; [$code, , $m] = (new Browser())->get("$url/manifest.json"); if ($code !== 200 || !is_array($m)) return [false, "the sample app's manifest fact did not load ($code)"]; if (($m["ok"] ?? null) !== false) return [false, "the sample app's typo was accepted, or is gone: no error to show"]; if (trim((string)($m["error"] ?? "")) === "") return [false, "the push was refused but no error was recorded"]; return [true, "zoo-broken is up on its last good version; its typo was refused with: " . $m["error"], $m]; }, ];