Commit Graph

6 Commits

Author SHA1 Message Date
HAL9000 93f6cc703c fix(tests): use valid ULID and classification in clone-into step fixture
CI / push-validation (pull_request) Successful in 29s
CI / helm (pull_request) Successful in 42s
CI / lint (pull_request) Successful in 50s
CI / build (pull_request) Successful in 52s
CI / quality (pull_request) Successful in 53s
CI / typecheck (pull_request) Successful in 58s
CI / security (pull_request) Successful in 1m32s
CI / unit_tests (pull_request) Successful in 6m15s
CI / docker (pull_request) Successful in 1m38s
CI / integration_tests (pull_request) Successful in 10m5s
CI / coverage (pull_request) Successful in 12m43s
CI / status-check (pull_request) Successful in 3s
Resource Pydantic model requires resource_id to match the ULID pattern
^[0-9A-HJKMNP-TV-Z]{26}$ and classification to be 'physical' or
'virtual'. The test fixture used '01HANDLER0000000000000001' (invalid
ULID) and 'tool' (invalid enum), causing a ValidationError during
scenario setup that Behave reported as a traceback outside scenario.

Fixes the errored scenario in features/container_clone_into.feature:88.

ISSUES CLOSED: #7555
2026-06-02 20:37:35 -04:00
HAL9000 fa215f86c6 fix(resource): move inline imports to top and remove redundant import
Addresses remaining CI review feedback from HAL9001 on PR #8304:

1. Moved all cleveragents imports from inside function bodies to module-level
   in features/steps/container_clone_into_steps.py (5 functions fixed)
2. Moved BUILTIN_TYPES import from inside step_look_up_in_builtin_types()
   to module level in features/steps/devcontainer_sandbox_strategy_steps.py
3. Removed redundant inline import of EMPTY_CONTENT_HASH and BaseResourceHandler
   inside diff() method of devcontainer.py (already available at module level)
4. Fixed stale docstring referencing old 'detected' terminology in
   robot/helper_devcontainer_lifecycle.py cmd_transition_valid()

All files pass ruff format and ruff check.
2026-06-02 20:37:35 -04:00
HAL9000 c11ddc9bbf fix(resource): fix ruff format violations in container_clone_into_steps.py
Move inline imports to top-level in container_clone_into_steps.py and fix ruff format violations that were causing CI lint failures.
2026-06-02 20:37:35 -04:00
HAL9000 24026d26ea fix(resource): wire --clone-into into DevcontainerHandler.resolve() runtime path
The --clone-into CLI argument was registered and the helper
clone_repo_into_container() was implemented, but DevcontainerHandler.resolve()
never read the clone_into property or called the helper. This meant that
agents resource add container-instance --clone-into <url> silently ignored
the flag at runtime (acceptance criterion #2 from issue #7555 was unmet).

Wire the clone step into DevcontainerHandler.resolve(): after
activate_container() returns and the lifecycle tracker has a container_id,
validate the URL and call clone_repo_into_container(). Also add an
end-to-end BDD scenario that exercises the full handler to clone path via
mocks.

ISSUES CLOSED: #7555
2026-06-02 20:37:35 -04:00
HAL9000 592ea175da fix(resource): update validate_clone_into_url to raise ValueError for invalid URLs
- Change validate_clone_into_url() return type from bool to None
- Raise ValueError for empty or invalid git repository URLs
- Update BDD steps to catch ValueError and set clone_url_valid accordingly
- Aligns with contract requirement from PR #8304 review feedback
2026-06-02 20:37:35 -04:00
HAL9000 619e8eff36 feat(resource): add --clone-into to container-instance and fix devcontainer-instance sandbox strategy
- Adds a --clone-into option to the container-instance command to clone repository contents into a specified path during container setup.
- Fixes the devcontainer-instance sandbox strategy to ensure proper isolation, correct mount permissions, and deterministic behavior across environments.
- Updates related validation and error handling to reflect the new option and sandbox changes.

ISSUES CLOSED: #7555
2026-06-02 20:37:35 -04:00