Repository navigation
Commit 4fc6edd
committed
fix: Address review findings — let-binding crash paths, Step.Name, perf
Review fixes on top of the RFC 0008 wrap-actions commit:
- enter_environment/exit_environment no longer raise a raw
ExpressionError out of the public API when an extra `let` binding
fails to evaluate: the action fails through _fail_action_before_start
with the callback, leaving the environment entered-but-failed exactly
like a failed onEnter subprocess.
- enter_environment(step_name=...) seeds Step.Name (RFC 0007 §7.3.1)
before the extra bindings evaluate, remembered per environment and
re-seeded at exit — openjd-rs parity (the Rust runtime threads the
per-step resolved symtab into both enter and exit).
- let-binding RHS parsing memoized and single-sourced via
openjd.model.evaluate_let_bindings (was re-parsed through the Rust
engine per env-enter/exit/task).
- Wrap environment embedded-file paths allocated once per environment
and reused across wrap-hook invocations (stable Env.File.*, no
O(task-count) temp-file growth); contents still re-resolved per task.
- One resolve_optional_int_field(ge=, le=) replaces three disagreeing
optional-int resolvers — this also adds the previously missing
non-positive check to Session._resolve_action_timeout (openjd-rs
parity).
- Complexity/duplication reductions: _fail_action, shared runner
cancel() via _cancel_with_effective_cancelation,
_make_env_script_runner, _try_inject_wrapped_symbols,
WRAP_HOOK_ACTION_NAMES single-sourced,
SimplifiedEnvironmentVariableChanges.effective_items() (no more
private poking from _collect_session_env_list), whole-field detection
via FormatString.whole_field_expression().
- pyproject: note that the openjd-model pin floor must be the first
release containing model PR #318's surface.
Tests: 647 passed (12 new regression tests: failure paths, Step.Name
enter+exit, parse memoization, int-field bounds, wrap-file reuse);
pre-existing environment failures unchanged. mypy/black/ruff clean.
Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com>1 parent d1ec0d2 commit 4fc6edd
10 files changed
Lines changed: 891 additions & 351 deletions
File tree
- src/openjd/sessions
- test/openjd/sessions_v0
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
234 | 250 | | |
235 | 251 | | |
236 | 252 | | |
237 | 253 | | |
238 | 254 | | |
239 | 255 | | |
240 | 256 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
260 | 293 | | |
261 | 294 | | |
262 | 295 | | |
| |||
0 commit comments