279c6112ae
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 17s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 34s
CI / unit_tests (pull_request) Successful in 1m48s
CI / docker (pull_request) Successful in 39s
CI / integration_tests (pull_request) Successful in 3m26s
CI / coverage (pull_request) Successful in 4m15s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 17s
CI / typecheck (push) Successful in 31s
CI / security (push) Successful in 31s
CI / benchmark-regression (push) Has been skipped
CI / build (push) Successful in 17s
CI / unit_tests (push) Successful in 3m1s
CI / integration_tests (push) Successful in 4m28s
CI / docker (push) Successful in 1m1s
CI / coverage (push) Successful in 4m33s
CI / benchmark-publish (push) Successful in 14m26s
CI / benchmark-regression (pull_request) Successful in 25m42s
Added three new built-in resource types: container-instance, devcontainer-instance, and devcontainer-file. The devcontainer-instance type inherits from container-instance per ADR-042 and is auto-discovered when git-checkout or fs-directory resources contain .devcontainer/ directories per ADR-043. Implementation includes: - DevcontainerHandler extending BaseResourceHandler with snapshot strategy - Auto-discovery module scanning .devcontainer/devcontainer.json and root .devcontainer.json with JSON validation - CLI support for devcontainer-instance and container-instance via agents resource add with --path and --image flags - Behave feature with 22 scenarios covering manual registration, auto-discovery, invalid JSON handling, and protocol conformance - Robot integration tests with 10 test cases for CLI round-trip and DAG hierarchy validation - ASV benchmarks measuring discovery throughput with varying subdirectory counts, handler resolver cache performance, and result construction - Reference documentation at docs/reference/devcontainer_resources.md ISSUES CLOSED: #511
114 lines
5.4 KiB
Gherkin
114 lines
5.4 KiB
Gherkin
Feature: Devcontainer Resource Handler
|
|
As a CleverAgents developer
|
|
I want devcontainer resources to be auto-discovered and manually registered
|
|
So that devcontainer environments integrate into the resource model
|
|
|
|
# ── Manual registration ────────────────────────────────────
|
|
|
|
Scenario: Register devcontainer-instance manually
|
|
Given a temporary directory with a valid devcontainer.json
|
|
When I create a devcontainer-instance resource at that path
|
|
Then the resource should have type "devcontainer-instance"
|
|
And the resource should have a non-empty resource_id
|
|
|
|
Scenario: Register container-instance manually
|
|
When I create a container-instance resource with image "ubuntu:latest"
|
|
Then the container resource should have type "container-instance"
|
|
|
|
# ── Auto-discovery from git resource ───────────────────────
|
|
|
|
Scenario: Auto-discover devcontainer from git-checkout resource
|
|
Given a temporary directory simulating a git checkout
|
|
And the directory has a .devcontainer/devcontainer.json file
|
|
When I run devcontainer discovery on the directory as "git-checkout"
|
|
Then discovery should return 1 result
|
|
And the discovered config path should end with "devcontainer.json"
|
|
|
|
Scenario: Auto-discover root devcontainer.json from git-checkout
|
|
Given a temporary directory simulating a git checkout
|
|
And the directory has a root .devcontainer.json file
|
|
When I run devcontainer discovery on the directory as "git-checkout"
|
|
Then discovery should return 1 result
|
|
|
|
Scenario: Auto-discover both devcontainer locations
|
|
Given a temporary directory simulating a git checkout
|
|
And the directory has a .devcontainer/devcontainer.json file
|
|
And the directory has a root .devcontainer.json file
|
|
When I run devcontainer discovery on the directory as "git-checkout"
|
|
Then discovery should return 2 results
|
|
|
|
# ── Auto-discovery from filesystem resource ─────────────────
|
|
|
|
Scenario: Auto-discover devcontainer from fs-directory resource
|
|
Given a temporary directory simulating a filesystem mount
|
|
And the directory has a .devcontainer/devcontainer.json file
|
|
When I run devcontainer discovery on the directory as "fs-directory"
|
|
Then discovery should return 1 result
|
|
|
|
Scenario: No discovery for non-trigger resource types
|
|
Given a temporary directory simulating a filesystem mount
|
|
And the directory has a .devcontainer/devcontainer.json file
|
|
When I run devcontainer discovery on the directory as "fs-file"
|
|
Then discovery should return 0 results
|
|
|
|
# ── Invalid devcontainer.json handling ──────────────────────
|
|
|
|
Scenario: Skip invalid JSON in devcontainer.json
|
|
Given a temporary directory with an invalid devcontainer.json
|
|
When I run devcontainer discovery on the directory as "git-checkout"
|
|
Then discovery should return 0 results
|
|
|
|
Scenario: Skip non-object JSON in devcontainer.json
|
|
Given a temporary directory with a non-object devcontainer.json
|
|
When I run devcontainer discovery on the directory as "git-checkout"
|
|
Then discovery should return 0 results
|
|
|
|
Scenario: Handle missing devcontainer directory gracefully
|
|
Given a temporary directory with no devcontainer configuration
|
|
When I run devcontainer discovery on the directory as "git-checkout"
|
|
Then discovery should return 0 results
|
|
|
|
# ── Resource tree display ──────────────────────────────────
|
|
|
|
Scenario: Devcontainer types appear in resource type list
|
|
Given the built-in resource type registry
|
|
When I list all built-in type names
|
|
Then the type list should contain "devcontainer-instance"
|
|
And the type list should contain "devcontainer-file"
|
|
And the type list should contain "container-instance"
|
|
|
|
# ── Handler protocol conformance ───────────────────────────
|
|
|
|
Scenario: DevcontainerHandler satisfies ResourceHandler protocol
|
|
When I instantiate DevcontainerHandler
|
|
Then it should satisfy the ResourceHandler protocol
|
|
|
|
Scenario: DevcontainerHandler has correct default strategy
|
|
When I instantiate DevcontainerHandler
|
|
Then its default strategy should be "snapshot"
|
|
|
|
Scenario: DevcontainerHandler has correct type label
|
|
When I instantiate DevcontainerHandler
|
|
Then its type label should be "devcontainer"
|
|
|
|
# ── Discovery result validation ────────────────────────────
|
|
|
|
Scenario: Discovery result requires valid config_path
|
|
When I create a discovery result with valid parameters
|
|
Then the result should have a config_path attribute
|
|
|
|
Scenario: Discovery result rejects empty parent_location
|
|
When I create a discovery result with empty parent_location
|
|
Then it should raise a ValueError
|
|
|
|
# ── is_trigger_type checks ────────────────────────────────
|
|
|
|
Scenario: git-checkout is a trigger type
|
|
Then "git-checkout" should be a trigger type
|
|
|
|
Scenario: fs-directory is a trigger type
|
|
Then "fs-directory" should be a trigger type
|
|
|
|
Scenario: devcontainer-instance is not a trigger type
|
|
Then "devcontainer-instance" should not be a trigger type
|