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
The devcontainer_handler_protocol_methods.feature file and its step
definitions still referenced the old ContainerLifecycleState.DETECTED
terminology. Update to DISCOVERED for consistency with specification.
ISSUES CLOSED: #7555
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.
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
The prune method was calling session.flush() but never committing the
transaction, causing the deleted checkpoints to not be persisted to the
database. This fix adds the missing session.commit() call to ensure
changes are properly committed.
- 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
- Remove committed build artifacts (test_reports/summary.txt,
test_reports/test_results.json) and add test_reports/ to .gitignore
- Fix CLI resource.py: update lifecycle state condition and warning
banner from 'detected (not built)' to 'discovered (not built)' and
'Devcontainer detected' to 'Devcontainer discovered' to align with
ContainerLifecycleState.DISCOVERED rename
- Fix BDD feature file: update resource_list_lifecycle_state.feature
scenario title and assertion from 'Devcontainer detected' to
'Devcontainer discovered'
- Fix robot/helper_devcontainer_lifecycle.py: update enum value check
from 'detected' to 'discovered' in cmd_enum_values()
- Fix robot/helper_devcontainer_handler.py: update strategy check
assertion from 'none' to 'snapshot' to match PR #8304 change
- Update CONTRIBUTORS.md with HAL 9000 feature contribution entry
Closes#7555 (via PR #8304)
Fixes: CI unit_tests and integration_tests failures from PR #8304
- 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