feat: add support for setup script execution before scans#611
feat: add support for setup script execution before scans#611TheArtificialQ wants to merge 1 commit into
Conversation
Greptile SummaryThis PR adds a
Confidence Score: 3/5The feature works correctly for the happy path, but a failed setup script leaves the Docker container running with no automatic cleanup. When the setup script exits non-zero,
Important Files Changed
|
| import contextlib | ||
| import logging | ||
| import time | ||
| from collections.abc import Callable |
There was a problem hiding this comment.
contextlib is imported but never referenced anywhere in this file — it looks like a leftover from development. This will produce an F401 lint warning.
| import contextlib | |
| import logging | |
| import time | |
| from collections.abc import Callable | |
| import logging | |
| import time | |
| from collections.abc import Callable |
Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/runtime/session_manager.py
Line: 5-8
Comment:
`contextlib` is imported but never referenced anywhere in this file — it looks like a leftover from development. This will produce an `F401` lint warning.
```suggestion
import logging
import time
from collections.abc import Callable
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| if args.setup_script is None and state.get("setup_script"): | ||
| args.setup_script = state.get("setup_script") |
There was a problem hiding this comment.
Resumed setup-script path not re-validated
When a scan is resumed and the setup script path is loaded from persisted state, the value bypasses _resolve_setup_script_path. If the file was moved or deleted between runs, build_setup_script_mount raises a bare FileNotFoundError rather than a user-friendly parser.error() message. Consider calling _resolve_setup_script_path here (or at least catching FileNotFoundError at the call site and converting it to a parser.error).
Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/interface/main.py
Line: 651-652
Comment:
**Resumed setup-script path not re-validated**
When a scan is resumed and the setup script path is loaded from persisted state, the value bypasses `_resolve_setup_script_path`. If the file was moved or deleted between runs, `build_setup_script_mount` raises a bare `FileNotFoundError` rather than a user-friendly `parser.error()` message. Consider calling `_resolve_setup_script_path` here (or at least catching `FileNotFoundError` at the call site and converting it to a `parser.error`).
How can I resolve this? If you propose a fix, please make it concise.
Adding
--setup-scriptCLI parameter.It's a path to a bash script to execute inside the Docker container as the first step before the scan begins. Use this to install dependencies, seed databases, establish VPN connections, or perform other environment preparation. The script is bind-mounted read-only into the sandbox and run with
bash.