Repository navigation
Commit c504288
committed
Add the client side of the pre-render environment preflight
A render against a machine that is missing a runtime, a library, a credential
or an executable test script cannot succeed. It loops through failing tests
until it gives up, spending a credit on every attempt. This adds a preflight
that runs before the first functionality is rendered and turns that into a
single actionable failure up front.
The preflight has two layers. The static layer is deterministic and needs no
server: git and bash are installed, every configured test script exists and is
executable, the script flavour matches the platform, the build folder is
writable. The planned layer asks the server which checks this particular
project needs, given its specs, linked resources, test scripts and a
description of the host.
A plan from the server is untrusted input, so env_check/checks.py is the only
place that turns a plan entry into an action, and it never executes a string
the plan supplied. A plan selects a type from a fixed registry and supplies
arguments that are validated first; binaries are resolved through which() and
spawned from an argument list without a shell; the only flags ever passed to a
binary the client did not choose are version flags from an allowlist.
Everything that does not validate is dropped with a recorded reason rather than
raising, so a malformed or unrecognised entry can never stop a render.
Only a failed error-severity finding blocks. Warnings, skipped checks, an
unreachable server and a context that cannot be assembled all leave the render
free to proceed.
Adds --skip-env-check to bypass the preflight and --env-check-only to run it
without rendering, which exits non-zero when the environment is not ready.1 parent 6ddfa74 commit c504288
17 files changed
Lines changed: 2035 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
176 | 197 | | |
177 | 198 | | |
178 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments